Mental model
Agent Vault uses four primitives to create secure sessions for AI agents:- Services: The APIs, MCP servers, and anything else the agent talks to, with any credentials to add
- Access bundles: Groups of services, granted as a unit
- Sessions: Time-bound access grants that an agent uses to authenticate to the proxy for the services in an access bundle
- Proxies: The forward proxy that intercepts an agent’s outbound traffic and attaches real credentials to authorized requests
1
The access bundle groups the services (external APIs or MCP servers) you want your agent to reach.
2
You create a session for the bundle. Infisical returns a session token scoped to that bundle for a limited time.
3
The agent runs with the session token and uses it to authenticate to the Agent Vault proxy on every outbound request.
4
Every outbound request goes through the proxy, with the session token attached as the proxy credential.
5
The proxy reaches into the access bundle for the matching service’s credential, attaches it, and forwards the request to the upstream host.
Concepts
Here’s a breakdown of each primitive that Agent Vault relies on.Services
A service represents one external system that an agent can reach, such as GitHub’s REST API or Linear’s MCP server. Each service holds:- Target: Where the system is, such as the host
api.github.comor the server URLhttps://mcp.linear.app/mcp - Credential: The real token, username and password, or OAuth authorization that the proxy attaches to the agent’s requests, if the service uses one
- Rules (HTTP APIs): The HTTP methods and paths the service allows
- Custom headers: Extra headers the proxy adds to each request
- Substitutions (HTTP APIs): Placeholders the proxy replaces with real values
Services
Anything an AI agent talks to during a session, such as an API or an MCP server.
Access bundles
An access bundle groups a set of services under one name. A code-review bundle might hold services for GitHub, Slack, and Anthropic. An on-call bundle might hold services for PagerDuty, Datadog, and Slack. You grant a bundle to a user, group, or machine identity. Anyone holding that grant can create sessions that reference it.Access bundles
Lists of services that AI agents can access during a session.
Sessions
A session is a time-bound access grant that’s scoped to one access bundle. Infisical returns a session token that identifies the session; the agent uses that token to authenticate to the Agent Vault proxy on every outbound request. When you create a session, you pick one access bundle and set an expiry. The agent never sees the real credentials inside the bundle. All it has is the session token, which only works when the proxy can authorize it against a live session. Even if an attacker stole the session token, they could only reach the hosts, methods, and paths that the access bundle’s services allow, and only until the session expires or you revoke it.Sessions
Time-bound grants that let AI agents access services without holding real credentials.
Proxies
A proxy runs where your agent’s traffic leaves your network. It intercepts every outbound request, authorizes the request against the session’s access bundle, attaches the matching service’s credential as a header, and forwards the request to the upstream host. If the request breaks the matching service’s method or path rules, the proxy refuses it instead.Proxies
Forward proxies that intercept an AI agent’s requests and attach real credentials on the way out.
Example flow: GitHub API
Here’s what happens when an agent callsapi.github.com through an Agent Vault session:
- The agent’s HTTPS client routes the request through the proxy (because the
HTTPS_PROXYenvironment variable points at it), including the session token as the proxy credential. - The proxy looks up the session with Infisical, checking if it’s still live and which access bundle it carries.
- The proxy looks inside the session’s access bundle and finds a service whose host pattern covers
api.github.com. If the service limits methods or paths, the proxy refuses a request that doesn’t match them. The proxy reads the real GitHub token from that service. - The proxy opens a new HTTPS connection to
api.github.com, attaches the real token in the authorization header, and forwards the request. - GitHub responds. The proxy pipes the response back to the agent.
If the agent asks for a host that isn’t covered by any service in the access bundle (like
api.internal.example.com), the proxy either forwards the request without credentials or refuses it outright, depending on its traffic policy.Example flow: Linear MCP server
Here’s what happens when an agent calls a tool on Linear’s MCP server through an Agent Vault session. The agent has the server’s real URL,https://mcp.linear.app/mcp, and no credential for it:
- The agent’s MCP client sends the tool call to
mcp.linear.appthrough the proxy, with the session token as the proxy credential. - The proxy finds the MCP service in the session’s access bundle that covers
mcp.linear.app, and reads the OAuth access token Infisical holds for it. - The proxy records the tool’s name for the session log, attaches the access token, and forwards the request.
- Linear responds, and the proxy pipes the response back to the agent.
Why no code changes are needed
Agent Vault plugs into a mechanism the entire HTTP ecosystem already uses: theHTTPS_PROXY environment variable. Any HTTP client that reads HTTPS_PROXY routes through the proxy without any code changes. That includes curl, git, gh, Python’s requests, and most SDKs.
infisical agent-vault run sets HTTPS_PROXY for the agent, trusts the proxy’s certificate authority, and passes the session token as the proxy credential. Everything the agent does after that works without needing to update any code.
Node.js’s built-in
fetch (undici-backed) doesn’t read HTTPS_PROXY by default. If your agent uses it directly, run Node with --use-env-proxy or set NODE_USE_ENV_PROXY=1 (Node 24 or later). Third-party clients like axios, node-fetch, and got honor the env vars without extra flags.