OpenAI Codex sandbox modes and approval policy

What Codex may read, write and reach under each sandbox mode and approval policy, how the sandbox is enforced on macOS, Linux and Windows, and what full-access removes.

On this page

Does the OpenAI Codex sandbox meet our least-privilege requirement?

A security or platform lead deciding which Codex sandbox mode and approval policy staff may use needs to know that Codex enforces sandbox modes and approval policies in the open-source CLI and in cloud tasks for every plan that includes Codex, and that the agent runs with network access turned off by default. These controls are not one switch in a central console. They are set per workstation or per cloud environment, so least privilege is only as strong as the configuration each machine and environment actually carries. Start by choosing the mode and policy you want as the baseline, then confirm that members cannot widen it on their own machines.

The three sandbox modes are read-only, workspace-write and danger-full-access. Workspace-write is the mode that lets the agent edit files in the project, and even there the .git, .agents, .codex and .aws directories stay read-only, which matters because those paths hold repository history, agent configuration and cloud credentials. The sandbox mechanism differs by operating system: Seatbelt on macOS, bwrap with seccomp on Linux by default, and MXC on Windows, with WSL2 using the Linux implementation. Your test plan should cover each operating system in use, not one reference machine. The approval policies are on-request, never and granular, and the policy untrusted is no longer supported, so any older guidance that names it should be removed from your standard.

The gaps sit where the sandbox does not decide. Full-access mode (danger-full-access) removes the sandbox boundary, so it should be blocked for general staff and reserved for narrow, reviewed workflows. The optional network proxy uses allowlist-first domain rules in which deny always wins over allow, and it blocks local and private destinations by default, but it is optional, so confirm it is enabled and that the allowlist reflects approved hosts. In cloud tasks, the agent phase runs offline unless internet access is enabled for that environment, and environment secrets are removed before that phase. Ask OpenAI and your own administrators to confirm where each setting is enforced for your workspace, and record the answers in your rollout evidence.

Sandbox modes, approval policies and network controls by platform

This table compares what each Codex sandbox mode, approval policy and network control enforces, and which enforcement layer applies on macOS, Linux, Windows and WSL2. Read each row as a control you must confirm in your own environment, and note where the default is restrictive and where a setting or environment choice changes the outcome. The main takeaway is that the default posture is network off and a protected set of directories, while full access removes those limits.

ControlWhat it doesBuilt in or setting-dependent
Read-only sandbox modeAgent may read the workspace but cannot write files in itBuilt in; selected as a sandbox mode
Workspace-write sandbox modeAgent may write inside the workspace, while .git, .agents, .codex and .aws stay read-onlyBuilt in; selected as a sandbox mode
Danger-full-access sandbox modeRemoves sandbox restrictions on file and command access; confirm with OpenAI what remains enforcedSetting-dependent; must be chosen explicitly
Network access (default)Agent runs with network access turned offBuilt in default; changed by configuration
On-request approval policyAgent asks for approval before actions that fall outside its sandboxBuilt in; selected as an approval policy
Never approval policyAgent does not prompt for approval; confirm which actions it still blocks under each sandbox modeSetting-dependent; selected as an approval policy
Granular approval policyApproval is split by action category; confirm the categories and how they are setSetting-dependent; selected as an approval policy
Untrusted approval policyNo longer supported by CodexNot available; do not configure
Optional network proxyAllowlist-first domain rules where deny always wins over allow; blocks local and private destinations by defaultSetting-dependent; must be enabled and configured
Enforcement on macOSSeatbelt sandboxBuilt in
Enforcement on Linuxbwrap plus seccomp by defaultBuilt in; confirm host support
Enforcement on WindowsMXC sandboxBuilt in; confirm version support
Enforcement on WSL2Uses the Linux implementationBuilt in; inherits Linux controls
Codex cloud agent phaseRuns offline by default; environment secrets are removed before the agent phaseBuilt in default; internet access is set per environment

How the sandbox and approval policy decide what Codex can touch

