
On 18 November 2026, OpenAI published "Inside the Codex sandbox," a technical note by Michael Bolin, a member of technical staff. Codex is OpenAI's coding agent. The post explains how the agent runs commands on the user's own machine under filesystem and network limits the user can set through permission profiles, which are named sets of rules.
A sandbox, as the post defines it, limits what a program can access while it runs. The important claim is not that this box is sealed. OpenAI describes a "defense in depth" design. It combines training and alignment with limits in the agent harness, the software that actually runs the model's tool calls. The default profile still allows broad reads, including files that may contain API keys, and it still leaves a path for code to execute unsandboxed through ignored directories such as node_modules.
What the default profile actually allows
With a Git repository as the workspace root, the built-in :workspace profile does three things. It allows writes inside the workspace, while keeping directories such as .git and .codex read-only, so the agent cannot directly change .codex/config.toml or Git hooks under .git/hooks. It allows broad filesystem reads, subject to the user's existing operating-system permissions. Compilers, runtimes, and build tools depend on software development kits, libraries, and configuration outside the repository. Restricting reads to the workspace, the post says, would break many ordinary workflows. The tradeoff is stated plainly: "sensitive files elsewhere on the machine may also remain readable (such as config files containing API keys)."
It also disables network access by default. That blocks direct uploads to external services, including attempts to send out data the command can read. It also blocks legitimate operations such as downloading dependencies, which then require additional access.
Users can define other named profiles in config.toml, extend :workspace, and grant or deny particular paths. Enterprises can layer configuration and supply managed requirements, including a list of allowed permission profiles. The sandbox is also exposed as a reusable codex sandbox command, so the same limits can be applied to tools outside an agent session.
The residual path OpenAI names
These restrictions, the post says, prevent a large class of bad behavior, but harmful actions are still possible. The example is specific. The agent could inject malicious code into a locally installed package such as node_modules/prettier. That change might not appear in git status, because node_modules is often ignored by Git, meaning it is listed in a file that tells Git not to track those paths. If the user's editor runs that copy of Prettier on save, simply saving a file could execute the malicious code outside the Codex sandbox. "This is why we take a defense in depth approach," Bolin writes: the sandbox limits what commands can access, while training and alignment are supposed to help the model use that access in line with the user's intent.
The same post describes other ways work can leave the box. The harness can honor a request to run a command with escalated permissions, meaning execution outside the sandbox, if the user's preferences allow it. Codex may prompt the user, or route the request to auto-review. Separately, for a standard-input MCP server, a tool process started from configuration, the harness "does not attempt to sandbox the command used to start the server," because it cannot reliably infer which files or network services that server needs. The post shows how an operator can wrap such a command with codex sandbox; the default is not to do so automatically.
Codex also chooses to constrain commands in the user's existing environment, rather than moving them into a virtual machine or a container. The post's example is iOS development on a Mac. A Docker container would not run Apple's native build tools or the iPhone simulator. That product choice is why a fully closed box is not the default, and why residual paths on the host matter.
[1]The case for an open-enough box
This is a real product constraint, and the post is unusually candid about it. A coding agent that cannot read an SDK outside the repository, or cannot write ordinary source files without a prompt on every change, will not survive contact with a compiler. Conservative defaults that still let a build run are harder to design than a box that simply refuses everything. OpenAI's own Prettier example is the strongest part of the piece, because it does not pretend that filesystem and network limits are enough.
Defense in depth is a fair name for that posture, if it is read as a warning rather than a comfort. The sandbox is one layer. Training is another. User-configured profiles, enterprise requirements, and the reusable codex sandbox command are further layers. The post is useful because it tells the user where those layers stop.
What the post cannot prove
This is OpenAI describing its own design, not an independent audit of how the sandbox behaves in the wild. The residual-risk example is illustrative. The post does not report how often ignored directories, readable key files, or unsandboxed MCP servers have been involved in real incidents, and it does not provide a third-party test of the default profile.
Some of the enforcement details also have a documented hole. On Linux, Codex uses bubblewrap, a tool that builds a restricted view of the filesystem, plus seccomp, a kernel filter on system calls, the requests a program makes to the operating system. On Windows, the post says Codex is replacing its existing sandbox with one that uses MXC, short for Microsoft eXecution Container, a Microsoft library for running a command in a contained process on compatible devices. In both of those descriptions, deny globs, pattern-based path blocks such as **/*.env, are expanded to concrete paths before a command is launched. "New matching paths are not automatically added to that command's sandbox restrictions," it says of the Linux path. On Windows, "New paths that match the glob are not automatically added while the command is running." A file created after launch that matches a deny rule may therefore fall outside that command's restrictions. The post describes macOS enforcement through Seatbelt, Apple's kernel sandbox, but it does not state the same glob-expansion caveat in the macOS section, and this article does not infer one.
Users can also approve runs that leave the sandbox. The default is conservative. It is not immovable.
[1]What to watch over six months
In the next six months, the useful test is whether those residual paths show up in real incidents, and whether OpenAI tightens the default around ignored directories and readable key files, or keeps asking users to add layers on top of a box that was never meant to be sealed. A change that would alter the argument would be a default that still lets a compiler run, but treats gitignored install folders and key-bearing config files as off-limits unless the user opts in. Until then, the honest reading of this post is the one it offers: defense in depth, because the sandbox alone does not close the box.
[1]