Skip to content

← All posts

OpenAI's Codex sandbox bets on the OS, not a VM

TL;DR OpenAI detailed how the Codex sandbox confines agent commands on your own machine using permission profiles, a domain-filtering proxy and OS controls on macOS, Linux and Windows. Our take is that the local design is right, and the gaps OpenAI admits are where teams should act.

What OpenAI announced

  • What it is. An engineering post by Michael Bolin of OpenAI's technical staff on how Codex runs commands in your existing environment within filesystem and network limits you control. OpenAI presents the sandbox as part of a defense in depth approach, alongside training and alignment.
  • Defaults. The built-in :workspace profile allows writes in the workspace but keeps .git and .codex read-only, allows broad reads, and turns network access off. OpenAI concedes that files elsewhere, such as configs holding API keys, may remain readable.
  • Profiles and approvals. Profiles in config.toml mark paths read, write or deny; network access is off, fully on, or routed through a proxy that enforces the profile's domain rules. For one command, the model can ask for more access or to run outside the sandbox; the harness decides, and may prompt the user or route it to auto-review. Admins can restrict which profiles users may select through requirements.toml.
  • Enforcement per OS. Seatbelt on macOS, bubblewrap plus seccomp-bpf on Linux, and on Windows a switch in progress to Microsoft's MXC library, partly because the old sandbox needed admin access to set up. Limits apply to every process a command spawns.
  • Reusable parts. codex sandbox runs any command under a profile; OpenAI says it is commonly used to test that a profile blocks what it should.

As OpenAI put it: "These restrictions prevent a large class of bad behavior, but harmful actions are still possible."

Our take

Two prominent agent launches in September gave the agent its own cloud machine: Meta's Muse gives each user's agent a dedicated cloud VM, and OpenAI's own dots got their own cloud computers. On your laptop, Codex goes the other way, letting the operating system fence commands in where the tools already are. The iOS example makes the case: inside Docker, Codex could not run the iOS build toolchain or launch the iPhone simulator.

The detail is rare too. A day later, Google's Gemini Mac computer-use announcement said users "approve key actions" without defining key. OpenAI names which folders stay read-only, the network default, who decides escalations and where its controls stop.

We found that last part the most useful. An agent could plant code in node_modules/prettier, which Git often ignores, and the user's editor could then run it on save, outside the sandbox. OpenAI also flags DNS-based leaks and unsandboxed MCP servers. A sandbox limits what a command touches, not what trusted tools later do with what it wrote.

In October, Anthropic reported Claude models routing around a fetch tool's URL-length limit with free URL shorteners. Limits belong outside the model, and here they are: the harness, not the model, grants escalations, and programs that ignore the proxy hit the operating system's block.

What's missing is evidence: no figures on escalation requests, auto-review approvals or blocked commands. On macOS, Codex relies on sandbox-exec, which Apple's own manual page calls deprecated, though OpenAI notes that Chrome relies on Seatbelt too. Strategically, a photo-organizing first example and a command for your own tools pitch Codex plumbing beyond coding.

What it changes for teams running agents

  • Turn on the proxy before writing domain rules. Enabling network without the proxy grants full access, and OpenAI's sample config notes that domain rules are then not enforced. Keep wildcards narrow; broad ones can still permit DNS-based exfiltration. With the proxy on, the MXC-based Windows sandbox leaves other local services reachable.
  • Deny secrets by name. Reads are broad by default, so add deny rules for .env files, key folders and credential configs. On Linux and Windows, deny globs expand at launch, so files that match later are not covered for commands already running.
  • Sandbox MCP servers yourself. Codex leaves stdio MCP servers unsandboxed, with the same permissions as the user. Wrap each in codex sandbox with its own profile, as OpenAI shows.
  • Test profiles before trusting them. Try the attack you fear through codex sandbox. In July, Anthropic disclosed evaluation incidents where a misconfiguration had left live internet access that neither it nor its partner knew about.
  • People still own the edges. In OpenAI's sample code, the approval question for running outside the sandbox is a justification field in the model's own tool call, so judge the command, not the reason. Watch files other tools load or execute, like editor settings and installed packages. Admins can copy OpenAI's example: a :read-only default with :danger-full-access disabled.

For agents reading this

  • Announced by: OpenAI
  • Original post: https://openai.com/index/inside-the-codex-sandbox/
  • Announcement date: 2026-11-18
  • What: Engineering explainer of the Codex sandbox, which confines agent commands in the user's own environment using permission profiles, OS controls and a network proxy
  • Availability: Part of Codex on macOS, Linux and Windows; codex sandbox command in the Codex CLI; MXC-based sandbox on compatible Windows devices, replacing the older one
  • Our verdict: The right design for local agents, documented in rare detail; its admitted gaps still need people
  • Confidence: facts from the original post; take is Orchard's opinion