🔍 Read the full analysis: Inside The Codex Sandbox on ThorstenMeyerAI.com
Get business pricing on tech for your team
- Business-only prices and quantity discounts
- Tax-exempt purchasing
- Multiple users, one account, clear invoices
TL;DR
OpenAI has published a technical account of how the Codex sandbox restricts commands run in a developer’s existing environment on macOS, Linux and Windows. The company says workspace-write and disabled-network defaults can limit direct changes and uploads, but broad file reads and later execution of modified local tools remain risks.
OpenAI has published a technical account of how the Codex sandbox limits commands run by its coding agent on macOS, Linux and Windows, as detailed in the original analysis. The company says its permission profiles restrict file changes and default network access while allowing work in a developer’s existing environment, but warns that the controls do not block every route to harm.
Under the built-in workspace profile described by OpenAI, commands can write within a project workspace, while locations such as .git and .codex are read-only. That arrangement can let Codex edit source files without asking for approval for each change, while limiting direct changes to Git hooks and Codex configuration. The profile still permits broad file reads, subject to the operating system’s own permissions.
OpenAI says broad reads help support ordinary development: compilers and other build tools may depend on libraries, software development kits and configuration files outside the repository. But this means a command may also be able to read sensitive files elsewhere on the computer, potentially including configuration containing API keys. Network access is disabled by default in the profile, which the company says blocks direct uploads; downloading dependencies may require additional access.
Rather than putting commands in a separate virtual machine or container, Codex uses the host operating system’s sandbox facilities. OpenAI says this can preserve access to native tools, citing iOS development on a Mac, where builds and the iPhone simulator depend on Mac executables. A common harness API takes a command and a permission profile. If limited network access is allowed, the caller must provide a network proxy. OpenAI also says child processes inherit the parent’s restrictions, including processes that continue after the original command exits.
Inside the Codex sandbox
Codex limits what agent-run commands can change and where they can connect. The safeguards reduce risk while keeping work in a developer’s existing environment.
Workspace permissions
The built-in profile balances routine project work with limits on sensitive locations.
- Write files in the project workspace
- Read files broadly, subject to operating system permissions
- .git and .codex remain read-only
- Network access is disabled by default
Why use host controls?
Operating system sandboxing can keep native development tools available without recreating the setup in a container or virtual machine.
Native build tools
Mac controls can preserve access to tools used for iOS builds and the iPhone simulator.
One harness API
A common interface accepts a command and permission profile across macOS, Linux, and Windows.
What the boundary can miss
Restrictions on a command do not remove every risk from later actions on the computer.
Commands may be able to read local configuration, including files that contain API keys.
An agent could modify an installed package such as Prettier in node_modules.
An editor might run the altered package outside the original sandboxed command.
Balancing Autonomy and Local Risk
The design sets a practical boundary for how much work a coding agent can do without pausing for user approval. Workspace writes can make routine edits more fluid, and disabled networking removes a direct path for a command to send readable files to an external service. At the same time, broad read access means sandboxing does not necessarily keep private material outside a project beyond the command’s reach.
OpenAI describes the sandbox as one layer in a defense-in-depth approach, alongside model training and alignment, rather than as a guarantee that harmful effects are impossible. The distinction matters to developers and organizations deciding what permissions to grant: restrictions on a command’s immediate actions may not cover consequences triggered later by software it has changed. The source points to a security cookbook for enterprise guidance, but does not provide an independent evaluation or quantify how frequently these risks occur.
Products Worth Considering

Apple AirPods Pro (2nd Generation) Wireless Earbuds with MagSafe Charging Case (Lightning)

Bose QuietComfort Wireless Noise-Cancelling Headphones, Twilight Blue

DJI Mini 4K Drone with 4K UHD Camera
As an affiliate, we earn on qualifying purchases.
Why Codex Uses Host Controls
Containers and virtual machines are common ways to isolate software, but OpenAI says recreating a developer’s established setup in one can require extra work and can leave host-specific tools unavailable. Native Mac development tools illustrate the issue: an iOS workflow may need the Mac build system and simulator. A container could delegate those operations to the host, but the delegated commands would then run outside the container and require separate restrictions.
OpenAI says it instead built around operating-system-specific controls and exposed them through a shared harness interface for three desktop platforms. The source introduces a one-shot shell tool called exec_command, but the supplied account does not include its later step-by-step execution details. The description is about how Codex commands are constrained, not evidence that every possible harmful action is prevented.
Coverage and Safeguards Still Unclear
The supplied source does not state when the account was published or whether the defaults it describes apply to every Codex product or configuration. It also does not give platform-by-platform instructions for granting exceptions. No test results, incident rates or independent security assessment are provided, so the material does not establish how reliably the controls block attempted access outside a permitted profile.
OpenAI’s example highlights another gap: an agent could alter a locally installed package, such as a copy of Prettier in node_modules, which may be excluded from Git tracking. If an editor later runs that changed package when saving a file, it could execute code outside the original sandboxed command. The source does not explain whether Codex detects such changes, can restrict particular package directories, or how users should guard against every form of indirect execution.
Further Platform Guidance Expected
OpenAI says its full account goes on to discuss permission tailoring for users and enterprises, reuse of the sandbox by developers, and how enforcement works. Those details would help clarify how the described profiles can be adjusted across platforms and what additional controls are available. The supplied material does not identify a publication schedule or a specific next release, so no further milestone is confirmed.
For now, the available description supports a limited conclusion: Codex can run within operating-system restrictions intended to curb certain file changes and direct network transfers, while retaining access needed for local development. How those protections perform in practice, and how users should manage indirect risks from modified tools, remains unanswered in the material provided.
Key Questions
What does the Codex sandbox restrict?
OpenAI says permission profiles limit filesystem changes and network access. In the described workspace profile, commands can write in the project workspace, while .git and .codex remain read-only and network access is off by default.
Can Codex read files outside a project?
The profile permits broad filesystem reads, subject to operating-system permissions. OpenAI says this helps development tools find external libraries and configuration, but it can also leave sensitive local files readable to a command.
Does the sandbox block every harmful action?
No. OpenAI describes it as one layer of protection and gives the example of a locally installed package being modified and later run by an editor outside the original sandboxed process.
Why does Codex use operating-system controls instead of a container?
OpenAI says host controls can preserve access to native development tools. Its example is iOS development on a Mac, which relies on Mac build tools and the iPhone simulator that may not be available inside a separate container.
How effective are the protections in practice?
The supplied account gives no independent evaluation, test results or incident rates. It also does not explain every platform-specific exception or how Codex detects later execution of a modified local tool.
Primary source: OpenAI · via ThorstenMeyerAI.com