Codex reach is decided by three layers that work together, and a reviewer should check each one separately. The sandbox mode sets the outer limit at the operating system level: read-only, workspace-write or danger-full-access. The approval policy (on-request, never or granular) decides when the agent must stop and ask a person before stepping outside that limit. The optional network proxy then governs which domains are reachable at all. By default the agent runs with network access turned off, so a reviewer should treat network reach as something an administrator adds deliberately, not something that is present unless removed.

The network proxy applies allowlist-first domain rules, and deny always wins over allow when a destination matches both. It also blocks local and private destinations by default, which limits what an injected or misdirected command could reach on the internal network. Confirm with the vendor documentation how the allowlist is set in a managed deployment, who can change it, and whether a member can override it locally. Also confirm whether the proxy is enabled on every surface your staff use, since the CLI, IDE extension and cloud tasks may be configured differently.

Even in workspace-write, the .git, .agents, .codex and .aws directories stay read-only, so the agent cannot quietly rewrite repository history, its own configuration or cloud credentials from inside the workspace. Cloud agent phases run offline by default unless internet access is enabled for that environment, and environment secrets are removed before the agent phase begins. For a rollout, the practical checks are: whether cloud internet access is on for any environment, which secrets are attached to those environments, and whether the approval policy in use still prompts people before anything leaves the sandbox.

Choosing a sandbox mode, approval policy and network posture

Sandbox mode, approval policy, network access and WSL2 handling interact, so a setting changed in one place alters what the agent can read, write and reach elsewhere. Each card below names one decision, what it changes for files and network, and the developer friction it adds. Confirm each choice against the current agent approvals and security page before you write it into a team standard.

Default sandbox mode per team

The three modes are read-only, workspace-write and danger-full-access. Workspace-write is the mode to test first for most teams, because it lets the agent edit the project while keeping the sandbox boundary in place. Read-only suits review or audit work, where the agent should inspect code without changing it. Even in workspace-write, the .git, .agents, .codex and .aws directories stay read-only, so ask teams whether any build step needs to write to those paths. Expect more prompts for tasks that touch files outside the project.

Agent approvals docs

On-request or granular approvals

The supported approval policies are on-request, never and granular. On-request keeps a human in the loop for actions outside the sandbox, which adds interruptions but keeps a decision point on each escalation. Never removes prompts entirely and should be limited to supervised, read-only or throwaway contexts. Granular lets admins decide which categories of request still need a person. Confirm with the vendor that the untrusted policy is not used in your rollout, because OpenAI documents it as no longer supported.

Network proxy and domain allowlist

The optional network proxy works allowlist-first, and deny always wins over allow. It also blocks local and private destinations by default. Network access is off by default, so every domain you add widens what the agent can reach, such as package registries or internal Git hosts. Start with a short list tied to a named build need, and review it when a team asks for another domain. Developers will see failed installs until the list covers their package sources, so agree on a request path before rollout.

Internet access for cloud task environments

The Codex cloud agent phase runs offline by default unless internet access is enabled for that environment. Environment secrets are removed before the agent phase begins. Enable internet access only for environments whose tasks need to fetch dependencies, and keep it off for environments that handle sensitive repositories. Ask whether the Enterprise workspace has cloud access enabled at all, because OpenAI documents that Codex cloud access is off by default for Enterprise workspaces that have not turned it on. Offline tasks may fail when a build needs a download, which is the main friction cost.

WSL2 developer handling

On Windows, the sandbox uses MXC, while WSL2 uses the Linux implementation, which relies on bwrap plus seccomp by default. Developers working in WSL2 therefore get the Linux sandbox behavior, not the Windows one, so a policy written for Windows hosts may not match what WSL2 users experience. Test each mode inside WSL2 before setting one policy for both platforms. Decide whether WSL2 developers should be held to the same mode and proxy rules, and document any difference in the team standard.

What danger-full-access removes and why it needs a separate approval

