OpenAI explains how Codex sandbox restricts command access
- OpenAI
- Codex
- sandbox
- config.toml
- spawn_command_under_sandbox

Permission profiles set filesystem and network controls in users’ existing environments
System enforces filesystem and network limits on macOS, Linux and Windows
Enterprise administrators can mandate security profiles through configuration
OpenAI explains how Codex uses a sandbox to limit the files and network resources its coding agent’s commands can access. The approach applies controls within a user’s existing computer environment rather than moving work into a separate virtual machine or container.
Users set restrictions through permission profiles, which specify filesystem and network access for a session. The built-in workspace profile permits writes in the project workspace, allows broader file reads subject to the user’s operating-system permissions, and disables network access by default. Users can configure other profiles, while the Codex harness reviews requests for additional or escalated permissions before running commands.
OpenAI says the sandbox adds a layer of protection but cannot prevent every harmful action. For example, a command could modify a locally installed package that later runs outside the sandbox. OpenAI says the sandbox therefore complements its training and alignment work.
Codex uses operating-system controls to enforce the profiles. On macOS it uses Apple’s Seatbelt mechanism; on Linux it combines bubblewrap, which creates an isolated filesystem view, with seccomp-bpf, which filters system calls. A network proxy can apply domain-based rules, allowing or denying requests according to the profile. The article also describes sandboxing support on Windows.
Enterprise administrators can use managed requirements to limit which permission profiles users may choose, while users can configure settings within those limits. The Codex CLI also provides a sandbox command for running commands under a configured profile outside an agent session.
Key terms explained
- sandbox
A sandbox is a secure environment that limits an application's access to system resources. It acts as a restricted space where programs can run without affecting the rest of the computer.
Think of it this way. It is like a playpen for a toddler, keeping them in a safe, contained area so they cannot wander off and touch things they should not.




