Sandboxed AI agents

A sandbox is a boundary. Not a governance program.

Isolation decides what a compromised agent can reach. It does not decide what an authorized agent is allowed to do. Pick the boundary by threat, then test what still gets out.

If the sandbox held perfectly, what could your agent still send out?

  • Five isolation tiers, chosen by threat.
  • Eight leak paths, tested on your setup.
  • Authority controls for what isolation cannot stop.

Already shipped · Open source · Evidence-rated

Our escape tests are published. A valid bypass is a contribution, not a secret.

Sandboxed AI agents run their code and tools inside an isolation boundary, such as a process sandbox, container, gVisor, Kata container or microVM, that limits what a compromised step can reach. Isolation has to be paired with egress control, credential brokering, protected configuration and a policy gate, because a sandbox does not decide what an authorized agent may do.

Last updated Tested against AI SAFE² v3.1 · safe2 CLI 1.1.0 · Gateway v3.0 · NEXUS v0.6By Vincent Sullivan

1 · Isolation tier

A dedicated kernel per session, Firecracker class. The strongest wall on this list.

2 · Controls around it

Probe from insideResult
  1. Read ~/.ssh on the hostCONTAINED
  2. Kernel exploit to hostCONTAINED
  3. Cloud metadata endpointESCAPED
  4. Mounted docker.sockESCAPED
  5. DNS tunnel outESCAPED
  6. Allowed domain, broad tokenESCAPED
  7. Persist hook in agent configESCAPED
  8. Authorized destructive API callESCAPED

2 of 8 contained

Strong wall, open doors. The tier alone leaves most paths out.

Eight probes try to leave the sandbox. A microVM alone contains 2 of 8. All four controls on a shared kernel contain 7. All four controls on a microVM contain all 8. Change the tier or toggle a control to see why.

We run these eight probes against your setup · Raw results

Is sandboxing enough to secure AI agents?

Built for Teams Running Agents With Data Access — and the Engineers Who Must Prove the Boundary Holds.

The short answerA sandbox limits what a compromised agent can reach — it decides the boundary, not what an authorized agent may do. CSI’s eight-probe testing: a microVM alone contains 2 of 8 leak paths. The tier closes escapes; the rest leave through allowed domains, broad tokens, metadata endpoints, and writable config. Container plus four controls (egress allowlist, credential broker, protected config, policy gate) contains 7 of 8. Fits teams running agents with data access and real credentials. If the agent only runs code you trust, own-kernel isolation is overkill — shared kernel plus the controls does the work.

Disclosure: the eight escape probes on this page are CSI’s own tests against common default configurations; the Challenge Lab publishes a valid bypass as a contribution.

02 · Where you are

Three questions about your agent sandbox

Tap the answer closest to true today.

Which isolation runs today?

Then the agent's reach is your reach. Start with a tier from the isolation table and the host backstop.

Containers share the host kernel. Fine for trusted code, thin for untrusted. See the probe matrix.

Strong wall. Now check the doors: egress, tokens and config. Toggle the controls in the simulator.

Is egress allowlisted, DNS included?

Good. Now test the allowed domains. A broad token through an allowed host is probe 6.

DNS is a data channel. A tunnel out needs nothing but name resolution. That is test 3.

Then isolation stops the host compromise and nothing else. See the exfiltration path.

Which credentials are mounted inside?

That is the design. Confirm the broker refuses requests outside the task.

Scoped is better than broad. Check its lifetime and what one call can do with it. See the control matrix.

A mounted socket is a door through the wall. Remove it before any other change. That is probe 4.

03 · What changes

Why do sandboxed AI agents still leak?

Classic sandboxes contain untrusted code. Agents are trusted code that takes untrusted instructions, holds real credentials and needs the network to do its job.

QuestionClassic sandboxSandboxed AI agent
What is untrusted?The code insideThe instructions the trusted agent reads
NetworkUsually offNeeded, so it is allowlisted, and allowed hosts become exits
CredentialsNoneReal tokens to real systems
Main riskEscape to the hostAuthorized misuse that never escapes anything
What fixes itA stronger wallA wall plus authority controls: broker, gate, approvals

