Sandboxed Execution for Coding Agents Trial
Overview
Sandboxed execution for coding agents is the practice of running agents inside isolated environments with restricted filesystem access, controlled network connectivity and bounded resource usage, so that installing packages, running builds and executing shell commands cannot reach the developer's machine, credentials or production systems (Thoughtworks Radar). The framing this quarter has shifted from generic "sandbox mode" toggles to agent workflow sandboxes: environments good enough to be the real execution surface for an agent's whole task, including tests. GitHub Agentic Workflows added microVM-isolated sandboxes with a private container daemon in version 0.82.9, and in the reference demo an agent ran a Java 21 service's Testcontainers suite against PostgreSQL, found a case-sensitivity bug in email handling, fixed it and opened a draft PR entirely inside the sandbox (gh-aw sandboxes). That is CI-grade isolation, not a local convenience feature.
The second shift is in the failure modes. Cloud Security Alliance's review of Pillar Security's "Week of Sandbox Escapes" against Cursor, Codex CLI, Gemini CLI and Antigravity found that none of the seven disclosed issues broke the sandbox: in each case the agent stayed inside the box and followed the rules, but wrote a hook configuration, virtual-environment interpreter, Git config entry or task definition that a trusted, unsandboxed tool consumed after the agent's turn ended (CSA research note). Meanwhile the GitLost vulnerability in GitHub Agentic Workflows let an unauthenticated attacker hide indirect prompts in a crafted public GitHub Issue and leak private repository data, with no coding skills or credentials required (SecurityWeek). Sandbox boundaries are central precisely because injection is now a routine input condition rather than an edge case.
The entry stays in Trial. The capability should be a default rather than an optional enhancement, but the option space is still wide and the guarantees uneven: built-in agent sandbox modes, Dev Containers, disposable microVMs that reset every run, stateful environments with checkpoint and restore, Linux bubblewrap and macOS sandbox-exec all sit at different points on the ephemeral-versus-persistent and strength-of-isolation trade-off (Thoughtworks Radar). Pillar Security's analysis of 14 sandbox solutions concluded that every isolation tier has a failure mode, and that blast-radius containment only works if teams know what they are isolating from and what credentials are mounted inside (sandbox selection as threat modeling). Trial, validate the boundary, then standardize.
Adoption Signals
- GitHub Agentic Workflows shipped sandbox support in 0.82.9, using a microVM as the primary boundary — each sandbox gets its own kernel, filesystem, network stack and private daemon, with only the repository workspace shared with the host runner — and enforces a split trust model: broad shell and sudo inside the sandbox, strict network allowlists, limited token scopes, and a safe-output job restricting PR changes to
src/**(gh-aw sandboxes). - OpenAI's April 2026 Agents SDK release added production-ready sandbox execution with persistent isolated containers, support for eight providers (E2B, Modal, Docker, Vercel, Cloudflare, Daytona, Runloop and Blaxel), and a model-native harness with filesystem tools plus credential-isolation features (OpenAI Agents SDK sandbox).
- The same release introduced a
SandboxAgentharness and aUnixLocalSandboxClientfor restricted workspaces on April 15, 2026, while Cloudflare opened its Dynamic Worker Loader in beta on March 24, 2026 for ephemeral low-latency sandboxes inside Workers, and a Kubernetes SIG Apps agent-sandbox project is under way (sandboxing strategies). - LangSmith Sandboxes reached GA on May 13, 2026, with each sandbox running as a hardware-virtualized microVM kernel-isolated from other sandboxes, plus snapshots, copy-on-write forks, Blueprints for pre-warmed environments, Service URLs, a CLI and an Auth Proxy — positioning sandboxes as a full agent execution platform rather than an eval boundary (LangSmith Sandboxes GA).
- AWS documents a pattern combining Lambda MicroVMs, the Agent Toolkit for AWS and Policy in Amazon Bedrock AgentCore so coding agents can build, test and deploy with granular governance, noting that today most agent work still executes with whatever permissions the developer holds (AWS Compute Blog).
- Docker Sandboxes give each sandbox a dedicated microVM with a completely private Docker daemon, and E2B uses Firecracker microVMs so a guest kernel vulnerability cannot reach the host; coding agents such as Claude Code, Codex and OpenCode are explicitly designed to run inside sandboxes rather than alongside an unprotected environment (Firecrawl).
- Supervisory and detection layers are emerging around the sandbox rather than inside the agent: grith 0.3.2 ships as an OS-level supervisor on Linux using ptrace with a seccomp-BPF pre-filter to intercept file, process-execution and network syscalls, scoring them through 18 deterministic filters with no LLM in the enforcement path (grith is live).
- The open-source Sage project frames this as "Agent Detection & Response," intercepting Bash commands, URL fetches and file writes through native hooks in Claude Code, Cursor/VS Code and OpenClaw, with URL reputation checks, YAML threat definitions, npm/PyPI supply-chain checks and session-start plugin scanning (Help Net Security).
- Vendor security guidance now treats agents as computer-use agents: NVIDIA notes that command-line tools run with the same permissions and entitlements as the user, carrying all the associated risks (NVIDIA guidance).
Risks
- Trust handoffs, not walls, are where escapes happen. Every one of the seven disclosed escapes exploited the gap between what the sandbox restricted and what a trusted component outside it later read, ran or scanned; Cursor's workspace-controlled hook execution flaw was tracked as CVE-2026-48124 with CVSS 8.5 and fixed in 3.0.0, and OpenAI patched a related Codex CLI allowlist bypass nicknamed "GitPwned" in 0.95.0 (CSA research note).
- Vendor response times vary. Google classified two Antigravity-specific findings as "other valid security vulnerabilities," downgraded their severity as difficult to exploit, and had shipped no fixes at disclosure time — so your remediation timeline is not fully under your control (CSA research note).
- Prompt injection reaches agentic CI through ordinary inputs. GitLost required only an issue opened on a public repository to steer an AI-powered workflow into exposing private repository data, with no access or credentials needed (SecurityWeek).
- Auto-approve collapses the permission model. Reviewing dozens of approval prompts an hour is not a workflow, so teams switch on auto-approve — at which point the security decision is being made by the same probabilistic model that a poisoned README or prompt injection can steer (grith is live).
- Containers alone are not a production boundary. Real supply-chain attacks and kernel exploits such as the Shai-Hulud npm worm and the Copy Fail CVE make container or eval boundaries insufficient for running untrusted, model-generated code (LangSmith Sandboxes GA).
- Mounted credentials undo isolation. Isolation contains blast radius only if teams understand what they are isolating from and which credentials are mounted inside the sandbox, and every isolation tier across 14 reviewed solutions has a failure mode (sandbox selection as threat modeling).
- Persistent sandboxes can be poisoned. Researchers have documented configuration-persistence and poisoning risks where attackers alter trusted agent files inside coding and agent sandboxes to influence future behavior (Augment Code).
- Scoping is the hard part, not enabling the sandbox. Code execution turns runtime access into a security boundary, and that boundary only works when filesystem, network, secrets and tool access are each deliberately scoped (smaller computer analysis).
- Containment is not correctness. A sandbox limits execution effects, but generated changes still require human review, tests, static analysis, dependency scanning and branch protection before they leave the sandbox.
Pros & Cons
Advantages
- MicroVM-based agent sandboxes now give each agent its own kernel, filesystem, network stack and private container daemon, so an agent can run real integration tests against real databases without touching the host runner or production systems.
- The tooling has matured from single-vendor sandbox flags into a portable layer: managed platforms (LangSmith Sandboxes, AWS Lambda MicroVMs) and multi-provider SDK integrations mean teams can standardize one isolation contract across several agents and frameworks.
- Sandboxes turn agent autonomy into reviewable output — diffs, logs, test results and draft PRs constrained by network allowlists, token scopes and output filters — which lets teams grant broader autonomy without granting broader access.
Disadvantages
- Documented escapes did not break the sandbox itself; agents stayed inside the boundary and wrote files that unsandboxed tools later read or executed, so the trust handoff at the sandbox edge is now the dominant failure mode.
- Prompt injection reaches agent workflows through the content they legitimately process, and the GitLost vulnerability showed an unauthenticated attacker leaking private repository data via a crafted public GitHub Issue.
- Isolation is only as good as what is mounted inside it: credentials, persistent agent configuration files and permissive allowlists can turn a technically sound sandbox into an exfiltration path, and container-only boundaries remain weak against kernel and supply-chain attacks.
Recommendation
Treat sandbox selection as a threat-modeling exercise, not a product choice. Decide first what the agent must be isolated from — host filesystem, developer credentials, internal network, production deploy keys — then pick the tier that matches: hardware-virtualized microVMs for untrusted model-generated code and CI-grade runs, lightweight namespace sandboxes for local iteration (sandbox selection as threat modeling, Thoughtworks Radar). Copy the split trust model from agentic CI: broad shell and sudo inside the boundary, strict network allowlists, minimal token scopes, and a constrained output path that limits which files a resulting PR may touch (gh-aw sandboxes).
Test the trust handoff, not just the wall. Because the disclosed escapes all involved the agent writing a file that an unsandboxed tool later consumed, your test plan should ask what happens to hook configurations, Git config entries, virtual-environment interpreters, task definitions and other agent-writable configuration once the turn ends, and pin agent CLIs to versions that carry the relevant fixes (CSA research note). Assume injected instructions will arrive through issues, READMEs and fetched pages, and make network egress deny-by-default so a steered agent has nowhere to send data (SecurityWeek).
Do not rely on in-agent approval prompts as your control plane. Put enforcement outside the agent — an OS-level supervisor on syscalls, or a hook-level interception layer with supply-chain and URL reputation checks — so the decision is deterministic and survives auto-approve (grith is live, Help Net Security). Prefer ephemeral or snapshot-and-fork environments over long-lived ones to blunt configuration-persistence attacks (Augment Code, LangSmith Sandboxes GA), and inject credentials explicitly with governance attached rather than inheriting the developer's own entitlements (AWS Compute Blog). Move to Adopt only when sandbox profiles, secret handling, egress policy, audit logs and exception workflows are reproducible across every agent the team runs.
Sources
- Thoughtworks Radar: sandboxed execution for coding agents
- GitHub Agentic Workflows sandboxes and CI integration tests
- Critical prompt injection vulnerability in GitHub Agentic Workflows (GitLost)
- CSA research note: AI coding agent sandbox escapes
- Sandbox selection for AI coding agents is a threat-model decision
- Sandboxed code execution gives AI agents a smaller computer
- LangSmith Sandboxes are generally available
- OpenAI Agents SDK sandbox: production code execution
- Sandboxing strategies secure AI agents in production
- Secure code execution for AI agents with AWS Lambda MicroVMs
- AI agent sandbox: how to safely run autonomous agents
- grith is live
- Open-source tool Sage puts a security layer between AI agents and the OS
- What is an agent execution sandbox?
- NVIDIA: practical security guidance for sandboxing agentic workflows
- Sandboxed code execution for AI agents in 2026: E2B vs Modal vs Daytona
Overview
Sandboxed execution isolates coding agents from the developer's primary machine, credentials, networks, and production systems while they install packages, call tools, or modify files. OpenAI describes the Codex sandbox as the boundary that lets an agent act autonomously without unrestricted access to the machine, defining what files it can modify and whether commands can use the network (Codex sandboxing).
The key distinction is that sandboxing and approvals are separate controls. A sandbox sets technical boundaries, while an approval policy decides when the agent must stop and ask before crossing those boundaries (Codex sandboxing). This pattern is especially important for coding agents because their normal workflow involves executing shell commands, running package managers, starting test harnesses, editing files, and sometimes interacting with external systems.
The reason to classify sandboxed execution for coding agents as Trial is that it should become a standard control, but implementations are still uneven. Teams should trial sandboxing for local coding agents, cloud agents, CI agents, and developer workstations, then standardize only after validating filesystem, network, secrets, approvals, logs, and escape hatches.
Adoption Signals
- Codex applies sandboxing automatically in its default permission mode for local commands in the app, IDE extension, and CLI, with platform-native enforcement across macOS, Linux, WSL2, and native Windows (Codex sandboxing).
- Codex defines common sandbox modes:
read-only,workspace-write, anddanger-full-access, plus approval policies such asuntrusted,on-request, andnever(Codex sandboxing). - Codex states that spawned commands such as
git, package managers, and test runners inherit the same sandbox boundaries, not only the agent's built-in file operations (Codex sandboxing). - Claude Code documents a sandboxed Bash tool where users define which files and network domains commands can touch, and the operating system enforces the boundary for every Bash command and its child processes (Claude Code sandboxing).
- Claude Code supports macOS Seatbelt and Linux/WSL2 bubblewrap, with filesystem controls for allowed and denied reads/writes and network controls for allowed or denied domains (Claude Code sandboxing).
- Docker documents running OpenCode inside Docker Sandboxes with
sbx run opencode, project-directory isolation, stored secrets, credential injection, and host user-level configuration isolation (Docker OpenCode sandbox). - OpenCode provides a permission model with
allow,ask, anddeny, including controls for file reads, edits, bash commands, web access, subagents, skills, and external directories (OpenCode permissions). - OWASP's Excessive Agency guidance reinforces the need to limit functions, permissions, and autonomy for LLM-based systems that can call tools or extensions, including avoiding open-ended shell-command tools where more granular tools are possible (OWASP LLM06 Excessive Agency).
Risks
- Full access modes can erase the boundary. Codex documents
danger-full-accessas removing filesystem and network boundaries, and full access combines that mode withapproval_policy = "never"(Codex sandboxing). - Network allowlists are hard to reason about. Claude Code warns that broad allowed domains can create data-exfiltration paths and that the built-in proxy does not inspect encrypted traffic, so stronger guarantees may require a custom TLS-inspecting proxy (Claude Code sandboxing).
- Credential files and inherited environment variables can leak. Claude Code notes that credentials such as
~/.aws/credentialsand~/.ssh/are readable by default unless denied, and sandboxed Bash commands inherit the parent process environment by default unless scrubbed (Claude Code sandboxing). - Docker access can break isolation. Claude Code warns that allowing access to
/var/run/docker.sockeffectively grants access to the host system through the Docker socket (Claude Code sandboxing). - Permission prompts are not the same as OS isolation. OpenCode's permission model can ask, allow, or deny agent actions, but permissions alone do not necessarily constrain what a spawned process can do at the operating-system level (OpenCode permissions).
- Tool compatibility can force exceptions. Claude Code notes that some tools such as Docker, Watchman, certain Go-based CLIs, or Windows binaries under WSL may need to run outside the sandbox, creating exception paths that must be reviewed (Claude Code sandboxing).
- Sandbox configuration can drift by developer. If sandboxing is optional or configured only locally, teams may end up with inconsistent safety boundaries; Claude Code supports managed settings to require sandboxing and prevent unsandboxed command fallback (Claude Code sandboxing).
- Sandboxing does not stop bad code from being committed. A sandbox can contain execution effects, but generated changes still need human review, tests, static analysis, dependency scanning, and branch protection before leaving the sandbox.
Pros & Cons
Advantages
- Gives coding agents a bounded environment where they can install packages, edit files, run tests, and execute commands without unrestricted access to the developer's machine or production systems.
- Reduces approval fatigue by allowing safe actions inside a pre-approved filesystem and network boundary while escalating actions that cross that boundary.
- Enables reproducible and reviewable agent work through ephemeral environments, explicit secret injection, resettable state, artifact review, and clear promotion paths from sandbox to branch or pull request.
Disadvantages
- Sandboxing is not uniform across agents, operating systems, and deployment modes; each tool's filesystem, network, secret, and approval behavior must be verified.
- Broad filesystem writes, network allowlists, Docker socket access, inherited environment variables, or unsandboxed escape hatches can turn a sandbox into a weak boundary.
- Sandboxes reduce blast radius but do not replace code review, test validation, dependency scanning, prompt-injection defenses, or least-privilege downstream credentials.
Recommendation
Trial sandboxed execution as a baseline control for coding agents before allowing autonomous command execution. Start with ephemeral or resettable environments, workspace-scoped writes, no host credential access by default, network deny-by-default with narrow allowlists, explicit secret injection, resource limits, and approval gates for actions outside the sandbox.
Validate the actual boundary, not the product claim. Test whether the agent can read SSH keys, cloud credentials, shell history, .env files, sibling directories, Docker sockets, browser profiles, internal network endpoints, package-manager lifecycle scripts, and production deployment credentials. Confirm that spawned commands inherit the same boundary and that logs show what was run.
Promote results through reviewable artifacts. Agents should produce diffs, logs, test outputs, and summaries that humans can review before changes are pushed, merged, deployed, or granted broader access. Move from Trial to Adopt only when sandbox profiles, secret handling, network controls, audit logs, and exception workflows are reproducible across the team's agent tools.