Field noteNov 20, 20266 min read1 source

Inside the Codex sandbox

In one minute

OpenAI’s Codex sandbox applies operating-system restrictions to commands in a developer’s existing environment, with permission profiles controlling filesystem and network access. Its practical significance is that teams can let a coding agent work in a real toolchain while limiting what commands and child processes can touch—and can reuse the same mechanism for their own tools.

What happened

OpenAI’s November 18, 2026 engineering article explains how the Codex harness runs commands under sandbox restrictions on macOS, Linux, and Windows. The sandbox is designed to constrain commands in the user’s existing environment rather than move computation into a separate container or virtual machine. OpenAI points to workflows such as iOS development, where native Mac tools and the iPhone simulator may be difficult to reproduce inside Docker.

Codex permission profiles specify filesystem and network rules for a session. The built-in :workspace profile permits writes within the workspace while keeping directories such as .git and .codex read-only. It allows broad filesystem reads subject to the user’s operating-system permissions, because compilers and build tools often depend on SDKs, libraries, and configuration outside a repository. Network access is disabled by default in this profile. OpenAI notes the tradeoff: broad reads can expose sensitive files elsewhere on the machine, while disabled networking can block legitimate dependency downloads.

The harness replaces ordinary process creation with a sandbox-aware command launcher. A permission profile is passed when a command starts, and child processes inherit its restrictions, including descendants that outlive the original process. A command can request additional permissions or ask to run outside the sandbox, but the harness evaluates the request against user preferences; Codex may prompt the user or route it to auto-review. Filesystem permissions can allow reads, writes, or deny access. Network access can be disabled, opened directly, or restricted through a proxy with domain rules. The article’s example allows *.openai.com and loopback addresses, denies evil.example, and sends unmatched domains for approval or blocks them.

Profiles can extend built-in profiles and be layered across user, project, and enterprise configuration. OpenAI’s example dev profile extends :workspace, grants write access to ~/build-cache, makes .devcontainer and .vscode read-only, and denies **/*.env and secrets under workspace roots. Administrators can also use managed requirements to constrain which profiles users may choose; the example sets :read-only as the default and disallows :danger-full-access.

The codex sandbox CLI can run arbitrary commands under a configured profile, outside an agent session, and the article demonstrates using it to test whether a profile blocks a write to .vscode/settings.json. OpenAI also shows how to wrap a stdio MCP server that otherwise starts without sandboxing. Its example limits writes to an npm cache and a data directory and disables network access, with the package pre-cached so it can run offline. The network proxy is shared across platforms; operating-system sandboxing blocks direct external connections when applications ignore proxy environment variables.

What the archive adds

New Runtime’s October 8, 2026 coverage described GitHub’s local Copilot sandboxing as a way to restrict the command execution context (earlier note). This OpenAI article is a new event in the same operational area, adding detailed Codex permission profiles, enterprise controls, and a reusable CLI. It also follows New Runtime’s October 24, 2026 coverage of reusable Codex cloud development environments (earlier note), but addresses command access on the local machine rather than remote environments.

Trend signal

This supports the shift toward runtime-enforced agent security: permission boundaries are applied to the processes an agent launches, not left to instructions in a prompt. OpenAI’s model—profiles, inherited process restrictions, and mediated network access—fits agent security moves to runtime boundaries. The article is a concrete implementation account, though it does not establish how often these controls prevent real-world incidents or how they perform across organizations.

Why now

OpenAI published a detailed account of sandboxing as Codex increasingly works inside developers’ existing environments. The article’s focus on command execution, enterprise policy, and the MCP-server example makes the boundaries around agent-enabled tools especially relevant to teams integrating local workflows.

Connections to other events

New Runtime’s earlier coverage of a Codex GitHub Actions prompt-injection issue described a route from an issue labeler to control of the package publishing pipeline (earlier note). That was a workflow compromise, while the sandbox article addresses restrictions on local command execution. Together, they illustrate distinct places where agent access needs explicit boundaries: the runtime on a developer’s machine and the credentials and authority exposed in automation pipelines.

Why it matters

A coding agent’s useful permissions are rarely all-or-nothing. It may need to edit source files, read installed libraries, invoke a compiler, and reach a small set of services, while having no reason to modify Git hooks, rewrite editor settings, or contact arbitrary hosts. Permission profiles make those distinctions configurable and reusable instead of relying on the model to infer safe behavior.

The most transferable idea is to define the boundary around the process tree and its external effects. If a command starts another process, that descendant should not quietly escape the original restrictions. If network access is needed, a proxy can enforce domain rules and mediate exceptions. For teams, managed requirements add a separate control: users can tailor profiles without being able to select a profile administrators have prohibited.

This is not a guarantee that every agent risk disappears. A sandbox reduces the impact of commands, while other controls remain necessary for code changes, credentials, and the tools that consume modified files. Still, the configuration examples give engineering teams an actionable starting point for making permission decisions explicit.

Limits and uncertainty

OpenAI describes the design and examples of its Codex sandbox, but the article does not report measurements of how often the restrictions block harmful commands, the rate of false denials, or the operational cost of maintaining profiles. The :workspace profile’s broad read access also means files outside a repository may remain accessible if the operating-system account can read them. OpenAI gives an example of malicious code being placed in an ignored local dependency and later run by an editor, illustrating that sandboxing command execution does not by itself prevent every downstream effect. The article’s mechanisms and examples are OpenAI’s account; their effectiveness in specific enterprise environments has not been independently established here.

Skill to build now

Choose one agent workflow that needs local command execution and write a permission profile for it this week. Start from the minimum workspace writes it needs; mark sensitive configuration files and editor settings read-only or denied. If it needs network access, enumerate allowed domains and decide how unmatched requests are approved. Test the profile with codex sandbox using both an intended operation and a blocked one, then document the remaining risks—especially tools that may later execute files the agent changed.

Reader takeaway

Give agents the permissions their workflow requires, not the full authority of the account running them. Codex’s profiles and sandbox CLI show how filesystem rules, network mediation, and inherited process restrictions can turn that principle into enforceable configuration.

Evidence / sources

  1. 1openai.com/index/inside-the-codex-sandbox
All Field Notes

Next reads

Read next

Open the graph
  1. 01topicCodexExplore the codex topic hub.
  2. 02archiveField NotesOpen the latest editorial analysis.
  3. 03sourcesSourcesSee the original sources this archive cites.
Who read this page?Machine requests, hidden until opened

Loading the privacy-safe route aggregate...

Open the JSON contract