Choose where to run the proxy
You can run the proxy in one of two ways:- One proxy for several agents: one proxy runs on its own machine or as a Kubernetes Deployment, and every agent sends its requests to it. Agents send their session token to the proxy over plain HTTP, so this is suitable only for agents on a private network that you control
- One proxy per agent: the orchestrator starts a proxy in a separate container with each agent, such as a Modal sidecar or a linked Daytona sandbox, and stops the proxy when the agent finishes. This is suitable for a managed sandbox platform, where a shared proxy would have to accept connections from the internet
Supported connections
Agents connect to the proxy as an HTTP proxy. If you turn on the SOCKS5 port, clients such as E2B can also connect over SOCKS5 over TLS. To reach databases and SSH servers, agents runinfisical agent-vault connect, which connects to the proxy’s HTTP port over TLS.
Over either connection, the proxy attaches credentials to HTTP/1.1 requests, over both HTTPS and plain HTTP. These connections fail through the proxy:
- WebSocket connections, such as to a
wss://URL - Clients that only speak HTTP/2, such as gRPC clients
- Other TCP traffic through the SOCKS5 port, such as an
sshorpsqlclient that connects directly
Create a proxy and start it
1
In your Agent Vault project, go to Proxies and select Create Proxy.
2
Enter a Name. Optionally, add a Description. To set the traffic policy, exceptions, or poll interval now, expand Advanced Options. You can change these settings later.

3
Select Create. The Proxy Token dialog shows the proxy token, and commands for the CLI, systemd, Docker, and Kubernetes with your token and instance filled in.

4
Run one of the commands on each machine where the proxy will run.
- CLI
- Docker
- Kubernetes
- systemd
Command flags
The commands use these settings:INFISICAL_AGENT_VAULT_PROXY_TOKENor--proxy-token: the proxy token (prefer the environment variable, because other users on the machine can read anything on a command line)--domainorINFISICAL_DOMAIN: your Infisical instance URL (required for EU Cloud and self-hosted instances, because the default is Infisical Cloud in the US)
127.0.0.1, pass --listen-host or set INFISICAL_AGENT_VAULT_LISTEN_HOST. To also accept SOCKS5 connections, see SOCKS5.
Each time the proxy starts, it loads its settings and certificate authority from Infisical and, if it can, saves a copy in its data directory (~/.infisical/agent-vault, or /etc/infisical/agent-vault as root, or --data-dir). If it can’t reach Infisical for 60 seconds, it starts from that copy, or exits if there isn’t one.
For the proxy’s other flags, such as the port and the data directory, check out the
agent-vault proxy CLI reference.Settings
To change a setting, select Edit Settings on the proxy’s menu. If the proxy is running, it applies the change within one poll interval (60 seconds by default).
Traffic policy
The Traffic Policy setting controls which hosts agents can reach through the proxy:- Any host (default): the proxy forwards every request, and attaches a credential only for hosts covered by a service
- Service hosts only: the proxy refuses requests to hosts that none of the session’s services cover, unless the host is an exception (the session’s services are the ones in its access bundle and its inline services)
Blocked requests
If the policy blocks a request, the proxy still accepts the connection and completes the TLS handshake, so the agent gets a 403 response instead of a connection error. The response body is JSON with an error code, the reason, and a hint for the agent:X-Agent-Vault-Decision header, so an agent can tell the proxy’s responses apart from the API’s.
The proxy also returns a 403 for:
- A request to a port the service’s host pattern doesn’t name, such as
example.com:8443for a service onexample.com, which only covers port443 - A request that breaks the service’s method or path rules, under either traffic policy
- A request to a service whose personal values aren’t set up yet for the session’s owner, or, for a session on behalf of a user, for that user
- A request that the service’s hook denies
- On Infisical Cloud, a request after the organization used its free requests for the month (an admin can add a payment method in Usage & Billing)
- A call to a tool the service doesn’t allow. The agent gets an MCP error that names the tool
- A request the proxy can’t read to check which tools it calls, such as a compressed body, a body in a character set other than UTF-8, or JSON that isn’t a valid MCP message or doesn’t match its
Mcp-MethodandMcp-Nameheaders. The proxy also blocks a request with a body that isn’t aPOST. The agent gets a 400 - A request with a body larger than 32 MiB. The agent gets a 413
Exceptions
Exceptions allow your agents to access hosts that none of the session’s services cover, even when your proxy uses Service hosts only. Use exceptions for hosts every agent needs, such as a package registry or a documentation site. To add exceptions, select the policy and enter the hosts in Exceptions as a comma-separated list. The field doesn’t appear under Any host, because that policy already lets every host through. Exception hosts behave differently from hosts that are covered by services:- Credentials: The proxy never attaches a credential to requests to an exception host
- Ports: An exception with no port matches the host on every port, while a service’s host pattern with no port only matches port
443 - Interception: The proxy still decrypts requests to an exception host, but doesn’t block them
- Scope: An exception applies to every agent that uses the proxy
Poll interval
The poll interval is how often, in seconds, the proxy re-checks each active session with Infisical and applies settings changes. It defaults to 60 and can be set from 10 to 300. If the proxy can’t reach Infisical:- The proxy keeps using the session data it last fetched for five poll intervals
- After that, the proxy refuses the affected requests with a 502 until it reaches Infisical again, instead of forwarding them without their credentials
- The Proxies page marks the proxy Unreachable after three missed check-ins
Responses from the proxy
Every response that goes through the proxy has anX-Agent-Vault-Decision header, so an agent can tell a response from the proxy apart from a response from the API:
If a service matched the request, the
X-Agent-Vault-Service header names the service. If the proxy refuses a request, the response body is JSON with an error code, a message, and a hint that tells the agent what to do next.
Rotate a proxy’s token
Rotate the token if it leaked, or to bring back a proxy whose access you revoked:1
On the Proxies page, select Rotate Proxy Token on the proxy’s menu, then select Rotate.
2
Store the new token from the Proxy Token dialog somewhere safe.
3
Restart the proxy with the new token on every machine where it runs.
- Restart every agent that uses the proxy, because those agents still trust the old certificate
- Update any
--ca-fingerprintpin - Replace any
ca.pemfile you mounted for an agent - Download the CA again for any SOCKS5 client you gave it to
- On macOS, replace the certificate in your login keychain
Revoke or delete a proxy
Both actions are on the proxy’s menu:
Revoke access if you think a machine running the proxy is compromised.
High availability
To keep the proxy available when one machine goes down, run it on several machines with the same proxy token and put a load balancer in front of them. Every machine serves the same certificate authority, so agents trust whichever machine they reach.- Load balancer type: use a TCP (layer 4) load balancer, because agents send
CONNECTrequests that most HTTP load balancers don’t forward. You don’t need sticky sessions - Health checks: send an HTTP
GETto/_agent-vault/caon each machine, which returns200while the proxy is serving (if the HTTP port only listens locally, open a TCP connection to the SOCKS5 port instead) - Your own certificate authority (optional): if you want to use your own, pass the same
--ca-certand--ca-keyto every machine