🔍 Read the full analysis: The Codex Sandbox: A Workspace For AI on ThorstenMeyerAI.com
Get the latest gadgets delivered free with Prime
- Fast, free delivery on millions of items
- Prime Video, Amazon Music and more included
- Member-only deals all year
TL;DR
OpenAI has published a technical account of how Codex uses operating-system sandbox controls to limit the files and network access available to commands run by its coding agent. The company says the protections can reduce direct data exposure but do not eliminate risks, including malicious changes to locally installed tools.
OpenAI has published a technical account of the Codex sandbox, explaining how it limits the files and network access available to commands run by its AI coding agent on macOS, Linux and Windows. The controls are intended to reduce risks such as unauthorized file changes and direct data uploads, but OpenAI cautions that they do not prevent every harmful action, including changes to locally installed tools that may run later.
OpenAI says Codex applies permission profiles that define a session’s filesystem and network access. In the built-in workspace profile described in the source, commands can write in the project workspace, while locations such as .git and .codex are read-only. That arrangement can let the agent edit source code without asking for approval for every change, while limiting direct changes to Git hooks and Codex configuration.
The same profile allows broad filesystem reads, subject to the operating system’s permissions. OpenAI says this can support ordinary development because build tools may need access to libraries, software development kits and configuration files outside a repository. But those reads may also expose sensitive local files, including configuration that contains API keys. The default profile disables network access, which OpenAI says blocks direct uploads but can also prevent tasks such as downloading dependencies unless access is granted.
Instead of running commands in a separate virtual machine or container, Codex uses native operating-system sandboxing to constrain processes in the host environment. OpenAI says this can preserve access to native tools, citing Mac-based iOS development, which depends on Mac executables for builds and the iPhone simulator. The company describes a common harness interface for commands and permission profiles; limited network access requires a caller-provided proxy. It also says child processes inherit the 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.
How the Controls Shape Coding Access
The design addresses a central tradeoff for AI coding agents: how much work they can do without repeated user approval, and how much access they should receive to complete it. Workspace write access supports routine edits, while disabled networking restricts one direct path for sending readable files to external services. Broad read access, however, means a command may be able to inspect material outside the project folder.
For developers and organizations, the practical implication is that sandboxing is a layer of risk reduction, not a guarantee that a task or its later effects are safe. OpenAI says it presents these controls alongside model training and alignment as part of a defense-in-depth approach. The source points to separate enterprise security guidance, but provides no quantified risk estimates or independent evaluation results. Teams therefore still need to consider what files a profile exposes and how software changes may be executed later.
Products Worth Considering

LG UltraGear 34G600A-B 34-Inch Curved WQHD Gaming Monitor

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

Samsung Galaxy Tab A11+ Kids Edition, 128GB, Royal Blue
As an affiliate, we earn on qualifying purchases.
Why Codex Uses Host Sandboxes
OpenAI frames its approach as a way to balance isolation with access to a developer’s established environment. Containers and virtual machines can separate programs from the host, but reproducing a full development setup in them may take work and may not provide access to host-specific tools. The company’s example is iOS development on a Mac: native build tools and the iPhone simulator depend on Mac executables.
A container-based workflow could delegate such operations back to the host, OpenAI says, but those delegated actions would then run outside the container and require their own restrictions. The company says it chose instead to use operating-system-specific controls behind one harness interface for three desktop platforms. The supplied material introduces a one-shot shell tool called exec_command, but does not provide the full execution walkthrough or platform-by-platform enforcement details.
Limits the Source Does Not Resolve
The supplied material does not give a publication date or specify whether the described defaults apply to every Codex product or configuration. It also does not explain how users grant exceptions on each operating system or provide test results, incident rates or independent assessments of the controls.
OpenAI acknowledges that broad reads can expose sensitive local files and that a modified tool may cause effects later. The source does not explain whether Codex detects changes to locally installed packages, whether the harness can restrict particular package directories, or what safeguards address every form of indirect execution. The frequency and likelihood of the risks described are also not quantified.
Further Permission and Platform Guidance
OpenAI says its full technical article covers how end users and enterprises can tailor permissions, how developers can reuse the sandbox, and how enforcement works. Those details would help clarify what controls are available in practice and how they differ across macOS, Linux and Windows.
For now, the described approach gives users a framework for understanding the permissions behind Codex commands, but the source leaves open questions about exceptions and indirect risks. The next useful information would include the platform-specific procedures, the scope of defaults across Codex configurations, and evidence from testing or independent review. No publication schedule or additional milestone is stated in the supplied material.
Key Questions
What does the Codex sandbox restrict?
OpenAI says permission profiles govern filesystem and network access for commands. In the built-in workspace profile described, commands can write in the project workspace, while .git and .codex are read-only, and network access is disabled by default.
Can Codex read files outside a project?
The profile described permits broad reads, subject to the operating system’s permissions. OpenAI says tools may need files outside a repository, but this can also leave sensitive local material, including API-key configuration, readable to a command.
Does the sandbox prevent all harmful actions?
No. OpenAI says sandboxing is one layer of protection. It describes a risk in which a command modifies a locally installed package that is later run by an editor, potentially causing effects outside the original sandboxed process.
Why does Codex use operating-system controls instead of a container?
OpenAI says native sandboxing can preserve access to tools already installed on a developer’s computer. Its example is iOS work on a Mac, where builds and the iPhone simulator rely on Mac executables.
What details about the sandbox remain unknown?
The supplied source does not state whether the defaults apply to every Codex configuration, how exceptions work on each platform, or how reliably the controls stop attempts to exceed permissions. It also offers no independent evaluation or risk-frequency data.
Primary source: OpenAI · via ThorstenMeyerAI.com
