🔍 Read the full analysis: Exploring The Codex Sandbox For AI 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 uses operating-system controls to restrict AI-run commands on macOS, Linux and Windows. Its default profile allows writes in a project workspace but disables network access; OpenAI says broad file reads and later execution of modified local tools remain risks.
OpenAI has published a technical account of the Codex sandbox, which restricts commands run by its AI coding agent on macOS, Linux and Windows, describing default limits on file changes and network access while warning that the controls cannot prevent every harmful effect. The design aims to let Codex work in a developer’s existing environment while reducing the chance of changes to protected files or direct uploads of accessible data.
OpenAI says Codex applies permission profiles that set filesystem and network access for a session. Under the built-in workspace profile described in the account, commands can write within the project workspace, while locations such as .git and .codex are read-only. This permits ordinary source edits without asking for approval for each change, while limiting direct modification of Git hooks and Codex configuration.
The same profile allows broad filesystem reads, subject to the computer’s own operating-system permissions. OpenAI says development tools may need access to libraries, software development kits and configuration files outside a repository. That flexibility can also leave sensitive local material, including files containing API keys, readable to a command. The default profile disables network access; OpenAI says this blocks direct uploads but can also prevent tasks such as downloading dependencies unless additional access is granted.
Rather than run commands in a separate virtual machine or container, Codex uses native operating-system sandboxing. OpenAI says this can preserve access to host tools, citing iOS development on a Mac, where builds and the iPhone simulator depend on Mac executables. A shared harness interface accepts a command and permission profile; when limited network access is enabled, the caller must provide a network proxy. The company also says child processes inherit their parent’s restrictions, including descendants that continue after the original process 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.
Permission Limits Shape Agent Autonomy
The sandbox’s permission choices affect how much work a coding agent can do without interrupting a user. Allowing writes in a project directory can support routine edits, while disabling network access removes one direct route for a command to send out files it can read. The tradeoff is that broad read access may expose local data, and denying network access can make some development tasks harder.
OpenAI says sandboxing is one layer of protection, alongside model training and alignment, rather than a guarantee against harmful outcomes. For developers and organizations, the account highlights a practical need to match permissions to a task and consider what local software might do after it has been changed. The source points to a security cookbook for enterprise guidance, but offers no incident rates or independent test results to show how often the described risks occur or how reliably the controls prevent them.
Products Worth Considering

Amazon Kindle Scribe (16GB) with Premium Pen, Tungsten

Logitech MX Mechanical Mini for Mac Wireless Keyboard, Space Gray

Jackery HomePower 3000 Portable Power Station, 3072Wh, 3600W
As an affiliate, we earn on qualifying purchases.
Why Codex Uses Host Sandboxing
OpenAI frames its design as a tradeoff between isolation and access to an established development setup. Containers and virtual machines can separate programs from the host, but reproducing a developer’s environment inside them can take work and may make host-specific tools unavailable. The company uses iOS development as an example: a container cannot directly run native Mac build tools or launch the iPhone simulator. Delegating those operations back to the Mac would put them outside the container and require separate restrictions.
OpenAI says it chose operating-system-specific controls behind a shared harness interface for the three desktop platforms. The supplied account introduces a one-shot shell tool, exec_command, but does not include the later step-by-step execution details. It also describes the profile’s intended permissions rather than providing comparative measurements against container-based approaches.
Coverage and Testing Remain Unclear
The supplied material does not state when OpenAI published the account or whether the described defaults apply to every Codex product and configuration. It does not spell out how users grant exceptions on each operating system, nor does it provide test results, incident rates or an independent evaluation of the controls.
OpenAI acknowledges that broad reads can expose sensitive files and that altered local tools may cause effects later, outside the original sandboxed process. The available account does not explain how Codex detects such changes, whether specific package directories can be restricted, or what protections address every form of indirect execution. Those points remain unresolved in the supplied source.
Further Platform Guidance Expected
OpenAI says its full account goes on to discuss how end users and enterprises can tailor permissions, how developers can reuse the sandbox, and how enforcement works across platforms. The supplied material does not give a publication schedule for those details or identify a next technical milestone.
For now, the described profile and caveats are the available basis for understanding the design. Further documentation or independent evaluations would be needed to clarify how exceptions are configured, how consistently restrictions hold in practice, and how users should manage the risk of local tools being changed and run later.
Key Questions
What does the Codex sandbox restrict?
OpenAI says permission profiles control filesystem and network access for commands run by Codex. The built-in workspace profile allows project-directory writes, keeps locations such as .git and .codex read-only, and disables network access by default.
Can Codex read files outside the project?
Under the profile described by OpenAI, commands can make broad filesystem reads, subject to the operating system’s permissions. The company says this can help development tools find external libraries and configuration, but may also leave sensitive files readable.
Does the sandbox prevent every harmful action?
No. OpenAI says it is one layer of protection. The company describes a risk in which a locally installed package is modified during a sandboxed task and later runs when another program invokes it.
Why does Codex use operating-system controls instead of a container?
OpenAI says host controls can preserve access to native development tools. It cites Mac-based iOS builds and the iPhone simulator as examples of workflows that may be difficult to run directly inside a separate container.
How well have the protections been tested?
The supplied source gives no test results, incident rates or independent assessment. It also leaves unclear whether the described defaults apply to every Codex configuration and how exceptions are granted on each platform.
Primary source: OpenAI · via ThorstenMeyerAI.com
