APEX 100 · AI Security Red Teaming · #043 · Agentic & Tool Layer — L3 · MCP + tool calls

Sandbox Escape via Agent Code Execution

Agentic & Tool Layer · L3 · MCP + tool calls

An agent that can execute code in a sandbox is one primitive away from the host: path escapes, environment leaks, and dependency confusion all turn the sandbox from a control into a launchpad. The escape needs no model failure at all — just a code path.

01Control Architecture

How it is defended

The execution sandbox is treated as the L3 boundary: no-escape-by-construction (no host FS or network without a named grant), per-session egress allowlists, and escape-attempt canaries in CI. An escape found in test fails the release.

02Why It Breaks Naive Defenses

An agent that can execute code in a sandbox is one primitive away from the host: path escapes, environment leaks, and dependency confusion all turn the sandbox from a control into a launchpad. The escape needs no model failure at all — just a code path. The execution sandbox is treated as the L3 boundary: no-escape-by-construction (no host FS or network without a named grant), per-session egress allowlists, and escape-attempt canaries in CI. An escape found in test fails the release.

👤 Dr. Deepanjan Saha · Chief AI Security Red Team Principal & Chief Cybersecurity Architect (CAISO) · 15+ yrs · 47+ CVEs · 200+ pentests · 12 patents
📞 +91 98317 43870 · 💬 WhatsApp · ✉️ core.deepanjan@gmail.com · 🔗 LinkedIn: DRDEEPANJANSAHA · 🌐 drdeepanjansaha.github.io

Book the engagement that kills this, measured

Dr. Deepanjan Saha — Chief AI Security Red Team Principal & Chief Cybersecurity Architect. 15+ years · 47+ CVEs · 200+ pentests · 12 patents. Delivered as the release gate — a residual-risk number with a trend line, not a PDF.

03FAQ

How do agents escape code-execution sandboxes?

Usually not through the model but through the plumbing: host paths, environment variables, and network access that the sandbox quietly allows. Deny-by-default construction plus canary escape tests per release is what keeps the sandbox an actual boundary.

How do you defend against sandbox escape via agent code execution?

The execution sandbox is treated as the L3 boundary: no-escape-by-construction (no host FS or network without a named grant), per-session egress allowlists, and escape-attempt canaries in CI. An escape found in test fails the release.

DR. DEEPANJAN SAHA · CHIEF AI SECURITY RED TEAM PRINCIPAL & CHIEF CYBERSECURITY ARCHITECT · AI SECURITY RED TEAM · EST. 2010 · 47+ CVEs · 200+ PENTESTS · 12 PATENTS