OpenAI published “Inside the Codex sandbox” on November 18, 2026, by Michael Bolin. It explains how the Codex harness runs shell commands on a user’s computer within limits the user sets through permission profiles, which define the filesystem and network restrictions for a session. The example profiles: a photo-organizing task could allow changes in ~/Pictures while blocking network access, and a code review could allow online documentation while keeping source files read-only.
The built-in :workspace profile, for a workspace in a Git repository, allows writes in the workspace while keeping directories such as .git and .codex read-only, so Codex cannot directly change its config or Git hooks. It allows broad filesystem reads subject to the user’s OS permissions, a trade-off OpenAI acknowledges can leave sensitive files such as config files with API keys readable, and it disables network access, which blocks uploads but also dependency downloads. The post is candid that harmful actions are still possible: an agent could, for example, modify a locally installed package in an ignored node_modules folder and have the user’s editor run it later outside the sandbox. OpenAI therefore describes the sandbox as one layer of defense in depth alongside training and alignment.
Instead of virtual machines or containers, Codex uses each platform’s own sandboxing facilities to constrain commands in the user’s existing environment, exposed through one API across macOS, Windows and Linux that takes a command, a permission profile and, if limited network access is allowed, a network proxy; child processes inherit the restrictions. The post also covers how users and enterprises can tailor permissions and how developers can reuse the sandbox in their own tools.
Source: OpenAI.