Mental model
Agent Vault uses four primitives to create secure sessions for AI agents:- Services: Individual APIs, each configured with a real credential
- 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) 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 API, such as GitHub’s REST API, Slack’s Web API, or Anthropic’s messages endpoint. Each service holds three things:- Hosts. The host or hosts the service applies to, like
api.github.com - Authentication scheme. How the API authenticates: bearer, basic, or pass-through
- Credential. The real API token or username and password the proxy attaches to matching requests
Services
External APIs that an AI agent can securely call during a session.
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 access to a bundle for a user, group, or machine identity. Anyone with access to that bundle 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 hosts that are defined by the access bundle’s services, 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 HTTPS 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.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. 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.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.