Skip to content

PromptGuard CLI v2.5.2

Choose a tag to compare

@github-actions github-actions released this 15 Nov 19:34
· 3 commits to main since this release

PromptGuard CLI v2.5.2

Fixed

  • Clients rewritten by init and apply now authenticate to the proxy.
    The rewrite added the proxy base URL but never the X-API-Key header, the
    only place the proxy reads your PromptGuard key from, so every rewritten
    client got 401 missing_api_key. It now adds default_headers (Python) or
    defaultHeaders (TypeScript) carrying the key, and leaves your provider key
    where it was: a client with no arguments used to get your PromptGuard key as
    its provider key, which the proxy forwards to the provider, where it failed.
    A client an earlier version rewrote (the proxy URL, no header) gets the
    header added when you run init or apply again. Calls the rewrite cannot
    make work are left untouched and listed for manual routing: ones that
    already set headers or pass dynamic options (**cfg, ...cfg),
    cohere.Client, and the TypeScript Hugging Face and Cohere clients.
  • Anthropic clients rewritten by init and apply now reach the proxy.
    The rewrite used the /api/v1 proxy URL, but the Anthropic SDK appends
    /v1 itself, so requests went to /api/v1/v1/messages; and the SDK sends
    its key in X-Api-Key, the header the proxy reads your PromptGuard key
    from. The rewrite now uses the proxy URL without /v1, sends your
    PromptGuard key as X-API-Key, and moves your Anthropic key out of
    api_key / apiKey into Authorization: Bearer, which the proxy forwards
    to Anthropic. A client an earlier version rewrote is repaired when you run
    init or apply again. Calls that set auth_token, credentials,
    profile or headers of their own are listed for manual routing (#66). A
    client that took its credential from ANTHROPIC_AUTH_TOKEN, a profile or
    workload identity in the environment now sends ANTHROPIC_API_KEY instead:
    store your Anthropic key in PromptGuard as a provider key, which the proxy
    uses in place of the header.
    Drop-in LLM security for your applications - Built with Rust + Tree-sitter

Installation

One-line install (macOS/Linux):

curl -fsSL https://raw.githubusercontent.com/promptguardhq/promptguard-cli/main/install.sh | sh

Manual install:

  1. Download the binary for your platform below
  2. Make it executable: chmod +x promptguard-*
  3. Move to PATH: sudo mv promptguard-* /usr/local/bin/promptguard
  4. Verify: promptguard --version

Checksums

SHA256 checksums are provided for each binary (.sha256 files).

About PromptGuard CLI

  • ✅ Real AST transformations using Tree-sitter
  • ✅ TypeScript, JavaScript, Python support
  • ✅ OpenAI, Anthropic, Cohere, HuggingFace providers
  • ✅ Automatic backups with safe revert
  • ✅ Single 5.3MB static binary

Supported Platforms

  • macOS ARM64 (M1/M2/M3)
  • macOS x86_64 (Intel)
  • Linux x86_64
  • Windows x86_64

📖 Documentation: https://docs.promptguard.co/cli
🏠 Homepage: https://promptguard.co
🐛 Issues: https://github.com/promptguardhq/promptguard-cli/issues