Back to blog posts

11 min read

What is container escape and how do you avoid it?

How container escapes work, which 2026 vulnerabilities matter, and when microVM isolation is the right boundary for untrusted agent code.

Nicolas LecomteNico is a founder of Blaxel, who usually writes about AI, agentics, and the future of AI runtimes.

Your coding agent runs inside a container. The image is scanned, the capabilities are trimmed, and security has signed off. Then the agent reads a document with a hidden instruction, writes code to follow it, and runs that code. The run finishes in seconds and nothing in the logs looks unusual.

That run is the moment a container escape stops being a theoretical risk. Containers share one kernel, so a single kernel or runtime flaw can undo every boundary you configured. A successful escape reaches the node, its credentials, and every neighboring tenant.

For code your team wrote and reviewed, that risk is manageable. Code a model writes at runtime from untrusted input is a different problem. In June 2026, Sysdig's threat research team documented an agentic attacker breaking out of containers to the host.

This guide covers how container escapes work and which vulnerabilities matter in 2026. It explains why AI agents raise the stakes for engineering leaders running code-executing agents, and when hardened containers are enough. For agents that execute code, microVM isolation is the safer boundary because it gives each workload its own kernel.

TL;DR

  • Definition: A container escape lets a workload break out of its container and reach the host. It works because containers share the host kernel.
  • 2026 threat picture: Kernel and runtime flaws keep arriving. The Copy Fail Linux kernel flaw has a public exploit. It appears on the exploited-vulnerabilities list of the Cybersecurity and Infrastructure Security Agency (CISA).
  • AI agents raise the stakes: In June 2026, Sysdig documented an agentic attacker that created privileged containers and broke out to the host. Agents run code by design, so initial access is already granted.
  • Containers still fit trusted code: Hardened containers with fast patching suit code your team wrote and reviewed.
  • Untrusted code needs a hardware boundary: AI-generated or customer-supplied code belongs in microVMs, where an exploit stays inside one workload's kernel.

What is a container escape?

A container escape is an attack that lets a process break out of its container. It then reaches what sits outside it. The outcome takes one of three forms. The process reaches the host operating system or a neighboring container. Or it reaches resources it was never scoped to reach, such as node credentials. MITRE ATT&CK classifies the technique as T1611, "Escape to Host." Docker container escape is a common framing. But the same mechanics apply to containerd, CRI-O, and any runtime built on Linux namespaces.

Container isolation comes from four kernel features:

  1. Namespaces: decide what a process sees.
  2. Cgroups: cap what it consumes.
  3. Capabilities: split root into smaller units.
  4. Seccomp: filters which system calls reach the kernel.

One kernel enforces every one of those controls. Virtual machines work differently. Each VM runs its own kernel, and the CPU enforces the boundary between guest and host. The National Institute of Standards and Technology (NIST) addresses this in SP 800-190. It says a shared kernel "invariably results in a larger inter-object attack surface than seen with hypervisors."

Most attempts to escape Docker container boundaries follow the same four-step chain:

  1. Foothold: The attacker gets code running inside the container, through an application bug, a malicious image, or an injected prompt.
  2. Enumerate: The process checks for a mounted Docker socket, privileged mode, writable host mounts, or an unpatched kernel.
  3. Escalate: It becomes root inside the container, or confirms it already is.
  4. Break out: It uses one vector to run code on the host, such as a write to /proc/sys/kernel/core_pattern or a kernel exploit.

For an agent that executes code, step one is granted by design. The agent's job is to run code it wrote moments ago.

What are the most common container escape vulnerabilities in 2026?

Container security news in 2026 keeps returning to two classes of flaw. Misconfigurations need no exploit, and kernel or runtime bugs need a local foothold. The four below matter most for teams running agent workloads.

LayerExample2026 status
MisconfigurationPrivileged mode, mounted Docker socket, writable host mountsNo patch exists; a June 2026 Sysdig report described an agentic attacker that used privileged containers to escape in Juneduring a May 29, 2026 operation
Container runtimerunC trio, November 2025 (CVE-2025-31133, CVE-2025-52565, CVE-2025-52881)Fixed in runc 1.2.8, 1.3.3, and 1.4.0-rc.3; no exploitation reported at disclosure
Linux kernelCVE-2024-1086 (netfilter use-after-free)In CISA's exploited-vulnerabilities catalog; flagged for ransomware use in October 2025
Linux kernelCopy Fail (CVE-2026-31431)Public exploit; on CISA's exploited-vulnerabilities list

