ToolNavs Find Useful AI Tools
Submit Sign in
Back to AI Q&A
What Is the OpenAI Codex Sandbox, and Which Permissions Are Safe to Change?

What Is the OpenAI Codex Sandbox, and Which Permissions Are Safe to Change?

AI Q&A • Admin • • 8 views

The OpenAI Codex sandbox is a fence drawn around the agent: it decides which files Codex may change and whether it can reach the network, not when it stops to ask you. In its November 2026 write-up of the Codex sandbox, OpenAI explained that the new sandbox no longer relies on containers and instead uses the operating system's native isolation mechanisms. By default, Codex may only read and write inside the current workspace, network access is off, and anything outside the boundary needs your approval first.

What Each of the Three Sandbox Modes Does

There are three modes. Read-only is the read-only mode: Codex can inspect files and plan, but cannot change anything, which makes it right for looking around before deciding. Workspace-write is the default: it can read and write files inside the current workspace and run local commands, making it the workhorse for everyday coding. Danger-full-access removes the fence entirely: neither the filesystem nor the network is restricted, so it belongs only in an isolated CI environment or a disposable container. You do not need to quit and restart to switch modes: type /permissions in the session to change it, or pass --sandbox when launching. --yolo turns off both the sandbox and approvals; OpenAI explicitly does not recommend it, so do not use it as a daily setup.

Approvals and Networking Are Two Separate Switches

The sandbox governs what is possible; approvals govern whether Codex asks you first. Configure them separately. Approval policies come in three forms: on-request, never, and a finer-grained granular table. The default Auto preset pairs workspace-write with on-request: Codex works directly inside the workspace and asks before writing outside it or using the network. Networking is off by default. For a task that needs it, enable network_access under [sandbox_workspace_write], ideally for that run only, and turn it off afterwards. To open just one or two extra directories, add them with writable_roots instead of widening the whole mode: it is the safer option. The official documentation also notes that directories such as .git and .codex stay read-only even inside a writable workspace.

A Default Setup for Beginners

For your first runs, stick with the default Auto preset: in ~/.codex/config.toml, set sandbox_mode = "workspace-write" and approval_policy = "on-request", and confirm networking stays off. Start in a repository with git, so a bad change can be rolled back. For an unfamiliar repository, switch to read-only and look around first, then widen write access once you are confident. For unattended runs such as CI, read-only paired with never is the most stable choice. For the full official explanation of the mechanism, see our OpenAI's deep dive into the Codex sandbox. If you also want to bring teammates into your coding work, see how to invite them in Cursor Projects multiplayer.

Recommended Tools

More