Danger-full-access removes the sandbox boundary entirely, so Codex can read, write and run commands across the machine it is launched on without the restrictions that read-only and workspace-write impose. Treat it as an exception path that a named person approves for a named task, never as a team default that staff select because a workspace-write session was blocked. The sandbox is the control that keeps the agent's file access and command execution inside a defined area, so once it is removed, the approval policy and the network setting are the only remaining checks, and those are the settings a reviewer should verify first.

Start with the machines. Ask which laptops, build servers and shared development hosts could be launched into danger-full-access, and whether any of them hold production credentials, SSH keys, cloud profiles or signing material that the agent could reach without a sandbox in front of it. Confirm with OpenAI which enforcement options exist to restrict the mode through managed configuration and admin settings, and whether a managed configuration can block the mode on specific devices or for specific groups. Do not assume the mode can be disabled centrally until OpenAI confirms that in writing for your plan and client versions. Record the answers in your approval file so the exception has an owner and a scope.

Then test how the mode interacts with the default that network access is off. The documented default is that the agent runs with network access turned off, and that default is the reason many routine tasks stay contained. Danger-full-access does not give you a separate network baseline to rely on, so the reviewer should confirm whether network access, the optional network proxy and its allowlist rules still apply when the mode is in use, and what happens to the cached or offline behavior on each platform. Write down the exact combination you approve, for example a named task with network off, and require a fresh review before anyone widens it, because a sandbox removed and a network opened at the same time is the highest-risk configuration in this model.

Gaps a reviewer should raise before approval

The sandbox and approval settings only limit what Codex can do if they are enabled, configured the same way on every machine, and backed by controls outside the tool. The gaps below are the places where a reviewer should ask for evidence before approving rollout, and each one names the control that usually covers what the agent's own settings do not.

Sandbox behavior differs by platform

The sandbox uses Seatbelt on macOS, bwrap plus seccomp on Linux by default, and MXC on Windows, and WSL2 uses the Linux implementation. A policy tested on one platform does not prove the same isolation on the others. Ask for a test matrix covering each operating system your staff use, and confirm how WSL2 sessions are handled in your endpoint standard. Compensating control: endpoint hardening baselines applied to every OS image.

Agent approvals and security

Sandbox does not replace code review

A sandbox limits where the agent can write and reach, but it does not judge whether the code it writes is correct or safe. Code produced inside workspace-write can still contain flaws, weak dependencies or changes that pass tests. Require human review and branch protection for agent-authored changes before merge. Compensating control: mandatory review gates and CI security scanning on every pull request.

Approval policy depends on configuration

On-request, never and granular approval policies only protect you if the setting is in force. A developer can change the approval mode in a local session, so the effective policy may differ from the one you approved. Ask which settings your administrators can enforce centrally and which members can still change, and verify the result on sample machines. Compensating control: managed configuration with periodic configuration audits.

Network proxy is optional

By default the agent runs with network access turned off, but the optional network proxy is what applies allowlist-first domain rules, where deny always wins over allow, and blocks local and private destinations. If the proxy is not enabled, the sandbox alone does not restrict outbound destinations as tightly. Confirm the proxy is enabled and test that a non-allowlisted domain is blocked. Compensating control: egress filtering at the network perimeter.

Cloud internet access is per environment

The Codex cloud agent phase runs offline by default unless internet access is enabled for that environment, and environment secrets are removed before the agent phase. Any environment that turns on internet access widens what a task can reach, so review each environment's setting rather than assuming the default applies everywhere. Compensating control: an approval step for environment changes and a register of which environments have internet access.

Bypass and config-file issues need patching

Sandbox bypass and code execution from repository configuration files are the categories of issue that published security advisories cover for Codex. A sandbox setting that is correct today can be weakened by a vulnerability you have not patched. Ask OpenAI for the advisory history, track the openai/codex security advisories, and set a patch window for the Codex CLI and IDE extension. Compensating control: a documented patch policy with version inventory across endpoints.

openai/codex on GitHub

How the sandbox answer changes by team and environment