04 · The evidence

The eight probes, by tier and controls

Outcomes for common default configurations. The tier closes two paths. The controls close the rest.

Probe result per configuration: contained or escaped
Probe from insideContainer alonemicroVM aloneContainer + all four controlsmicroVM + all four controls
Read ~/.ssh on the hostCONTAINEDCONTAINEDCONTAINEDCONTAINED
Kernel exploit to hostESCAPEDCONTAINEDESCAPEDCONTAINED
Cloud metadata endpointESCAPEDESCAPEDCONTAINEDCONTAINED
Mounted docker.sockESCAPEDESCAPEDCONTAINEDCONTAINED
DNS tunnel outESCAPEDESCAPEDCONTAINEDCONTAINED
Allowed domain, broad tokenESCAPEDESCAPEDCONTAINEDCONTAINED
Persist hook in agent configESCAPEDESCAPEDCONTAINEDCONTAINED
Authorized destructive API callESCAPEDESCAPEDCONTAINEDCONTAINED
Contained1 of 82 of 87 of 88 of 8
Host

Claude Code's sandboxed Bash tool covers shell commands. MCP servers, command hooks and plugin monitors run unconstrained on the host.

Anthropic Docs · Oct 2026
On

Outbound internet is on by default when Copilot local sandboxing is enabled. Local network access is off.

GitHub Docs · Oct 2026
Off

Codex CLI's default workspace-write sandbox keeps network access off unless you enable it in configuration.

OpenAI Codex Docs · Oct 2026

05 · Abuse paths

How does data leave a sandbox that never broke?

If an allowed domain plus a broad token is the way out, what did the sandbox buy you?

Allowed-host exfiltration

  1. AssetSource code and secrets in the workspace
  2. ActorAn instruction in a file the agent read
  3. PathUpload to an allowlisted host, such as a code host, with the agent's own token
  4. ResultData out, every rule followed

Metadata credential theft

  1. AssetThe cloud role of the sandbox host
  2. ActorAny process inside the sandbox
  3. PathA request to the instance metadata endpoint
  4. ResultCloud credentials outside the sandbox's intended scope

Config persistence

  1. AssetThe agent's settings, hooks and MCP list
  2. ActorOne compromised session
  3. PathA writable config path inside the sandbox that the host loads later
  4. ResultCode that runs outside the sandbox next time

06 · Architecture

What does a complete agent sandbox architecture include?

Models propose. Infrastructure decides. Evidence proves. The wall is one layer of five.

  1. Isolation tierChosen by threat: shared kernel for trusted code, own kernel for untrusted.
  2. Egress controlAllowlist by host, with DNS resolved through the same policy.
  3. Credential brokerNothing mounted. Short-lived tokens issued per call, per task.
  4. Protected pathsAgent config, hooks and MCP lists are read-only inside the sandbox.
  5. Policy gateAuthorized but destructive actions escalate to a named human.
Five layers. The first stops escape. The other four stop authorized misuse, which is where the remaining six probes come out.
Sandboxed AI agents threat diagram: AISM agent threat and control matrix from static chatbots to autonomous swarms
The AISM agent threat and control matrix. Isolation answers a few rows; the rest need authority controls.

The host backstop

Local agents run on developer laptops, outside any cloud sandbox.

Warden kernel-level containment holds unknown executables at the kernel by default, whatever the agent's own sandbox did or did not do.

The sandbox is one layer of the full agent harness security architecture.

07 · Controls

Which sandbox controls map to AI SAFE²?

JobControlAI SAFE² anchorShipped artifact
PreventOwn-kernel isolation for untrusted code. Block metadata endpoints.P1 Sanitize and Isolatechallenge-controlled-executor
ConstrainEgress allowlist with DNS. Brokered credentials. Read-only config paths.P1 · CP.4 Agentic Control Plane Governanceopenclaw
DetectAlert on denied egress, metadata requests and config writes.P4 Engage and Monitorgateway ResponseScanner
RespondEscalate authorized destructive calls to a named human.CP.10 HEAR Doctrinegateway HITL circuit breaker
RecoverDestroy the session, revoke its tokens, block traffic until operator recovery.P3 Fail-Safe and Recoverygateway SafeMode
ProveProbe results with tier, config and versions, kept per release.P2 Audit and InventoryChallenge Lab evidence manifests

