- A list of the services its session can use, which the agent gets from Infisical through the proxy
- Agent Vault’s built-in skill, which tells the agent to check the list before it asks for a key, and explains how to work behind the proxy
What the list includes
For each service in the session, the list includes:- The service’s name and description
- The service’s hosts, or for an MCP service, its server URL and transport (a database or SSH service has neither)
- The header the proxy sets, and any substitution placeholder the agent writes where a secret goes
- The methods and paths the service allows, or for an MCP service, the tools it allows
- The service’s status: ready, or waiting for personal values
- The person who has to fix the credential if the service rejects it: an admin, or, if the credential uses personal values, the person who set them (the session’s owner, or for a session on behalf of a user, that user)
- A sentence that tells the agent how to call the service, or for a database or SSH service, to reach it with
infisical agent-vault connect
GET requests:
How an agent gets the list
The agent requests the list from the Infisical instance that the proxy connects to, through the same proxy as its other requests. The agent sends no token. The proxy adds the session’s token to the request, so the agent never handles the token. Each request appears in the session’s logs with the outcome Listed Services.INFISICAL_AGENT_VAULT_URL holds the URL of that Infisical instance, such as https://app.infisical.com. With the variable set, the agent runs:
--noproxy "" sends the request through the proxy even if NO_PROXY lists your Infisical instance’s host, such as localhost. If the request skips the proxy, it reaches Infisical without the session’s token, and Infisical refuses it.
To set INFISICAL_AGENT_VAULT_URL in the agent’s environment:
- If you start the agent with
infisical agent-vault run, the CLI gets the URL from the proxy and sets the variable for you - If your code starts agents another way, such as in an E2B sandbox, set the variable yourself to the URL you passed to the proxy with
--domain(or tohttps://app.infisical.comif you didn’t pass--domain)
If the proxy runs an older version of the Infisical CLI,
infisical agent-vault run can’t get the URL from the proxy and doesn’t set the variable, so the agent can’t list its services. To fix this, update the Infisical CLI that runs the proxy.Check what an agent sees
To get the list that an agent in a session gets, call the List session services endpoint with the session’s token. If you use EU Cloud or self-host Infisical, replacehttps://app.infisical.com with the URL of your instance:
Give the agent its MCP servers
Most MCP clients load their servers only when they start, so an agent can’t add an MCP server it finds in the list and use its tools in the same session. To give the agent those tools from the start, add the session’s MCP servers to the agent’s MCP configuration before it starts:- If you start Claude Code with
infisical agent-vault run, the CLI adds the session’s MCP servers that are ready to Claude Code with--mcp-config(to leave them out, pass--no-mcp-servers) - If your code starts the agent another way, build the configuration from the List session services endpoint, as the following example shows
type is mcp and whose status is ready:
- Add the server at the service’s
url, with itstransport - Put a placeholder in the header the proxy sets,
credential.header, so the agent’s MCP client doesn’t try to sign in (the proxy replaces it with the real credential) - Leave out a service whose URL or header contains
$, because Claude Code fills in${VAR}from the agent’s environment, so such a URL could send a variable, such as the proxy URL with the session token, to the server
--mcp-config from a session’s token. If you use EU Cloud or self-host Infisical, replace https://app.infisical.com with the URL of your instance:
--mcp-config set to mcp_config.
The built-in skill
infisical-agent-vault is a skill that Agent Vault provides for every agent. The skill tells the agent to:
- Expect no API keys in its environment, and check its list of services before it asks you for a key or gives up on a task
- Give a placeholder key, such as
agent-vault, to a tool or SDK that won’t start without one, and write a service’s substitution placeholder where the secret goes - Call an MCP service with plain HTTP requests if the agent’s MCP client only loads servers when the client starts
- Read the
X-Agent-Vault-Decisionheader to tell the proxy’s responses apart from the API’s (see Responses from the proxy) - Read Infisical’s documentation for agents only when a task is about Infisical itself
- Never bypass the proxy, turn off TLS verification, or print the proxy URL, which holds the session token
INFISICAL_AGENT_VAULT_URL isn’t set, such as when an agent later runs on the same host without Agent Vault.
Read the built-in skill
To read the built-in skill, call the Get built-in skill endpoint. Afterinfisical agent-vault run installs the skill, its files are also on the agent’s host, in the folder where the CLI installs skills.
Infisical provides the built-in skill, so you can’t edit it or delete it. To leave it out, turn it off.
How agents get the built-in skill
infisical agent-vault runinstalls the built-in skill along with the session’s other skills- If your code starts agents without
infisical agent-vault run, such as in an E2B sandbox, install the skills that the List session skills endpoint returns (they include the built-in skill), and setINFISICAL_AGENT_VAULT_URL
Turn off the built-in skill
- With
infisical agent-vault run, pass--no-agent-vault-skillto leave out only the built-in skill, or--no-skillsto leave out every skill - With the List session skills endpoint, pass
includeBuiltin=false
infisical-agent-vault.
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.