On a macOS developer laptop, Codex enforces its sandbox with Seatbelt. The usual starting point for individual developers is workspace-write with network access off, which lets the agent edit the project it was opened in while keeping outbound connections closed. Reviewers should confirm the mode each developer actually runs, because local settings can differ from the baseline unless managed configuration sets them.

  • Sandbox mode: workspace-write with network access off, so the agent can change the repository but cannot fetch packages or reach outside hosts until a developer enables access.
  • Protected paths: .git, .agents, .codex and .aws stay read-only even in workspace-write, so confirm that no other credential files sit inside the project where the agent could read them.
  • Approval policy: on-request keeps the developer in the loop for actions outside the sandbox. Check the value in the local configuration file, and also ask the developer which policy they see.
  • Full access: danger-full-access should be excluded for laptops that hold customer or regulated data.

Record the sandbox mode, approval policy, network setting and macOS version for each laptop group in the rollout file, then re-check after any configuration change.

Order of work to put Codex sandboxing into production

This sequence moves Codex from a pilot to a governed rollout by confirming what the plan includes, fixing the sandbox and approval defaults, and testing each operating system before any exception is allowed. The output is a documented baseline that security and IT can audit and maintain.

  1. Confirm the plan and edition that include the features

    The platform or procurement owner checks which ChatGPT plan and workspace settings apply to each group of users, using OpenAI's help article on Codex with a ChatGPT plan. Codex is included across all ChatGPT plans, but Codex cloud is limited to eligible Plus, Pro, Business, Enterprise, Healthcare and Education accounts, and Enterprise workspaces must enable cloud access because it is off by default. Done means a written list of which users run local sandboxed sessions, which use cloud tasks, and who approved each.

  2. Set the default sandbox mode and approval policy

    The security lead selects a default for read-only, workspace-write or danger-full-access and an approval policy from on-request, never or granular, using the agent approvals and security page. Confirm that the untrusted approval policy is no longer supported, so any older configuration still using it must be changed. Done means a reviewed baseline configuration with the chosen values recorded and a note of which settings members can still change.

  3. Decide the network proxy posture and domain allowlist

    The network and security teams decide whether the optional network proxy is used and which domains it may reach. The documented model is allowlist-first, deny always wins over allow, and local and private destinations are blocked by default, so the allowlist should contain only the endpoints that developers need. Confirm with the vendor how network access behaves in local sessions and in cloud environments, where the agent phase runs offline unless internet access is enabled for that environment. Done means an approved domain list with an owner and a review date for each entry.

  4. Test the boundaries on a pilot machine for each OS

    Engineers run the same test script on a pilot machine for each operating system in use, covering macOS with Seatbelt, Linux with bwrap and seccomp by default, Windows with MXC, and WSL2 under the Linux implementation. Each test attempts a file write outside the workspace, a network call to an unlisted domain, a call to a local or private address, and a command that the approval policy should stop. Done means a signed test record per OS showing each attempt was allowed or blocked as the documented configuration predicts, with any mismatch escalated to OpenAI before rollout.

  5. Verify protected directories remain read-only

    The security engineer confirms that .git, .agents, .codex and .aws stay read-only even when the mode is workspace-write, using a test repository that contains a dummy credential file under .aws. The same check runs after any change to the default mode or to a team's configuration, because a single mismatch changes what an injected or mistaken command can alter. Done means the test log shows writes to each protected path failing, and the result is attached to the baseline record.

  6. Document the full-access exception process

    The CISO or IT lead writes the approval path for danger-full-access, naming who may request it, the business reason, the machine and repository it applies to, the approver, and the date it expires. The process should state that full access removes the sandbox and its protections for the session, so it is reserved for controlled cases that the team has reviewed. Done means a signed procedure, an exception register, and a check that managed configuration does not grant full access to users by default.

  7. Set a patch cadence tied to published advisories

    The platform owner subscribes to the security advisories published in the openai/codex repository and maps each advisory to the affected and fixed CLI and IDE extension versions. The owner sets an internal cadence for applying fixes, records which version each machine runs, and checks the sandbox tests again after each upgrade. Done means a named owner, a version inventory, and a record showing that the most recent advisory was assessed and closed on every machine in scope.

