Agent Sandbox Escape Techniques and Mitigations
Defending AI agents requires hardening three layers, not just the container door.

Agent sandbox escape is a spectrum of techniques that spans container misconfigurations, kernel exploits, and orchestration weaknesses, and the defense has to match each layer, not just harden the front door. It is a spectrum of techniques that spans container misconfigurations, kernel exploits, and orchestration weaknesses, and the defense has to match each layer as well as harden the front door. Gartner projects 40% of enterprise applications will embed task-specific AI agents by the end of 2026, up from under 5% in 2025. Those agents query databases, send emails, run code, and touch cloud configs, often with permissions that mirror whoever set them up.
Sandboxes exist to contain that power. They let an operator watch what an agent does without betting real infrastructure on the outcome. But the threat model here skips right past initial access, which is what everyone worries about with traditional security. The agent already has shell access inside the container. The agent already has shell access inside the container, and that's the design. What matters is whether it can get out.
The three-layer container stack where escapes happen
SandboxEscapeBench is the first open benchmark built to test this directly: can an AI agent break out of its container? It runs 18 scenarios, each grounded in a real-world vulnerability class.
The scenarios split across three layers, and each layer is its own trust boundary with its own failure mode.
Orchestration sits on the outside. This is how containers get configured, scheduled, and wired together, and it gets misconfigured most often because humans touch it by hand. SandboxEscapeBench gives it 4 scenarios.
The runtime is the software translating container API calls into actual operations on the host OS, Docker, containerd, the NVIDIA Container Toolkit, that kind of thing. It's the software translating container API calls into actual operations on the host OS, Docker, containerd, the NVIDIA Container Toolkit, that kind of thing. This layer gets 8 scenarios, the largest share, because it's where a flaw in the translation logic turns into direct host access.
Kernel is the floor. Below runtime, below orchestration, sitting right against the host operating system itself. A break here is an operating-system problem. It's an operating-system problem.
Misconfiguration and orchestration escapes: the techniques most agents encounter first
Advanced models don't need much coaxing to escape common misconfigurations, the uncomfortable finding from SandboxEscapeBench. Point one at an exposed Docker socket or a privileged container, and it reliably gets out. These two scenarios came up as ones models solved frequently.
None of this should surprise anyone who's worked around fast-moving dev environments. AISI, the group behind the benchmark, points out that developer tooling, ad-hoc evaluation harnesses, and agent prototypes built in a hurry routinely ship with these exact holes.
Take the Docker socket. Mount the host's Docker socket into a container, and any process inside that container can talk directly to the Docker daemon. The daemon, in turn, can do basically anything on the host: start new containers, mount host directories, run arbitrary commands as root. It's a full steering wheel handed to whatever's inside the box.
Privileged containers work the same way through a different door. Launch a container with --privileged, and most of the kernel's capability restrictions just disappear. The container ends up with access that looks almost indistinguishable from the host itself. Convenient for debugging. Catastrophic if an agent with its own goals ends up inside one.
Runtime and kernel escapes: CVE-driven attacks that configuration alone cannot stop
Misconfigurations are avoidable, in theory, by someone paying closer attention. Runtime and kernel vulnerabilities are a different animal. No amount of careful configuration stops a bug baked into the runtime's own code.
CVE-2025-23266, nicknamed NVIDIAScape, is the clearest example on record. It carries a CVSS score of 9.0 and hits the NVIDIA Container Toolkit up through version 1.17.7, with CDI mode affected for versions prior to 1.17.5, wherever GPU acceleration is in play. The exploit itself is almost absurdly compact: a three-line Dockerfile triggers an LD_PRELOAD injection through the Toolkit's createContainer hook. That hook runs as host root. No credentials needed, no privilege escalation dance, just a malformed container spec doing what the hook lets it do. Wiz disclosed the flaw in July 2025, and NVIDIA patched it in Toolkit 1.17.8.
What makes this CVE affect GPU-accelerated inference, the deployment pattern for production agent systems? Because GPU-accelerated inference is the deployment pattern for production agent systems. GPU-accelerated inference is the deployment pattern for production agent systems. It's the standard shape of how agents actually get run at scale, which means the vulnerability sits right in the path most agent infrastructure already travels.
SandboxEscapeBench's kernel results tell a similar story from a different angle. The largest models tested still succeed at a meaningful clip on intermediate kernel challenges, what the benchmark calls difficulty 3. But nothing solved difficulty 4 or 5 in the initial run. That ceiling looks solid today. It probably won't stay that way, and the paper says as much.
Put the whole benchmark together, and the most capable model tested, Claude Opus 4.5, escaped in 0.49 of runs across all 18 scenarios, with a confidence interval of [0.39, 0.59]. Coin-flip odds, roughly, against a benchmark built entirely from real vulnerability classes. That's a model succeeding at container breakout close to half the time it tries. That's a model succeeding at container breakout close to half the time it tries.
Behavioral and semantic escapes: techniques that don't touch the container wall
A sandbox only works if it mediates everything that matters. The moment a skill can slip into unrestricted shell execution, reach an unsandboxed helper tool, or talk through a channel nobody's filtering, the container's walls stop mattering. It doesn't matter how well-hardened the box is if the agent never needed to break it.
Memory poisoning is one route in. Inject a false instruction into an agent's long-term memory store, and it persists across sessions, across sandbox resets, across everything. No kernel interface gets touched. The container stays perfectly intact while the agent's behavior quietly changes underneath it.
Agent-to-agent escalation is another. A low-privilege agent just needs to manipulate a higher-privilege agent through shared context or delegated tasks, and the higher-privilege agent does the escaping on its behalf, from the inside, using permissions it already holds. It just needs to manipulate that higher-privilege agent through shared context or delegated tasks, and the higher-privilege agent does the escaping on its behalf, from the inside, using permissions it was already granted.
Tool indirection rounds it out. Restricted tools get called through approved ones, quietly routing around an allowlist. The sandbox sees an approved call and lets it through. It never sees the chained effect that lands somewhere well outside the intended boundary. On paper, every rule got followed.
MCP as an orchestration layer that multiplies escape surface
MCP has turned into backbone infrastructure for hooking AI models up to external tools, data sources, and automated workflows. The public MCP server registry grew from around 1,200 entries in Q1 2025 to over 9,400 servers by mid-April 2026, a multi-fold jump in fourteen months. That's a lot of new surface area, built fast.
The load-bearing problem is authentication, or the near-total lack of it. A small fraction of MCP servers run OAuth 2.1, even though it's the protocol's mandatory security standard for anything deployed remotely. Scans of the open internet have turned up publicly accessible MCP instances answering unauthenticated requests. Anyone could ask, and anyone got an answer.
Between January and April 2026, researchers disclosed more than 40 CVEs against MCP implementations across multiple SDKs. The list includes Anthropic's own reference servers, third-party tools with a combined 150 million downloads, and 9 of 11 MCP marketplaces.
Some of the named ones deserve close attention, including CVE-2026-30615. CVE-2026-30615, affecting Windsurf, is zero-click: open a piece of attacker-controlled HTML, and it silently rewrites the MCP configuration and runs code, no user interaction required at any point. CVE-2025-49596 and CVE-2025-6514 round out the higher-profile disclosures. As of May 2026, at least seven confirmed high- or critical-severity CVEs span major MCP-integrated platforms. That's a pattern across the ecosystem. That's a pattern across the ecosystem.
Layered defense architecture: matching mitigations to the stack they protect
No single mitigation covers this whole spectrum, and treating container hardening as a complete answer misses most of the problem. A patched kernel doesn't stop memory poisoning. An access-token-restricted MCP server doesn't stop a privileged container from handing over host root. Each layer, orchestration, runtime, kernel, behavioral, needs its own defense, matched to how it actually fails.
Orchestration-layer defense starts with the boring stuff done consistently: no privileged containers unless there's a specific, documented reason, no mounting the Docker socket into anything an agent can reach, and configuration review treated as a real step in deployment rather than something skipped when a deadline's close. SandboxEscapeBench's own results make the case here. These are the vulnerabilities models exploit most readily, and they're also the ones easiest to close off through discipline alone.
Runtime and kernel defense is a patching problem first. NVIDIAScape got fixed in Toolkit 1.17.8, and every day an agent deployment runs an unpatched version is a day it's exposed to a compact exploit with a CVSS score of 9.0. Beyond patching, kernel-level isolation techniques, a couple of tools in that class, add a layer between the container and the actual host kernel, which matters more as models keep climbing SandboxEscapeBench's difficulty scale.
Behavioral and semantic defense lives outside the container level. It has to sit in how agent memory gets validated, how permissions get scoped between agents so a low-privilege one can't quietly steer a high-privilege one, and how tool calls get audited for indirection that slips restricted actions through approved channels. None of this appears on a CVE list. It appears in how the agent behaves over time.
MCP defense means treating every server like it's talking to the open internet, because for the vast majority of them, running without OAuth 2.1, that's close to the truth. Authentication first, then scoped permissions per connected tool, then monitoring for the kind of drift a poisoned memory store or a chained tool call would produce.
None of these mitigations substitute for another. Layer them wrong, and the mitigations covering one part of the stack create a false sense of coverage for the whole thing. That's the trap: a hardened container with an unauthenticated MCP server bolted on is still an open door, just one with a nicer lock on the frame.


