Updated · Markdown
What a secure sandbox for AI agents is, and how to run agents in one
Updated 2026-11-29. Written by the team that builds Tex, so weigh it accordingly.
Short answer: a sandbox is where an agent runs commands without being able to harm anything else. A secure one does four things: it isolates each run from other runs and from the host, it limits the network to the places the job needs, it keeps long-lived secrets out of reach of the agent, and it records what happened. Containers give some isolation. MicroVMs, such as Firecracker-based ones, give each run its own kernel, which is stronger.
Why it matters for agents
An agent reads untrusted text: web pages, issues, emails, advisories. Any of it can carry instructions meant to steer it (prompt injection). So assume an agent may at some point try to do something you didn't ask for. The sandbox decides what that attempt can reach.
What to look for
- Isolation per run. One session can't see another's files or processes.
- A network allow list. Outbound traffic goes only to the hosts the job needs, through a proxy that logs it.
- No secrets inside. Tokens are added outside the sandbox, so a hijacked agent can't copy them.
- No cloud metadata. The sandbox can't reach the host's instance metadata or internal network.
- Limits. Caps on time, tokens and turns, so a looping agent stops.
- A record of every command and tool call.
How Tex does it
- A microVM per session on Amazon Bedrock AgentCore Runtime, in private subnets with no internet route, ready in about 2.5 seconds.
- An egress proxy. An agent reaches only the hosts listed in its definition's
sandbox.egress, through Tex's proxy. Commands can't reach the metadata service or the VPC's resolver. - Credentials stay outside. For a CLI tool such as
gh, the proxy adds the token to each request. For an MCP server, Tex adds the credential on its side. The sandbox never holds either. - The model proxy holds each agent to its token budget and refuses model features that would make the provider fetch URLs or run code on the agent's behalf.
- The curator runs sealed, with no network beyond Tex and only file tools.
- A journal keeps every action for audit and replay.
Questions people ask
Can an agent reach my internal network? Only what its egress list names, and only over the proxy.
Can one customer's agents see another's? No. Each organization's sessions, knowledge bases and secrets are its own, and the database scopes every query to one organization.
Can I run the sandbox on my own infrastructure? Not on the hosted service. Tex runs on AWS in us-west-2.