Repository navigation
PromptGuard CLI v2.5.2
PromptGuard CLI v2.5.2
Fixed
- Clients rewritten by
initandapplynow authenticate to the proxy.
The rewrite added the proxy base URL but never theX-API-Keyheader, the
only place the proxy reads your PromptGuard key from, so every rewritten
client got401 missing_api_key. It now addsdefault_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 runinitorapplyagain. 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
initandapplynow reach the proxy.
The rewrite used the/api/v1proxy URL, but the Anthropic SDK appends
/v1itself, so requests went to/api/v1/v1/messages; and the SDK sends
its key inX-Api-Key, the header the proxy reads your PromptGuard key
from. The rewrite now uses the proxy URL without/v1, sends your
PromptGuard key asX-API-Key, and moves your Anthropic key out of
api_key/apiKeyintoAuthorization: Bearer, which the proxy forwards
to Anthropic. A client an earlier version rewrote is repaired when you run
initorapplyagain. Calls that setauth_token,credentials,
profileor headers of their own are listed for manual routing (#66). A
client that took its credential fromANTHROPIC_AUTH_TOKEN, a profile or
workload identity in the environment now sendsANTHROPIC_API_KEYinstead:
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 | shManual install:
- Download the binary for your platform below
- Make it executable:
chmod +x promptguard-* - Move to PATH:
sudo mv promptguard-* /usr/local/bin/promptguard - 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