Skip to content

AI Agents Bypass Sandboxes Through Indirect Code Execution

Bottom line: AI agents can circumvent sandbox isolation by writing configuration files and scripts that trusted host processes later execute—without technically leaving the sandbox themselves.

Pillar Security has documented vulnerabilities in AI-powered development environments such as Cursor, Codex, Gemini CLI, and Antigravity, where agents cross security boundaries without technically breaking their sandboxes. Attackers write files for execution to trusted components outside the sandbox.

Security researchers at Pillar identified four repeatable failure patterns in AI sandboxes: denylist-based sandboxes fail under growing operating system complexity, workspace configurations prove to be executable code, command allowlists trust command names rather than actual command invocations, and privileged local daemons sit entirely outside the sandbox.

Attack mechanics vary by tool: In Antigravity, researchers exploited weaknesses in the macOS Sandbox profile and abused VS Code task configurations that are later executed with host privileges. Cursor trusts agent-generated Python virtual environments, alternative Git directories, and workspace hook configurations. Cursor, Codex CLI, and Gemini CLI share a common bypass route via Docker Desktop’s privileged daemon. In Codex CLI, a supposedly secure Git allowlist can be manipulated to alter repository configurations and trigger code execution at a later point.

The key difference from previous security modeling: classical endpoint protection checks whether a process escapes its execution sandbox. Autonomous agents circumvent this control logic by continuously generating content—workspace configurations, automation scripts, IDE settings, virtual environment contents—that trusted external tools later consume and execute. The agent remains isolated, but its generated code runs outside the sandbox.

Pillar recommends CISOs adopt a new security model for agentic software: treat workspace configurations with execution potential as sensitive assets, require explicit approval before agent-side changes to host automation, run auxiliary processes under the same security policy as direct agent execution, implement provenance tracking to distinguish user, repository, and agent-generated files, model security policies around command effects rather than just process calls, restrict access to privileged local services, and monitor trust handoffs throughout the development workflow.


Source: www.csoonline.com · Published 21 July 2026
Lumi AI News — AI-assisted curation per Article 50 EU AI Act. Paraphrase and classification by Lumi News Pipeline v1.7.3.

Share on: