Contain: deploy agents safely
Last updated · Published by Trustabl
Question this stage answers: if the agent goes wrong, how much damage can it do?
Containment is the reliability work of deployment. It assumes something will eventually fail and limits the blast radius. It has three parts: run the agent in a sandbox, grant least privilege based on what the agent actually needs, and enforce guardrails and policy outside the agent, where the model can't change them.
Sandboxes and access probes
| Tool | What it does for reliability | Repo |
|---|---|---|
| Agent Network Access Probe | Trustabl's access probe: runs an agent tool in an OpenShell or Docker sandbox, records the network destinations it actually contacts, and drafts a least-privilege network policy from that evidence | agent-network-access-probe |
| E2B | Secure cloud sandboxes for running agent-generated code | E2B |
| NVIDIA OpenShell | Open-source sandbox runtime for AI agents with policy-controlled filesystem, network and process access | OpenShell |
| Strands Box | Open-source agent sandbox from AWS: kernel-enforced isolation plus policy checks on shell commands, Python, MCP tool calls and network traffic (developer preview, macOS) | box |
Docker containers are also widely used to sandbox agents, and Docker Sandboxes (the sbx CLI) is built for coding agents. They are not listed because Docker Sandboxes is not published as open source.
Runtime guardrails
| Tool | What it does for reliability | Repo |
|---|---|---|
| Guardrails AI | Input and output validators that enforce structure and policy on model responses | guardrails |
| LlamaFirewall | Meta's guardrail framework for detecting prompt injection and unsafe agent actions (part of PurpleLlama) | PurpleLlama |
| NeMo Guardrails | Programmable rails for LLM apps and agents: topical, safety and execution rails | Guardrails |
Containment controls
| Control | What it does |
|---|---|
| Least privilege | Only the tools, data and egress the task needs |
| Runtime budgets and timeouts | Hard limits on time, tokens and spend per run |
| External policy enforcement | Rules enforced outside the model, which the agent can't rewrite |
| Approval gates | A human signs off on high-impact actions |
Containment also sets how much autonomy an agent can safely have. Agents earn wider authority in stages, from observe-only to acting on their own within scope, as evidence of reliability builds. See matching stages to autonomy and the failure modes that containment limits.
Further reading
- Agentic Secure Development Lifecycle (Cloud Security Alliance)
- What Production Controls Do Reliable Agents Need? (Trustabl)
- What Is Progressive Autonomy? (Trustabl)
- Agent Identity: A Ceiling, Not the Policy (Trustabl)
- Can Agents Collaborate with Other Agents to Escape Constraints? (Trustabl)
- Is My Agent's API Key Someone Else's Credit Card? (Trustabl)
- By 2030 One Trillion Custom Agent Policies Will Be Issued Annually (Trustabl)
Next stage: Observe