How sandbox, approvals and network proxy gate a Codex action

The diagram starts with a Codex action, such as a shell command or a file write, and checks it against the sandbox mode first (read-only, workspace-write or danger-full-access), which sets filesystem and network reach. The approval policy then decides whether the action runs silently or is prompted for review. Any network request passes through the optional network proxy, where allowlist rules apply, deny always wins over allow, and local and private destinations are blocked by default. Check that each path ends in a documented outcome you have tested in your own environment.

Decision path for a Codex action through sandbox, approval and proxy checks.

What a security reviewer asks to see for the sandbox control

This table lists the evidence a reviewer should collect for the Codex sandbox, approval and network controls, and where each item comes from in the tool or the admin documentation. Use it as a checklist for the configuration record and the exception file, and treat any row where the answer is not written down as an open finding.

Evidence itemWhat to recordWhere it comes from
Default sandbox modeThe mode each group runs under: read-only, workspace-write or danger-full-access, plus the approved list of teams allowed any changeCodex agent approvals and security page, and the configuration file the team deploys
Approval policy in useThe active policy among on-request, never and granular, with a note that untrusted is no longer supportedCodex agent approvals and security page, and the managed configuration in force on each machine
Network access stateWhether network access is off by default and which environments, if any, have it enabledCodex agent approvals and security page, and the environment settings in the Codex cloud admin view
Network proxy rulesThe allowlist, the deny entries (deny always wins over allow), and confirmation that local and private destinations stay blockedOptional network proxy section of the Codex agent approvals and security page, and the proxy configuration file
OS-specific enforcementFor each operating system in use, the sandbox mechanism and a test result showing writes and network calls are blocked where expectedSeatbelt on macOS, bwrap with seccomp on Linux, MXC on Windows, and WSL2 under the Linux implementation, per the agent approvals page; the test results come from your own pilot
Protected directoriesConfirmation that .git, .agents, .codex and .aws stay read-only in workspace-write, plus any additional paths the team has protectedCodex agent approvals and security page, verified by a write attempt during the pilot
Full-access exception recordWho approved danger-full-access, for which repositories, the reason, the review date and the compensating controlsYour change and exception register, with the mode set in the local configuration on those machines
Cloud environment secrets and offline stateWhether cloud environments run offline, whether internet access is enabled for each one, and proof that secrets are removed before the agent phaseCodex agent approvals and security page, and the Codex cloud environment settings
Advisory monitoring recordDated log of Codex security advisories reviewed, the affected and fixed versions, and the patch decision for each installed clientSecurity advisories section of the openai/codex GitHub repository, and your software inventory

Questions buyers ask before approving Codex sandboxing

Is the Codex sandbox included on every ChatGPT plan?

The sandbox is part of the Codex agent itself, and OpenAI's help article states that Codex is included across all ChatGPT plans, including Free and Go. Plan coverage matters less than where the agent runs: Codex cloud is limited to eligible Plus, all Pro tiers, Business, Enterprise, Healthcare and Education accounts, and Enterprise workspaces must enable cloud access, which is off by default. Confirm with your OpenAI account team which plan and workspace settings apply to your users, then check the sandbox behavior for each surface (CLI, IDE extension, app and cloud tasks) on the Codex agent approvals and security page. Ask for the enforcement details in writing rather than assuming they match across surfaces.

What makes configuring the Codex sandbox take longer?

The effort is driven by how many sandbox modes, approval policies and environments your teams need, and how many repositories and toolchains they touch. The main decisions are which mode each group uses (read-only, workspace-write or danger-full-access), which approval policy applies (on-request, never or granular), whether network access is needed for package installs or internal services, and which domains belong on an allowlist. Engineers with complex build pipelines, private registries or many developer machines will need more testing time than a team working in one repository. Your internal change process, approval chains and the need to document decisions for auditors also add time. Ask any implementation partner to list these decisions in the written scope before work starts.

Can our own engineers configure Codex sandboxing without outside help?

