Infisical Agent Vault: How a Credential Proxy Keeps API Keys Out of AI Agents
HTTPS_PROXY alone won't force agent traffic through a proxy, and we would not treat model refusals as a security boundary. Infisical Agent Vault never hands AI agents the real API key: a TLS-intercepting proxy injects the credential into outbound requests, so the agent holds only a placeholder. Here is what that stops, what it misses, how the open-source and commercial editions differ, and how to deploy it for MCP, CLI and SDK agents.
Traditional secrets management returns credentials to the applications and services that use them. Infisical Agent Vault takes a different route. The agent never holds the real credential.
This guide covers how that credential proxy pattern works, where it reduces risk and where it doesn't. It's organized around a three-layer model we call Placeholder / Proxy / Perimeter:
- Placeholder: the agent holds only a stand-in value, never the real key.
- Proxy: a separate broker holds the real credential, applies policy and injects it into approved requests.
- Perimeter: the network forces every outbound call through that broker.
Why handing secrets to AI agents breaks the old model
Classic secrets management rests on a simple contract. An application you wrote and reviewed authenticates to a secrets manager, gets a credential back and uses it.
Agents break that contract. The Agent Vault repository says so directly: traditional secrets management returns credentials to applications and services, and this breaks down with AI agents, which can be tricked via prompt injection into leaking secrets. Infisical CTO Tony Dang made the same argument at launch: secrets management was built for a world where applications fetched credentials and used them, and that assumption no longer holds for AI agents.
The issue isn't malice. Infisical's launch post concedes that even with sufficient guardrails in place, there is no way to guarantee the agent won't be manipulated into leaking its secrets.
Model-level defenses don't close the gap. The OWASP prompt injection cheat sheet cites Hughes et al. (2024), who reported 89% attack success on GPT-4o and 78% on Claude 3.5 Sonnet with up to 10,000 augmented prompts per request. That study measured jailbreak success with Best-of-N style augmented prompts, not how often indirect prompt injection exfiltrates secrets. We read it as a reason not to treat model refusals as a security boundary.
Instead of trusting the agent with a key, you keep the key out of its context entirely. That's the Placeholder layer. The other two exist to keep it intact.
How the Agent Vault credential proxy works
Infisical describes Agent Vault as a TLS-intercepting, credential-injecting forward proxy built for agent workloads. The flow runs like this:
- The agent gets a placeholder value or session token instead of the real API key.
- Its HTTP traffic goes through the proxy, usually because the HTTPS_PROXY environment variable is set.
- The proxy intercepts the TLS connection, checks the destination host against its configured services and inserts the real credential into the outbound request.
- The request goes upstream with the real credential, and the response comes back to the agent.
In the open-source binary, the server starts an HTTP management API on port 14321 and a transparent HTTP/HTTPS proxy on port 14322.
The upstream API sees a normal authenticated request. The agent, and any inference provider logging its context, sees only the placeholder, which is why the pattern also addresses the provider-log risk discussed in the protection section below.
Certificate trust is a deployment step
We suggest treating certificate trust as an explicit deployment step: with any TLS-intercepting proxy, plan for each agent runtime to trust the certificate authority that signs the proxy's certificates. Install that CA certificate deliberately in each agent image, and follow your edition's documentation for how it's issued. Never turn off certificate verification to make connections work.
Two rules decide whether the guarantee holds
The first is location, which underpins the Proxy layer. According to the repository, Agent Vault is meant to run on a separate machine from your AI agents, so the agents cannot directly access the credentials inside it. If the agent can read the vault's storage, the pattern buys you very little.
The second is enforcement, the Perimeter layer. Setting HTTPS_PROXY alone does not guarantee traffic flows through the proxy, Infisical notes, because the agent can unset it. The variable only guides compliant clients. A full deployment locks the network down so all outbound traffic is forced through Agent Vault.
The control surface: allowlists, deny mode, sessions and audit
A proxy that injects credentials is also a natural place to put policy.
Host matching and deny mode. By default the open-source proxy forwards requests that match no configured service as plain proxy traffic. Switching a vault to strict deny mode (unmatched_host_policy=deny) rejects those requests with HTTP 403.
We'd make deny mode the baseline for every vault. With pass-through on, an agent steered toward an attacker-controlled host can still reach it, just without a brokered credential. Deny mode turns the proxy into an egress allowlist as well as a credential injector. If your edition supports path or HTTP method rules, check the documentation for what granularity is actually enforced.
Time-bound sessions. In the commercial Agent Vault, every agent session expires on a schedule you set, and running agents lose access within 60 seconds of the session ending. Short sessions limit how long a hijacked run can keep using brokered access.
Shared proxies. When several agents share one proxy, they send their session token to it over plain HTTP, a point Infisical's documentation flags as a warning. Keep that setup on a private network that agents and proxy share, such as your own servers, a Kubernetes cluster or self-hosted CI runners.
Audit. All brokered traffic passes one chokepoint, which gives security teams a single place to review what agents call. Before relying on it as evidence, find out what your edition records and how long it keeps that data, then confirm you can export it. If you already trace agent runs with OpenTelemetry GenAI tracing, correlate proxy records with those traces instead of treating either one as complete.
What the pattern protects against, and what it doesn't
Per Infisical's documentation, if a prompt injection tricks the agent into revealing a credential, there is nothing there to reveal. That's a real step up from secrets sitting in environment variables the agent can print.
The Hacker News discussion of the launch offered another angle. One commenter argued that the pattern does not solve hostile agents but rather hostile or compromised inference providers, because you do not want secrets in the logs of an AI provider. Either way, keys that never enter prompts, completions or tool outputs never land in third-party logs, whether or not anyone is attacking you.
| Risk | Covered by brokering? | Why |
|---|---|---|
| Prompt injection asking the agent to print or send its keys | Yes | The agent holds only a placeholder |
| Real keys in inference-provider logs | Yes | Real keys never enter the model context |
| Agent bypassing the proxy | Only with network lockdown | HTTPS_PROXY can be unset |
| Misuse of allowed access | No | An allowlisted call still runs |
| Allowlisted endpoints that return credentials (OAuth refresh, token minting, key creation, secret reads) | Not by default | The secret comes back in the response body |
| Token passthrough in MCP chains | No | Depends on correct token audience handling |
Misuse of permitted access. If an agent may call a delete endpoint through the proxy, a manipulated agent can still call it, and the proxy attaches the real credential as usual. Brokering keeps the key secret. It doesn't make the agent's actions safe, and that matters most for event-triggered MCP tools that run without human review.
Credentials in responses. A critic in the same Hacker News thread pointed out that if the credential is an OAuth2 token and the service has a token refresh endpoint, the response would carry a new token straight to the agent. Token-minting, key-creation and secret-read APIs carry the same risk. Brokering protects the request, so you still have to review what comes back.
MCP token handling. The MCP security best practices state that MCP servers must not accept any tokens that were not explicitly issued for the MCP server. A credential proxy doesn't replace correct audience checks inside your MCP servers.
Open source vs commercial Agent Vault: what changed and why it matters
Agent Vault comes from Infisical, which says it processes billions of secrets per month for teams, CI/CD pipelines and servers.
Codeline's independent review at launch noted roughly 800 stars, a Preview label and an API explicitly subject to change. It also described the internals: the master password wraps a random data encryption key through Argon2id with default parameters of 3 iterations, 64 MiB memory and 4 threads. By default the binary keeps all state in a local SQLite database that needs no setup, and PostgreSQL is the option for production.
Within a few months, by Infisical's later count, Agent Vault had crossed 2,000 GitHub stars, with tens of thousands of installations and millions of agent runs. Those are vendor figures and haven't been independently verified.
A note on naming: Infisical calls the paid edition the commercial Agent Vault when describing sessions, and calls its broker component Agent Proxy when describing the redesign. We use both terms the same way here.
The bigger change is architectural. Looking back on the first release, Infisical explained that it had bundled two distinct concepts into one: the secrets store and the secrets broker. In the commercial Agent Vault, Agent Proxy separates them and ships with 30+ presets for common services, including LLM providers such as Anthropic and OpenAI and services like GitHub, Slack and Datadog. As for the open-source repository, the company says it stays up and you can run it, but it is not actively maintained and was never built for a team.
Our sources also describe unmatched-host handling only for the open-source repo and session expiry only for the commercial edition. Check current documentation for the other edition rather than assuming parity.
We suggest treating the open-source repository as a tool for learning and prototyping. For production, we'd look at the commercial edition or an in-house fork you're prepared to maintain. Weigh maintenance burden the same way you would for any production agent component (see our runtime selection checklist for durable AI agents).
Playbook and pre-launch checklist for MCP, CLI and SDK agents
These steps follow the three layers and apply to either edition.
Placeholder layer
- Inventory credentials. For each agent, list every credential, the host it's used against and the narrowest endpoints and HTTP methods it needs.
- Swap in placeholders. Replace real keys in agent environment variables and config files with placeholder values or session tokens.
Proxy layer
- Separate the proxy. Run it on a separate machine or across a network boundary from the agents. The credential store never sits in the agent's runtime.
- Deny by default. Turn on deny mode for unmatched hosts and add allowlist entries per agent, not per team.
- Review what comes back. Flag allowlisted endpoints whose responses can return a credential or secret, such as OAuth refresh, token-minting, key-creation and secret-read APIs. Keep them away from the agent unless you can justify the exposure.
- Scope MCP tokens. Each MCP server's upstream API keys live in the broker, not in its config. Reject client tokens that weren't explicitly issued for the MCP server, and never forward them downstream.
Perimeter layer
- Force egress. Use firewall rules, Kubernetes network policies or CI runner rules so the proxy is the agent's only route out. Set HTTPS_PROXY afterwards as guidance for compliant clients.
- Install CA trust. Add the proxy's CA certificate to each agent runtime's trust store, with verification left on.
- Verify HTTP clients. Not every runtime honours proxy variables. Infisical's documentation notes that Node.js built-in fetch does not read HTTPS_PROXY by default, so you need --use-env-proxy or NODE_USE_ENV_PROXY=1 on Node 24 or later. We suggest confirming flag support for the exact runtime version you deploy before relying on it.
Prove it
- Test revocation and injection. Set short session lifetimes, end a session mid-run and confirm access stops. Then run a canary prompt-injection test asking the agent to print its keys, and check that only placeholders come out.
CLI agents such as Claude Code
Infisical lists Claude Code among the agents running through Agent Vault. For CLI agents, the dependable setup is a container or VM whose network rules allow outbound connections only to the proxy, with placeholders wherever the agent expects API keys. A CLI agent can run shell commands, so assume it can unset environment variables and let the network enforce the route.
Custom SDK agents
Audit every HTTP client in the dependency tree. A library that ignores proxy settings should fail closed at the network layer, not quietly connect direct.
Read the allowlist as an attacker would
Once keys are out of the agent's context, the allowlist becomes the main thing a successful injection can exploit, so review it from that angle before rollout. For each entry, ask what the worst sequence of allowed calls could do if someone else were choosing them. Delete, transfer, key-creation and token-refresh endpoints should need human approval or stay off the allowlist entirely. The upstream credential behind each entry should carry the narrowest scopes the provider offers, so even an approved call can do as little as possible.
The proxy works alongside your existing prompt-injection controls, such as input filtering, output checks and least-privilege tool design. It doesn't replace any of them.
Key Takeaways
- 1Infisical Agent Vault never gives agents real credentials. They hold placeholders, and a TLS-intercepting forward proxy injects the real key into outbound requests.
- 2Plan deployments with the Placeholder / Proxy / Perimeter model: placeholders in the agent, real credentials in a separate proxy, and network egress forced through that proxy.
- 3HTTPS_PROXY guides traffic but doesn't enforce anything. Lock down egress, install the proxy's CA certificate deliberately, and turn on deny mode, since the open-source default passes unmatched hosts through.
- 4Brokering stops prompt injection from stealing keys and keeps keys out of provider logs. It does not stop misuse of allowed access, or endpoints like OAuth refresh and key creation that return secrets in responses.
- 5The open-source Agent Vault launched as a research preview, and Infisical says the repository is not actively maintained. In the commercial Agent Vault, running agents lose access within 60 seconds of a session ending.
- 6Test every HTTP client: Node's built-in fetch, for example, ignores HTTPS_PROXY unless you enable --use-env-proxy or NODE_USE_ENV_PROXY=1.
- 7For MCP, keep upstream credentials in the broker and never pass client tokens through to downstream APIs.
Conclusion
Infisical Agent Vault rests on one idea: an agent can't leak a secret it never had. The Placeholder / Proxy / Perimeter model is how you check that the idea holds in your own deployment. Done well, it removes the most obvious payoff from prompt injection and keeps keys out of inference-provider logs.
Each layer fails in its own way. Placeholders fail when real keys linger in configs. The proxy fails if it shares a machine with the agent, passes unmatched hosts through or allowlists endpoints that hand secrets back. The perimeter fails when HTTPS_PROXY is the only thing steering traffic, because the agent can unset it. We'd also advise against ever restoring connectivity by switching certificate verification off.
We'd treat the open-source repository as a learning and prototyping tool, and plan on a supported edition or a fork you'll maintain for production. Start with one agent and one credential. Work through the playbook, run a canary injection test, then expand. If a second opinion would help, Optijara can review your agent credential architecture and egress design against these three layers before a wider rollout.
Frequently Asked Questions
What is a credential proxy for AI agents, and how is it different from a normal secrets manager?
A normal secrets manager returns the credential to the application, which then uses it. A credential proxy like Infisical Agent Vault is a TLS-intercepting forward proxy that injects the real credential into outbound requests, so the agent only ever holds a placeholder. Infisical's argument is that the old model breaks down for agents because prompt injection can trick them into leaking secrets they hold.
What is the Placeholder / Proxy / Perimeter model?
It's the three-layer model this guide uses to plan a deployment. Placeholder means the agent holds only stand-in values. Proxy means a separate broker holds the real credentials, applies deny-by-default policy and injects them into approved requests. Perimeter means network controls force all outbound traffic through that broker. Take away any layer and the guarantee weakens.
Does Agent Vault fully stop prompt injection attacks?
No. It removes one major payoff: if an injection tricks the agent into revealing a credential, there's nothing to reveal. A manipulated agent can still use whatever access its allowlist grants, and endpoints such as OAuth refresh, token minting or key creation can return fresh secrets in their responses. Keep least-privilege scopes, human approval for destructive actions and your other prompt-injection controls in place.
Is setting HTTPS_PROXY enough to route agent traffic through Agent Vault?
No. Infisical says the variable only guides compliant clients, and the agent can unset it. A full deployment locks the network down so all outbound traffic goes through the proxy. Some runtimes also ignore the variable by default, including Node's built-in fetch, which needs --use-env-proxy or NODE_USE_ENV_PROXY=1.
Can I use the open-source Agent Vault in production?
Be careful. Infisical says the repository stays up but is not actively maintained and was never built for a team. We'd use the repo for learning and prototyping. For production, look at the commercial Agent Vault or plan to maintain a fork yourself.
Where should the proxy run relative to my agents?
On a separate machine or across a network boundary, so the agents can't read the credential store directly. The security guarantee depends on that separation. If you run a shared proxy, keep it on a private network such as your own servers, a Kubernetes cluster or self-hosted CI runners, because agents send their session token to it over plain HTTP.
Sources
- https://github.com/Infisical/agent-vault
- https://infisical.com/docs/documentation/platform/agent-vault/how-it-works
- https://infisical.com/blog/agent-vault-the-open-source-credential-proxy-and-vault-for-agents
- https://infisical.com/platform/agent-vault
- https://infisical.com/docs/documentation/getting-started/choose-a-product/agent-vault
- https://infisical.com/blog/agent-proxy
- https://www.prweb.com/releases/infisical-launches-agent-vault-letting-engineering-teams-ship-ai-agents-to-production-without-exposing-credentials-302749986.html
- https://news.ycombinator.com/item?id=47865822
- https://www.codeline.co/thoughts/repo-review/2026/agent-vault-credential-proxy-for-ai-agents
- https://dev.to/mech_app_ai/agent-vault-http-credential-proxy-for-ai-agent-tool-calls-42m4
- https://cheatsheetseries.owasp.org/cheatsheets/LLM_Prompt_Injection_Prevention_Cheat_Sheet.html
- https://modelcontextprotocol.io/docs/2026-07-28/tutorials/security/security_best_practices
Written by
Hamza DiazHamza Diaz is the founder of Optijara, where he builds practical AI agents, automation systems, and Copilot workflows for service businesses. He writes about AI operations, agent strategy, and real-world implementation for teams that want usable systems instead of hype.
