On November 18, 2026 OpenAI published “Inside the Codex sandbox”, an engineering post on how its Codex coding agent limits what commands it can run on your computer. OpenAI says Codex uses each operating system’s own sandboxing on your real environment rather than moving the work into a virtual machine or container, and calls the sandbox one layer of defence alongside model training.
What the default does
- Writes: allowed inside the workspace (for example your Git repo). OpenAI says
.gitand.codexstay read-only, which protects the Codex config and Git hooks. - Reads: broad, within your normal user permissions, because build tools need files outside the repo. OpenAI notes this means sensitive files elsewhere may still be readable.
- Network: off by default, which blocks uploads and package downloads.
- Asking for more: the model can request extra permissions for a single command, and Codex either asks you or sends the request to auto-review. Requests to domains that are not on your list can be paused the same way.
Permission profiles
OpenAI describes named permission profiles in the Codex config: default_permissions picks the active one, and [permissions.<name>] defines it, can extend the built-in :workspace profile, and sets read, write or deny on paths. Network access and per-domain allow and deny rules sit under the profile’s network table, and OpenAI says deny wins. Administrators can limit which profiles people may pick with allowed_permission_profiles in requirements.toml. Built-in profiles also include :read-only and :danger-full-access.
A new command, codex sandbox --permission-profile <name> -- <command>, runs any command under a profile, so you can test rules or sandbox your own tools. OpenAI’s example wraps a local MCP server with its network off and writes allowed only to its cache and data folders, and points out that the harness does not sandbox stdio MCP servers by default.
By platform
OpenAI says macOS uses Seatbelt, Linux uses bubblewrap plus seccomp filters, and on Windows Codex is moving to a new sandbox built on Microsoft’s MXC library, because the older design needed elevated setup.
What to do
OpenAI’s own advice: start from the default profile, add narrow rules only when needed, deny paths such as **/*.env, keep the network off unless a task needs it (and then allow named domains), and test a profile with codex sandbox before relying on it. Our agent permissions checklist turns this into a checklist for any agent, and the ChatGPT page lists OpenAI’s other recent updates, including GPT-6.2.
Source: OpenAI. We summarise in our own words; check the source for the full details.
Contribute your creativity