Skip to main content
An agent that runs behind the Agent Vault proxy holds no API keys, so its environment doesn’t list the APIs and MCP servers it can use. Without help, an agent often stops and asks you for a key, even though the proxy would have added the real one. Agent Vault provides two things so that an agent can find its services on its own:
  • 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
The list also shows the session’s expiry, and the traffic policy of the proxy that the request came through, so the agent can tell if the proxy refuses hosts that no service covers. If it does, the list names the proxy’s exceptions, such as a package registry the agent can still reach. The list never includes a credential, a custom header’s value, or a substitution’s value. This shortened example shows a GitHub service that allows only 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 to https://app.infisical.com if 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, replace https://app.infisical.com with the URL of your instance:
A list you get this way doesn’t include a traffic policy, because the request didn’t come through a proxy.

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
Build one server for each service whose type is mcp and whose status is ready:
  • Add the server at the service’s url, with its transport
  • 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
This example builds the value of Claude Code’s --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:
Then start Claude Code with --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-Decision header 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
The skill tells the agent to request the list first, and to ignore the skill if 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. After infisical 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

Turn off the built-in skill

To replace the built-in skill with your own, turn the built-in skill off and give your skill another name. A skill you add can’t use the name infisical-agent-vault.

Responses from the proxy

Every response that goes through the proxy has an X-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.