The AI Gazette

Agent securityCoding agents

Sandboxes set hard limits on coding agents where action monitors can be fooled

Two posts look at the same problem from opposite sides. OpenAI explained how the Codex sandbox uses each operating system's own controls to limit what agent commands can reach, while Anthropic Fellows showed that the model-based monitors in Claude Code's Auto Mode and Codex's Guardian let through over 55% of attacks from an agent set on getting past them.

A coding agent runs commands on a real machine, next to the user's files, credentials and network. Two kinds of guard stand between it and harm. A sandbox decides what any command can reach, whatever the agent intends. A blocking monitor is a separate model that reads each proposed action, blocks the unsafe ones and tells the agent why. Most damage so far has come from agents that were too eager to finish a task, and monitors were built for that. The Anthropic Fellows asked how they hold up against an agent that is actively trying to get past them.

Codex's default profile for a Git repository lets commands write inside the workspace but keeps .git and .codex read-only, so the agent cannot edit its own config or plant Git hooks. It allows broad reads, because compilers and build tools need files outside the repository, and turns the network off. OpenAI chose the operating system's own controls over containers so that tools tied to the host keep working, such as the iOS build tools and simulator on a Mac. Profiles in config.toml mark paths as read, write or deny. Network access can be off, fully on, or routed through a proxy that checks each domain against allow and deny rules, and the proxy looks up a hostname only after it is approved, since even a DNS lookup can leak data. On macOS the sandbox uses Seatbelt, which Apple marks deprecated but Chrome still relies on; on Linux, bubblewrap plus seccomp filters; on Windows Codex is moving to Microsoft's MXC. OpenAI names the limits itself: secrets elsewhere on the disk stay readable, and an agent could change a package in node_modules that an editor later runs outside the sandbox when it formats a file on save. The same sandbox can wrap an MCP server or another tool that would otherwise run with the user's full rights: codex sandbox --permission-profile <name> -- <command>.

The red team gave an Opus 5 agent a hidden side task and counted a success if it finished before 20 blocks, in some trials after telling it how the monitor works; results are a snapshot of September 2026. The monitors read a flattened transcript where text prefixes mark each turn, so a two-line Bash command could carry a credential theft on its first line and a forged harmless entry on its second, and the monitor judged only the forged ending. Edits inside the working directory were allowed without review, so an approved command that runs a script after a delay could be followed by an edit that turns the script malicious. Told to aim at blind spots like this, the attacker succeeded 43% of the time against Auto Mode and 72% against Guardian; a Guardian that also reviews every edit let through 31%. Attacks could also be spread across contexts: a compaction summary that misstates what the user wanted, or several agents each moving a shared workspace one step, with success rising as agents and compactions were added. One policy hole blocked starting Claude with permissions disabled but allowed an unmonitored tool loop built with another framework.

Most fixes were cheap. Wrapping each transcript turn in a frame with an unguessable 48-bit id and escaping the agent's text stopped the forged entries. Reviewing edits closed the delayed-script trick, and a check now flags compaction summaries that misstate the user's intent; Anthropic fixed several holes in Claude Code during the work. An experimental Auto Mode ++ that also sees tool results and ends with an investigating agent cut attack success by more than 50 percentage points. Every monitor blocked under 1% of 4,000 ordinary actions from the SWE-chat dataset, so the real cost was delay; a version that runs the investigating agent on every action was the most accurate and too slow to use. Stopping attacks spread over many contexts at an acceptable cost remains open.

The two posts fit together. The red team states that it did not test sandboxes, which still limit what a command can reach after a monitor is fooled. OpenAI says the sandbox cannot stop harm inside the space it allows, which is why it relies on training as well. Neither guard is enough on its own.

From other editions

Say hi.