--- title: "Agent Vault" description: "Secure infrastructure for deploying agents, giving them scoped access to HTTP APIs, MCP servers, databases, and SSH servers without handing them credentials, with sessions created from code, on-behalf-of-user access, MCP tool filtering, skills, and session logs of every request, on Modal, Daytona, E2B, Kubernetes, Docker, or any HTTPS_PROXY client." canonical: "https://infisical.com/platform/agent-vault" source-index: https://infisical.com/llms.txt ---

# Agent Vault

Infisical Agent Vault is secure infrastructure for deploying agents. It provides a central control plane for agent authentication, authorization, and observability, so you can build and deploy agents with confidence. It is built for the agents you build yourself: internal agents that automate work, and agentic features inside your own product. It covers four things every agent deployment needs:

- **Credential brokering.** Agents call HTTP APIs, MCP servers, PostgreSQL and MySQL databases, and SSH servers with their usual tools, without ever holding the credentials. HTTP and MCP traffic goes through a transparent proxy that attaches the real credential to each allowed request as it leaves your network. For databases and SSH servers, the proxy logs in to the server itself.
- **Access control.** Access bundles, HTTP method and path rules, and MCP tool filtering scope what an agent can do. Sessions on behalf of a user run with that person's own credentials.
- **Agent identity.** An orchestrator authenticates as a machine identity and creates a short-lived session token each time it starts an agent, from the SDK, CLI, or API.
- **Observability.** Session logs record every request, SQL statement, and SSH command, which identity started the session, and who it acted on behalf of.

A prompt-injected agent has nothing to leak, because the credential was never in its environment, files, or context.

Agent Vault is a separate product from Infisical Secrets Management, available on Infisical Cloud (US and EU) and self-hosted. It is currently in preview, so features and pricing may change.

Use this when you are building or deploying AI agents that need to call external services. When application code needs a secret at runtime, that is [Secrets Management](https://infisical.com/platform/secrets-management.md). When a person runs an agent on their own machine and it needs a session on your database or server, that is [PAM agentic access](https://infisical.com/platform/pam.md).

## How you use it

A **project** holds one agent deployment (for example, an on-call agent or a coding agent) with its own members and access control. Inside a project, a **service** is one HTTP API, remote MCP server, PostgreSQL or MySQL database, or SSH server, with its real credential. An **access bundle** is a named list of services, and optionally skills, granted as a unit, usually one per job (for example `code-review`: GitHub, Linear, Anthropic). A **session** is a time-bound grant, represented by a session token, on an access bundle, on services passed inline when the session is created, or both. A **proxy** is the forward proxy you run beside your agents.

| Interface | Use it when | Entry point |
|---|---|---|
| **SDK** | An orchestrator creates a session for each agent it starts | `client.agentVault().sessions.create({ projectId, accessBundle, ttl })` (Node.js; Python is equivalent) |
| **CLI, session** | Creating a session from a script or CI job | `infisical agent-vault sessions create --access-bundle <bundle> --ttl 30m` |
| **CLI, run** | Launching an agent behind the proxy | `INFISICAL_AGENT_VAULT_SESSION_TOKEN=<token> infisical agent-vault run --proxy <host>:17323 -- claude` |
| **CLI, connect** | Reaching a database or SSH server from inside the agent's session | `infisical agent-vault connect --all` |
| **Proxy** | Running the proxy by CLI, Docker, Kubernetes, systemd, or as a sandbox sidecar | `INFISICAL_AGENT_VAULT_PROXY_TOKEN=<token> infisical agent-vault proxy` |
| **Plain `HTTPS_PROXY`** | Containers or harnesses started without the CLI | `HTTPS_PROXY=http://x-agent-vault:<session-token>@<proxy>:17323` |
| **Dashboard** | Admins defining services, bundles, grants, and proxies | Agent Vault in the Infisical product switcher |
| **REST API** | Automating sessions, bundles, services, proxies, and log export | [API reference](https://infisical.com/docs/api-reference/endpoints/agent-vault-sessions/create) |

`av` is an alias: `infisical av run` works the same as `infisical agent-vault run`.

## What you can do with it

**Keep credentials out of the agent.** The real credential stays in Infisical. The proxy attaches it as an `Authorization: Bearer` header, a custom header such as `X-API-Key`, or HTTP basic auth, and replaces any header the agent sent with the same name. If the agent's tool refuses to start without a token, give it a placeholder like `__GITHUB_PAT__` and the proxy substitutes the real value in the URL path, query string, headers, or body.

[Services](https://infisical.com/docs/documentation/platform/agent-vault/services): credential types, host patterns, substitutions, and custom headers.

**Scope each agent to the job.** An access bundle lists exactly the services one kind of task needs, and each service can be narrowed to specific HTTP methods and path prefixes. A request that breaks those rules gets a `403` before it leaves your network. Set the proxy's traffic policy to **Access bundle hosts only** and every host outside the bundle is refused too, except for exceptions you name, such as a package registry.

[Access bundles](https://infisical.com/docs/documentation/platform/agent-vault/access-bundles) and [traffic policy](https://infisical.com/docs/documentation/platform/agent-vault/proxies#traffic-policy).

**Broker MCP servers too.** Add a remote MCP server (for example Linear or Notion) as a service and the proxy brokers its credentials the same way, including OAuth. MCP tool filtering turns individual tools on the upstream server on or off for agents.

[Services](https://infisical.com/docs/documentation/platform/agent-vault/services).

**Reach databases and SSH servers.** Add a PostgreSQL database, a MySQL database, or an SSH server as a service. The agent runs `infisical agent-vault connect`, which opens a local port for each service, and points `psql`, `mysql`, or `ssh` at it. The proxy logs in to the server with the service's account, using a password or an SSH key, so the agent never holds either.

[Databases and SSH](https://infisical.com/docs/documentation/platform/agent-vault/databases-and-ssh).

**Act on behalf of a user.** A delegation lets a machine identity create sessions for chosen project members. Each session uses that member's personal credentials, such as their own GitHub token, and can only use access bundles that both the member and the identity can use. The session logs record who the agent acted for.

[Sessions on behalf of users](https://infisical.com/docs/documentation/platform/agent-vault/sessions-on-behalf-of-users).

**Give agents skills.** Store skills as `SKILL.md` folders in the Agent Skills format and attach them to an access bundle. `infisical agent-vault run` installs them on the host before the agent starts.

[Skills](https://infisical.com/docs/documentation/platform/agent-vault/skills).

**Give every agent an identity and an owner.** Your orchestrator, such as a backend service, a CI job, or a scheduler, authenticates as an Infisical machine identity and creates a short-lived session each time it starts an agent. The agent only holds the session token, and every session is attributable to the identity that started it and, on an on-behalf-of session, to the person it acted for. Access is set per project, with two roles: **Admin** (manages bundles, services, proxies, and grants, and can use every bundle) and **Member** (can use only the bundles granted to them). You can grant a bundle to users, groups, or machine identities.

[Access control](https://infisical.com/docs/documentation/platform/agent-vault/access-control): roles, grants, and groups.

**Make access expire.** Every session expires on a schedule you set (`--ttl 30m`, `8h`, `7d`, or `never`), and the CLI revokes the session when the agent exits unless you pass `--keep-session`. Revoking a session, removing a grant, or deleting a bundle takes effect on running agents within one poll interval, 60 seconds by default and configurable from 10 to 300, with no agent restart.

[Sessions](https://infisical.com/docs/documentation/platform/agent-vault/sessions): duration, revocation, and how access changes apply mid-run.

**See what every agent did.** Session logs record every request the proxy handles: time, proxy, method, host, path, upstream status, the matching service, and the outcome (`brokered`, `passthrough`, `blocked`, or `error`). Request and response bodies, headers, and query strings are not recorded. For databases and SSH servers, the logs record each SQL statement, SSH command, and file transfer with its result, but never a query's rows. The proxy encrypts the records before they leave your network and stores them in an Amazon S3 bucket you own. Admins and the session's creator can search them live in the dashboard, or pull and decrypt them through the API. The Sessions page keeps expired and revoked sessions, and creating or revoking a session writes an audit event that can stream to your SIEM.

[Session logs](https://infisical.com/docs/documentation/platform/agent-vault/session-logs): setup, record format, and API export.

**Contain a stolen session token.** A session token only works through your proxy, only for the hosts, methods, and paths in its bundle, and only until it expires or is revoked. Revoking a proxy cuts off every agent using it at once.

[Why use Agent Vault?](https://infisical.com/docs/documentation/platform/agent-vault/why-agent-vault): the prompt-injection threat model with a worked example.

**Reuse values across services.** Store a value once as a global variable, and any service in the project can use the variable, whichever access bundle the service is in. Reference the variable as `{{GITHUB_TOKEN}}` in a service's token, basic auth, custom header, or substitution. A project holds up to 500 global variables. If you change a variable's value, the proxy uses the new value within 60 seconds by default, so you don't need to restart running agents.

[Variables](https://infisical.com/docs/documentation/platform/agent-vault/variables).

## Getting started

1. Create an Agent Vault project for the agent deployment.
2. Add your credentials as services in an access bundle, from the dashboard or the API.
3. Follow the guide for where your agents run: the proxy runs beside them, your orchestrator creates a session for each agent, and the agent starts with the session token.

[Quickstart](https://infisical.com/docs/documentation/platform/agent-vault/quickstart).

## Where it works

Complete as of this page's last update. The docs are authoritative if something is missing.

Agent Vault is built for agents running in environments you control, such as sandboxes, containers, Kubernetes, or VMs. A proxy only protects credentials if the agent can't route around it, so agents running directly on a developer's laptop are not the focus.

**Compute platforms with step-by-step guides:**


**Any agent harness that honors `HTTPS_PROXY`** works without code changes, including custom harnesses, `curl`, `git`, `gh`, Python `requests`, `axios`, `node-fetch`, `got`, and most SDKs. Node.js's built-in `fetch` needs `--use-env-proxy` or `NODE_USE_ENV_PROXY=1` (Node 24 or later). The CLI also sets `SSL_CERT_FILE`, `NODE_EXTRA_CA_CERTS`, `REQUESTS_CA_BUNDLE`, `CURL_CA_BUNDLE`, `GIT_SSL_CAINFO`, and `DENO_CERT` so the agent trusts the proxy's certificate.

**Service templates** (any other HTTP API works as a custom service):

| Category | Templates |
|---|---|
| **Model providers** | OpenAI, Anthropic, Google Gemini, Mistral AI, Cohere, Groq, Perplexity, OpenRouter, Together AI, DeepSeek, xAI (Grok), Fireworks AI |
| **Code and deploys** | GitHub, GitLab, GitHub Packages, npm, Vercel, Cloudflare, Supabase |
| **Messaging and email** | Slack, Discord, Twilio, SendGrid, Resend, Postmark |
| **Work tools** | Linear, Notion, Jira, Google Workspace |
| **Observability** | Datadog, Sentry, PagerDuty |
| **Commerce** | Stripe, Shopify |

**Hosts** can be exact (`api.github.com`), lists, one-label wildcards (`*.atlassian.net`), non-standard ports, or plain HTTP hosts on a network you trust.

## Limits worth knowing

- **It is not a sandbox.** `infisical agent-vault run` routes traffic and sets up certificate trust, but does not restrict the agent's filesystem or processes. Pair it with a sandbox if the agent should not reach other local resources.
- **Run the proxy on a different machine from the agent** where possible. The proxy's state directory holds its access token and CA private key, and session tokens travel to the proxy unencrypted, so keep the proxy on a private network only your agents can reach.
- **Databases and SSH need the proxy's HTTP port.** `infisical agent-vault connect` reaches the proxy over its HTTP port, so it doesn't work with a SOCKS5-only setup such as the E2B guide.
- **Substitution skips bodies over 10 MB or compressed with `Content-Encoding`.** Those requests are forwarded unchanged.
- **If the proxy can't reach Infisical,** it keeps using the last session data for five poll intervals, then refuses affected requests with a `502` rather than sending them without credentials.

## FAQ

**Does Agent Vault work with Claude Code, Codex, or my own agent?**
Yes, when the agent runs in an environment you control. Any harness whose HTTP clients honor `HTTPS_PROXY` works without code changes. For databases and SSH servers, the agent runs `infisical agent-vault connect` and points its client at the local address it prints.

**How is this different from an MCP gateway or AI gateway?**
MCP gateways govern MCP traffic and AI gateways sit in front of model providers, and the agent has to be pointed at each one explicitly. Agent Vault's proxy is transparent: it handles every outbound HTTP request whether the agent uses a CLI, an SDK, a raw API call, or MCP.

**Who can create a session, and what does the machine running the agent need?**
Access is set per project. Admins can use every access bundle in the project, and members can only use the bundles an admin grants them. You can grant a bundle to users, groups, or machine identities. The machine that runs the agent doesn't need an Infisical login of its own, only the session token.

**Can I set up and run Agent Vault from code?**
Yes. The REST API covers every step, including adding services to an access bundle. The Python and Node.js SDKs create access bundles, proxies, and session tokens, and the CLI runs proxies and agents and creates and revokes session tokens. A typical setup has your orchestrator issue a session token each time it starts an agent.

**What happens if the agent is prompt injected?**
There is no credential in the agent's environment to exfiltrate. A hijacked agent can only use the services in its session's access bundle, within their method and path rules, until the session ends, and session logs show every request it made.

**How do agent identities work?**
Your orchestrator authenticates as an Infisical machine identity and creates a short-lived session each time it starts an agent. The agent only ever holds the session token, and session logs show which identity started it, against which access bundle, and on whose behalf.

**How fast does revocation take effect?**
Within one poll interval, 60 seconds by default.

**Can I self-host it?**
Yes. Agent Vault runs on Infisical Cloud (US and EU) and on self-hosted Infisical. The proxy always runs on your infrastructure.

**Is this the open-source `Infisical/agent-vault` repository?**
No. `github.com/Infisical/agent-vault` was Infisical's first credential broker: an open-source binary with its own credential store and its own `agent-vault` CLI. It is no longer maintained. The product on this page replaces it, is part of the Infisical platform, uses the Infisical CLI (`infisical agent-vault`), and is what we recommend for any new setup.

**Is this the same as `infisical secrets agent-proxy`?**
No. That is an earlier agent proxy feature inside Secrets Management. Agent Vault is a separate product with its own access bundles, sessions, proxies, and session logs.

## Pricing

Agent Vault is priced separately from Secrets Management.

[pricing.md](https://infisical.com/pricing.md): exact plan contents.

## Docs

- [Agent Vault overview](https://infisical.com/docs/documentation/platform/agent-vault/overview)
- [How it works](https://infisical.com/docs/documentation/platform/agent-vault/how-it-works): the four primitives and a request walked end to end
- [Databases and SSH](https://infisical.com/docs/documentation/platform/agent-vault/databases-and-ssh): PostgreSQL, MySQL, and SSH services, `infisical agent-vault connect`, and what gets recorded
- [Proxies](https://infisical.com/docs/documentation/platform/agent-vault/proxies): deployment, traffic policy, certificate trust and pinning, re-enrollment
- [CLI reference](https://infisical.com/docs/cli/reference#agent-vault): every flag of `infisical agent-vault proxy` and `infisical agent-vault run`
- [API reference](https://infisical.com/docs/api-reference/endpoints/agent-vault-sessions/create): sessions, access bundles, services, variables, proxies, members, and session logs
- [ai-agents.md](https://infisical.com/ai-agents.md): everything Infisical does for AI agents, including when to use PAM agentic access instead

Human mode