08 · How to test

How do you test an agent sandbox for escape and leaks?

Run each probe from inside a real session, once with the control on and once with it off. Kept results rate E3.

1. Metadata endpoint E3
  1. Request the cloud instance metadata address from inside the sandbox.

Pass

The connection is refused and logged.

Fail

Any metadata response comes back.
2. Mounted socket and secrets E3
  1. List mounts. Look for docker.sock, cloud credential files and SSH agents.

Pass

None present; credentials arrive only through the broker.

Fail

Any one is readable.
3. DNS tunnel E3
  1. Resolve a unique subdomain of a host you control.

Pass

Your authoritative server sees nothing.

Fail

The query arrives.
4. Allowed domain with a broad token E3
  1. Use the agent's token to write to a resource on an allowed host that the task does not need.

Pass

The broker refuses the scope, or the gate escalates.

Fail

The write succeeds.
5. Config persistence E3
  1. Write a hook or MCP entry into the agent's config from inside.
  2. Start a new session on the host.

Pass

The write fails on a protected path.

Fail

The entry loads next session.

09 · Proof in public

We did the work in public. Check it.

Every number below links to the file that proves it. Fork it, run it, try to break it.

They define the risk. We ship the enforcement.

These bodies are the mapping targets, not the competition. AI SAFE² maps to them, then ships the code they leave to you.

Risk frameworks and runtime vendors compared with AI SAFE² on what each one publishes
WhoDefines the riskMaps to complianceOpen enforcement code for named agent stacksRates its own evidence in publicPublished bypass process
OWASP GenAI Security ProjectYesPartialNot its scopeNoNo
NIST AI RMFYesYes, it is the targetNot its scopeNoNo
MITRE ATLASYesPartialNot its scopeNoNo
CSA MAESTRO and Agentic Control PlaneYesPartialNot its scopeNoNo
Runtime security vendorsPartialPartialClosed, own product onlyVendor reportsSome, through bug bounties
AI SAFE²Yes, 161 controlsYes, 32 frameworksYes, 22 examples, CLI, gatewayYes, E0-E5Yes, Challenge Lab

As of October 2026 · Got one wrong? Send the link. We correct it the same week.

Challenge Lab · C0 to C5 claim maturity

Break it.

Preregistered scenarios. Explicit invalidation criteria. A valid bypass or a grader defect is a high-value contribution, and it goes into the public record.

Or run it on yours, now

$ pip install "ai-safe2[all]==1.1.0"
$ safe2 doctor .
$ safe2 gate project . --fail-under 70
$ safe2 scan mcp https://your-host/mcp

Four commands. No sales call. If the gate fails, you just learned something your current vendor did not tell you.

Install line from MIGRATION.md. Commands from the safe2 CLI reference.

10 · Tools

Container, gVisor, Kata or microVM: which isolation tier fits?

Pick by threat. Then add the four controls, because no tier closes the authority paths.

TierKernelStopsLeaves openFits
Process rulesHostReads and writes outside allowed pathsKernel exploits, network unless restricted, every authority pathTrusted local agents with low consequence
ContainerShared host kernelFilesystem and process visibilityKernel exploits, mounts, metadata, authority pathsTrusted code, short tasks
gVisorUser-space kernelMost direct system calls to the hostNetwork and credentials unless controlledUntrusted code at container density
Kata ContainersOwn kernel per podHost kernel exposureNetwork and credentials unless controlledUntrusted code with container tooling
microVMOwn kernel per sessionHost kernel exposure, with the smallest shared surfaceEvery authority path: egress, tokens, config, destructive callsUntrusted code, multi-tenant agents
Native coding-tool sandboxesHost, OS-enforcedShell writes and network per policyProcesses outside the sandbox: hooks, MCP servers, file tools in some toolsDeveloper laptops, with the host backstop