Yes, the sandbox modes and approval policies are documented by OpenAI, and a team with strong platform and security skills can work from the official pages. The harder part is validation: confirming that workspace-write blocks the writes you expect, that the network proxy denies the destinations you intend to block, and that protected directories such as .git, .agents, .codex and .aws stay read-only on each operating system your staff use. Teams without test environments or time to rerun these checks often choose outside help for the validation and documentation, which is typically scoped as a fixed engagement. Whatever route you take, record the tested settings so a reviewer can reproduce them.

Does network access being off by default block normal development work?

It can, which is why the default needs a planned exception rather than a blanket change. By default the agent runs with network access turned off, so commands that fetch dependencies, call APIs or pull container images will fail unless you enable access. The optional network proxy supports allowlist-first domain rules, where deny always wins over allow, and it blocks local and private destinations by default. A practical approach is to list the package registries and internal hosts your builds need, test a representative set of tasks, and keep everything else closed. In cloud tasks, the agent phase runs offline unless internet access is enabled for that environment, and environment secrets are removed before the agent phase. Review each allowlisted domain as a data path, not only as a convenience.

How should WSL2 users be handled under the Codex sandbox?

WSL2 users are covered by the Linux implementation, so your Windows policy needs a separate check for those developers. The Codex agent approvals and security page states that the sandbox uses Seatbelt on macOS, bwrap plus seccomp on Linux by default, and MXC on Windows, with WSL2 using the Linux implementation. Windows developers working natively and those working inside WSL2 may therefore see different enforcement, file system boundaries and network behavior. Confirm which configuration each group runs, test writes to a Windows-mounted path from inside WSL2, and include WSL2 in your validation plan. Ask OpenAI to confirm any differences in writing before you approve a mixed Windows fleet.

Is sandboxing alone enough to approve Codex for our teams?

No. The sandbox limits what a command can read, write and reach, but it does not decide whether the agent should work on a given task or which content it trusts. Prompt injection can still steer the agent through repository files, web content or configuration, so you also need controls such as network off, protected paths, approval policies that stop risky actions, and limits on which repositories an agent can open. Full-access mode removes the sandbox boundary entirely, so restrict it to tightly controlled environments. Patching also matters, because published Codex vulnerabilities have involved sandbox behavior, so your review should include the advisories page and a version policy. Treat the sandbox as one control in a documented set, and ask the vendor to confirm how each control behaves in your configuration.

How DeployOpen tests and governs a Codex sandbox rollout

DeployOpen approaches OpenAI Codex sandbox modes and approval policy as a written, fixed-scope engagement inside your own environment. We map which sandbox mode and approval policy each team needs, test what the agent can read, write and reach, and hand over documented settings your reviewers can check. Ongoing support is available as a retainer.

How we scope

  • Agree in writing which Codex surfaces, teams and repositories the sandbox and approval review covers
  • Record the sandbox mode and approval policy each team is expected to run under
  • List the directories, network destinations and tools the agent may reach in each environment
  • Confirm the platforms in scope, including macOS, Linux, Windows and WSL2 hosts

How we build

  • Configure sandbox and approval settings in a test environment that mirrors your developer machines
  • Test whether protected paths such as .git, .agents, .codex and .aws stay read-only in workspace-write
  • Check that network access stays off by default and that allowlist and deny rules behave as documented
  • Run prompt-based tests to confirm approvals trigger before the agent runs commands outside its scope

How we hand over

  • Deliver a written record of tested sandbox modes, approval policies and observed results
  • Document the full-access mode removal conditions and which teams must never run under it
  • Provide a patching and version-check procedure tied to the Codex releases your team runs
  • Walk your security and engineering leads through the findings and open items before sign-off

How we support

  • Offer ongoing support as a retainer for changes to sandbox settings and approval policies
  • Re-test after Codex upgrades, new platform builds or changes to your network proxy rules
  • Review published OpenAI Codex security advisories against your deployed versions and document the response
  • Confirm with OpenAI any sandbox behavior your reviewers cannot verify in your environment

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.