Misconfigurations need no exploit

Many Docker escapes in production start with configuration, not a zero-day.

  • Privileged mode: Privileged mode hands the container almost every host capability.
  • Mounted Docker socket: A process can ask the daemon to start a new, privileged container with the host filesystem attached.
  • Broad host mounts: Broad mounts expose directories like /proc or / directly.
  • Excess capabilities: Extra capabilities hand a process host-level tools it doesn't need.

Your next step is an inventory, since no patch cycle closes these gaps. Pull every container spec running in production and flag privileged mode, socket mounts, and host paths. Each flagged item stays open until someone removes it. Those same paths are the ones an agent with a foothold checks first.

runC and Linux kernel vulnerabilities keep arriving

runC: Three high-severity runC flaws were disclosed in early November 2025. The three flaws, CVE-2025-31133, CVE-2025-52565, and CVE-2025-52881, affect mount handling. They abuse mount races, the /dev/console bind-mount order, and procfs write redirects to reach host root. A malicious image or container config can trigger them. They affect all major runtimes, including Docker, Kubernetes, containerd, and CRI-O. Sysdig reported no active exploitation at the time of disclosure.

CVE-2024-1086: The netfilter use-after-free sat in the kernel for about a decade. Sysdig reported that CISA flagged it for ransomware use on October 31, 2025. Fixed kernels are 5.15.149+, 6.1.76+, and 6.6.15+, per NVD. Hosts that never applied those fixes were the ones exposed to the 2025 ransomware use.

Copy Fail (CVE-2026-31431): A 732-byte exploit for Copy Fail is public. An unprivileged process inside a container can use it to escape to the host.

Copy Fail needs a local foothold, and an agent running code already has one. Put hosts running agent code at the front of the patch queue.

Why do AI agents raise the container escape risk?

Agents execute code by design, and their inputs are untrusted. A hidden instruction can sit in a web page, a pull request, or a document. The agent turns it into code and runs it inside your agent sandbox. OWASP callslists prompt injection a critical attack vectoras LLM01:2025—the first risk in its OWASP Top 10 for Large Language Model Applications. Treat model-written code as untrusted, even though your own agent wrote it.

Frontier models can find and use escape paths

The attacker Sysdig documented exploited the marimo flaw CVE-2026-39987. It created privileged containers and broke out to the host. It then replayed a stolen Kubernetes service-account token to dump the cluster secret store.

Researchers have also built a benchmark, SandboxEscapeBench, to test whether models can break out of containers. Plan on a capable agent finding every low-effort path that exists in its environment.

What the July 2026 OpenAI and Hugging Face incident shows

Hugging Face disclosed a security incident in July 2026. Axios reported that OpenAI attributed it to one of its models.

An escape chain crosses several trust boundaries, and each one is a separate control. Isolation limits how far an exploit reaches. Egress rules set where the workload can connect, while least privilege caps what a stolen credential buys. Deny-by-default egress targets the egress control directly.

Are hardened containers enough?

Containers are the industry standard for running your own trusted software. For single-tenant code your team wrote and reviewed, hardened containers with fast patching are the right call. The author is known, the image comes from your pipeline, and the inputs are yours. A container escape still requires an attacker to get code running first. For reviewed first-party software, that step is hard.

Hardening at the principle level covers these habits:

  • No privileged mode: Production containers never run privileged.
  • No Docker socket: No workload gets the Docker socket mounted into it.
  • Narrow host access: Containers mount only the host paths an application needs.
  • A written service-level agreement (SLA) for patching: Peg the SLA to CISA's exploited-vulnerabilities catalog so the clock starts when exploitation starts.

Write the SLA down and report against it monthly. Hardening still stops where the code's author stops being known. NIST SP 800-190, cited above, ties the shared kernel to a larger attack surface than hypervisors carry. The Kubernetes RuntimeClass docs point high-assurance workloads to hardware-virtualized runtimes.

WorkloadIsolation
Reviewed first-party code, single tenantHardened containers with a defined patch SLA
First-party code, multiple tenantsHardened containers, with sensitive tenants on dedicated nodes
AI-generated or customer-supplied codeMicroVM, one kernel per workload

