OpenAI explains how Codex applies sandbox limits on three platforms

OpenAI has published a detailed explanation of the Codex sandbox, the control layer that constrains commands launched by its agentic coding harness on macOS, Linux and Windows. The system applies filesystem and network limits through permission profiles, while allowing Codex to work in the developer’s existing environment rather than moving work into a separate virtual machine or container.
Its built-in :workspace profile allows writes inside a Git repository workspace but keeps directories including .git and .codex read-only. It also permits broad filesystem reads, subject to operating-system permissions, and disables network access by default. That balance lets code be edited without approval for every change, but it does not eliminate risks from readable sensitive files or harmful modifications to locally installed packages.
One API, platform-specific enforcement
Codex’s harness launches commands through a common sandbox API that receives a command, working directory, environment, permission profile and, where needed, a network proxy. Restrictions are inherited by child processes, including descendants that outlive the original command. The shell tool can request additional permissions or execution outside the sandbox, but the harness decides whether to approve those requests.
OpenAI uses native or platform-oriented mechanisms rather than a single container model. On macOS, Codex invokes Apple Seatbelt through sandbox-exec. On Linux, it combines bubblewrap with seccomp-bpf, including mount and network namespaces when the configured policy requires them. On compatible Windows devices, Codex is transitioning to Microsoft eXecution Container, or MXC, to use native process isolation.
Profiles can limit files, domains and policy choices
Custom profiles in config.toml can grant read, write or deny access to specified paths and workspace-relative locations. They can also enable direct network access, disable networking, or send permitted traffic through a proxy governed by domain rules. Explicit deny entries take precedence over allow entries, and the proxy assesses a hostname before resolving it, because a DNS lookup can itself disclose information.
Administrators can layer managed requirements over user and project configuration. For example, an organization can restrict the permission profiles employees may select, including disallowing :danger-full-access. The Windows implementation context is reflected in Codex sandbox protection on Windows while the new article describes MXC’s policy translation for filesystem, network, desktop and clipboard controls.
Reusable isolation beyond the agent session
The codex sandbox command lets developers run an arbitrary command under a named profile, making it possible to test whether a policy blocks an unwanted action. OpenAI gives the example of blocking a write to VS Code settings when the project’s .vscode directory is read-only.
The same command can also wrap an MCP server. OpenAI shows how a memory server can be run with network access disabled and writes limited to the npm cache and its data directory after its pinned package has been cached. For businesses deploying coding agents, the implication is to turn intended access into named, tested profiles and enforce organizational limits through managed configuration rather than treating sandboxing as an all-or-nothing setting.

