OpenAI explains the Codex sandbox: permission profiles that limit files and network, and a codex sandbox command you can reuse in your own tools
OpenAI published a detailed look at the Codex sandbox, the mechanism that limits the commands the agent runs on a user's machine. Settings come from permission profiles that define which folders can be written to and which domains can be reached. The default :workspace profile allows writes inside the project folder, keeps .git and .codex read-only, and turns off network access. OpenAI notes this is not enough on its own: an agent could still, for example, plant malicious code in a local package under node_modules, so the sandbox is one layer among several. When the agent needs more access it asks for it, and the request goes to the user or to automatic review. Network requests to a domain that was not configured are held by a proxy until a decision is made. In organizations, admins can use a requirements.toml file to set which profiles employees may choose. The codex sandbox command runs the same mechanism outside Codex, for example to stop a local MCP server from reaching the network. On macOS the limits are enforced with Seatbelt, on Linux with bubblewrap and seccomp, and on Windows OpenAI is moving to Microsoft's MXC library.
Otomatzia editorial · Published
Source published: · OpenAI