How does microVM isolation contain a container escape?

A microVM is a lightweight virtual machine with its own guest kernel, running on a hardware-virtualization boundary. Firecracker is one widely used implementation, and it's the same technology class AWS Lambda runs on. Each microVM boots a separate kernel, and the hypervisor and CPU enforce the line between guest and host. The guest reaches the host through a short list of emulated devices.

They are virtio network and block, a serial console, and a partial keyboard controller. The Firecracker paper was presented at USENIX NSDI 2020. It says virtualization moves the security-critical interface to a hardware-supported boundary. That boundary has a much smaller software surface than the operating system boundary.

A Copy Fail-style exploit inside a microVM compromises the guest kernel only. The host and neighboring workloads sit behind the hypervisor. To go furtherescape from a microVM guest to the host, an attacker needsmust exploit a second, separate flawvulnerability in the hypervisor or virtual machine monitor's host-side code or device emulation. Hypervisor escapes exist but are rare, and the interface is far smaller than a full kernel's.

A 2026 Kata Containers advisory, CVE-2026-24834, shows the shape of the residual risk. A container escaped into its guest VM, with no escape to the host. MicroVMs also don't fix leaked credentials or open egress. A microVM with unrestricted outbound traffic can still reach any host the network allows. gVisor sits between the two models; its user-space kernel is stronger than a plain container and weaker than hardware virtualization.

Teams can build this isolation layer directly with Firecracker or compare managed agent infrastructure platforms on isolation, resume latency, egress control, secret handling, and compliance. For teams running coding agents that execute untrusted code, Blaxel is one managed option: it runs each sandbox in its own Firecracker microVM. An exploit in one agent's code stays bounded by that sandbox's kernel.

Sandboxes resume from standby in under 25ms. That speed keeps a VM per workload practical for coding agents that need instant feedback. Outbound domain filtering restricts each sandbox to the domains you allow. Proxy-based secret injection, currently in public preview, addresses the credential link. Blaxel is SOC 2 Type II and ISO 27001 certified. Health Insurance Portability and Accountability Act (HIPAA) compliance is available through a Business Associate Agreement.

Minimize your risk for container escape with a microVM platform

Start by classifying each workload's code by trust level. Audit production for privileged mode, socket mounts, and host paths this week. Then set a patch SLA pegged to CISA's catalog. Reviewed first-party code stays in hardened containers. Code a model wrote at runtime moves to its own kernel.

An agentic attacker has already escaped a container to the host in the wild. For agents that execute code, the execution layer has to assume the code is hostile.

Teams can build this boundary directly with Firecracker or choose an agent infrastructure platform. For code-executing agents, Blaxel is one managed option that gives each sandbox a dedicated microVM with domain filtering around it. That design contains a container or guest-kernel exploit within one guest kernel unless the attacker also has a separate hypervisor flaw.

FAQs about container escape

What's the difference between a container escape and a sandbox escape?

A container escape is one kind of sandbox escape. "Sandbox" names any isolated execution environment, and the escape is named for the boundary it crosses. A “Docker break out of container” event is the same as a Docker breakout, Docker container breakout, or container escape. Each crosses the container boundary to reach the host kernel's resources. A microVM sandbox escape means crossing the hypervisor boundary, which needs a different and much rarer class of flaw.

Can AI agents escape containers?

Yes, when the container is misconfigured. The June 2026 case described above created privileged containers and broke out to the host. In production, assume an agent will find any low-effort path present in its environment.

When should teams choose microVMs over containers?

Choose microVMs when you can't vouch for the code's author, as with AI-generated or customer-supplied code. Multi-tenant workloads need microVMs only when tenants run untrusted or customer code. There, one tenant's escape would expose another's data. Each microVM runs its own kernel, so a kernel exploit stops at that workload instead of reaching the node. Keep hardened containers for reviewed first-party code. For that code, a known author and a defined patch SLA cover the realistic threat. NIST SP 800-190's comparison of shared kernels and hypervisors is a useful tiebreaker.

How fast should teams patch container escape vulnerabilities?

Use the deadlines in CISA's exploited-vulnerabilities catalog as the floor. Hosts running agent code should move faster than that, because the local foothold the exploit needs already exists. Monitor CISA's catalog and your runtime vendors' advisories. Start the SLA clock at the catalog addition, not the CVE publication.

Related articles