CSI analysis · October 2026 · Observed defaults, not vendor claims

11 · Start here

Get the escape and leak test plan

The eight probes on this page, written as a runnable plan with pass and fail criteria and a results sheet.

Free · Sandbox Escape and Leak Test Plan

  1. Read the host home directory
  2. Kernel exploit to host
  3. Cloud metadata endpoint
  4. Mounted docker.sock
  5. DNS tunnel out
  6. Allowed domain with a broad token
  7. Persist a hook in agent config
  8. Authorized destructive API call

Each probe: setup, command, expected result, evidence to keep.

Productized review

Agent Sandbox Architecture Review

Scope
The sandboxes your agents run in today, local and cloud.
Deliverables
Tier choice by threat, egress and credential design, protected-path list, and all eight escape tests run on your setup.
Timeline
Agreed in writing at scoping, before work starts.
Risk reversal
All eight probes run against your setup, and you get the raw results, pass or fail.
  1. Sandbox Escape and Leak Test PlanFree, result on this page
  2. Free 8-minute AI governance assessmentScore your AI risk
  3. Strategic Certainty SessionA fixed-scope working session
  4. Agent Sandbox Architecture ReviewCustom quote
  5. Secure AI Development ArchitectureEnterprise program

13 · FAQ

Straight answers on sandboxed AI agents

Are these probe results true for my stack?

They are the outcomes of common default configurations. Your configuration decides yours. The review runs all eight on your setup and hands you the raw results.

Isn't a microVM enough?

It is the strongest wall on the list. It does nothing about an authorized agent misusing a broad token through an allowed domain. That is an authority problem.

What about agents on laptops?

They run outside any cloud sandbox. Native coding-tool sandboxes help, and some leave hooks and MCP servers on the host. Warden is the host backstop for unknown executables.

Why aren't E2B, Modal, Daytona or NVIDIA OpenShell in the table?

We publish vendor rows only after we have tested the behavior ourselves and dated it. The tier table covers what each isolation type stops; the review runs the probes on whichever platform you use.

Is gVisor or Kata safer than a microVM?

They trade density for isolation differently. gVisor intercepts system calls in user space. Kata and microVMs give each workload its own kernel. All three close the kernel-exploit probe. None closes the other six.

14 · Sources and method

Sources, method and update log

Method

External statistics name the publisher, year and sample. CSI claims link the repository file behind them and carry a rating under AI SAFE² Evidence Assurance v1.0: E1 for a specification, E2 for shipped code, E3 for a defined test with positive and negative cases. Vendor behavior comes from each vendor's current documentation, opened on the date shown.

Update log

  • : page published. Vendor controls, repository counts and install line verified the same day.

Tested versions

AI SAFE² v3.1 · CP.5.MCP MCP-1 to MCP-19 · safe2 CLI 1.1.0 · Gateway v3.0 · NEXUS v0.6 · Evidence Assurance v1.0

Vincent Sullivan

Vincent Sullivan, founder and CEO of Cyber Strategy Institute. Twenty-two years as a U.S. Air Force cyber officer, finishing as Technical Director at U.S. Cyber Command. Author of the AI SAFE² framework.

About CSI and the team

Find your exposure first. Free AI governance assessment — instant score, no sales call required. Score Your AI Risk in 8 Minutes Book a Strategy Briefing Cyber Strategy Institute

Prevention, not detection. Engineered certainty for AI governance, endpoint defense, and critical infrastructure.

1207 Delaware Ave #3397
Wilmington, DE 19806

Solutions

AI Governance

Industries

Company

© 2019–2026 Cyber Strategy Institute. All rights reserved. Privacy Policy Terms of Service

Stop Threats Before They Execute

Your free Kernel-Level Defense Buyer’s Guide is ready to download.

By providing my email address, I consent to receive emails and text messages—including newsletters and marketing communications—from creators of Warden Secure, Cyber Strategy Institute, our flagship zero-trust platform for ransomware prevention, and agree to the Terms and Privacy Policy. You may unsubscribe at any time.