Set up Agent Vault on Kubernetes
Deploy the proxy, lock agent pods to it, and start an agent with its own session.
How the pieces fit together
You need an orchestrator: a program that starts each agent run. It can be a script, a job in your CI pipeline or job runner, or a Kubernetes controller.
For each agent run, your orchestrator does the following:
- Creates a session for the run with the Infisical API
- Starts the agent’s pod with the session token
- Revokes the session and deletes the pod when the agent finishes
Why does the proxy run in its own namespace?
Why does the proxy run in its own namespace?
A network policy applies to a whole pod. A proxy in the agent’s pod would need a route to the internet that the agent could also use, and its proxy token would sit beside the agent.
Why can agent pods only reach the proxy?
Why can agent pods only reach the proxy?
Code in the agent’s container can ignore
HTTPS_PROXY and connect to an API directly. With a network policy that only allows the proxy, every request must go through Agent Vault. This also blocks your cloud’s metadata service and the Kubernetes API.Why does the machine identity stay out of agent pods?
Why does the machine identity stay out of agent pods?
Your orchestrator uses the machine identity to create sessions, and the machine identity can create a session for any access bundle it has access to. If the machine identity’s credentials were in an agent’s pod, the agent could use them to create a session for an access bundle it wasn’t given. A separate container in the agent’s pod doesn’t keep the credentials out of reach, because gVisor and Kata isolate a pod from the node, not one container from another. An agent pod gets only a session token, which you can revoke and which expires.
Can I use Agent Sandbox instead of writing pod manifests?
Can I use Agent Sandbox instead of writing pod manifests?
Yes. Agent Sandbox is an official Kubernetes project with custom resources for agent sandboxes, such as
SandboxTemplate, SandboxClaim, and SandboxWarmPool. Its sandboxes are pods, so the proxy and the agents namespace work the same way, with these differences:- Session tokens: a
SandboxTemplateserves every claim, so your orchestrator has to deliver each sandbox’s session token after its claim binds - Warm pools: pods in a
SandboxWarmPoolstart before any session exists, so they also get their session token after the claim binds - Network policies: a network policy that the Agent Sandbox controller creates can allow traffic that the agents namespace’s policy blocks, so turn it off or limit it to the proxy, then check direct egress
Choose an isolation level
A standard container shares the node’s Linux kernel. If an agent ran code that exploited a bug in that kernel, the code could reach the node and every pod on it. To give agent pods a stronger boundary, run them with a different container runtime by settingruntimeClassName in the pod spec. Everything else on this page stays the same at every isolation level.
An isolation level limits what a process can reach after it escapes its container. It doesn’t limit what requests the agent can make with its session’s access. Agent Vault and the network policies control that access.
Next steps
Set up on Kubernetes
Deploy the proxy, lock agent pods to it, and start an agent with its own session.
Create sessions with the API
Create and revoke a session for each agent run from your orchestrator.