Infisical's Agent Vault Stops Prompt Injection From Stealing Your AI Agent's API Keys
Infisical's Agent Vault is an HTTP credential broker that keeps API keys out of AI agents, blocking prompt injection exfiltration attacks.
Takeaways
- Infisical released Agent Vault, an open-source HTTP proxy that keeps API keys away from AI agents.
- Agents send requests with dummy placeholders like
__anthropic_api_key__, and the proxy swaps in real credentials on outbound calls. - Works with Claude Code, Cursor, Codex, OpenClaw, Hermes, and any HTTP-capable agent via standard
HTTPS_PROXY. - Single Go binary, SQLite by default, Postgres for production, plus a TypeScript SDK for ephemeral sandbox tokens.
- Adds egress filtering, request logging, and multi-tenant token scoping on top of MITM proxying.
- Requires deployment on a separate host from agents; docs here, MIT licensed, still in preview.
AI agents have a dirty secret sitting in a .env file: they can read every credential you give them. If a prompt injection tricks the model into leaking those keys, an attacker walks off with your Anthropic account, your GitHub PAT, and whatever else was in scope. Agent Vault, an open-source Go project from Infisical, tries to make that class of attack architecturally impossible by never letting the agent see the real secrets in the first place.
The design is straightforward. Put a proxy between the agent and the outside world, store the real credentials in the proxy, and have the agent send requests with dummy placeholders that the proxy swaps in on the way out. The agent gets its API call answered, the LLM never sees the key, and prompt injection loses its most valuable payload.
Why env vars fail the agent era
Traditional secrets management hands credentials back to your applications and services at runtime. That model breaks with AI agents, which can be coaxed via prompt injection into leaking whatever they can read. Every environment variable, every token in memory, every file on disk is fair game once the model decides to be helpful to the wrong instruction.
With Agent Vault, credentials like ANTHROPIC_API_KEY or GITHUB_PAT live inside the vault, and agents route HTTP traffic through it. The vault intercepts each request and attaches the real credential before forwarding upstream, so the agent process only ever holds placeholder strings that are useless if leaked.