concepts/sandboxing.md +21 −15
126the composer or chat input. That selector lets you rely on Codex's default126the composer or chat input. That selector lets you rely on Codex's default
127permissions, switch to full access, or use your custom configuration.127permissions, switch to full access, or use your custom configuration.
128 128
129129<div class="not-prose max-w-[22rem] mr-auto mb-6"><PermissionModeSelectorDemo client:load />
130 <img src="https://developers.openai.com/images/codex/app/permissions-selector-light.webp"
131 alt="Codex app permissions selector showing Default permissions, Full access, and Custom (config.toml)"
132 class="block h-auto w-full mx-0!"
133 />
134</div>
135 130
136In the CLI, use [`/permissions`](https://developers.openai.com/codex/cli/slash-commands#update-permissions-with-permissions)131In the CLI, use [`/permissions`](https://developers.openai.com/codex/cli/slash-commands#update-permissions-with-permissions)
137to switch modes during a session.132to switch modes during a session.
142configuration. Codex stores those defaults in `config.toml`, its local settings137configuration. Codex stores those defaults in `config.toml`, its local settings
143file. [Config basics](https://developers.openai.com/codex/config-basic) explains how it works, and the138file. [Config basics](https://developers.openai.com/codex/config-basic) explains how it works, and the
144[Configuration reference](https://developers.openai.com/codex/config-reference) documents the exact keys for139[Configuration reference](https://developers.openai.com/codex/config-reference) documents the exact keys for
145140`sandbox_mode`, `approval_policy`, and`sandbox_mode`, `approval_policy`, `approvals_reviewer`, and
146`sandbox_workspace_write.writable_roots`. Use those settings to decide how much141`sandbox_workspace_write.writable_roots`. Use those settings to decide how much
147142autonomy Codex gets by default, which directories it can write to, and when itautonomy Codex gets by default, which directories it can write to, when it
148143should pause for approval.should pause for approval, and who reviews eligible approval requests.
149 144
150At a high level, the common sandbox modes are:145At a high level, the common sandbox modes are:
151 146
166 needs to go beyond that boundary.161 needs to go beyond that boundary.
167- `never`: Codex doesn't stop for approval prompts.162- `never`: Codex doesn't stop for approval prompts.
168 163
164When approvals are interactive, you can also choose who reviews them with
165`approvals_reviewer`:
166
167- `user`: approval prompts surface to the user. This is the default.
168- `auto_review`: eligible approval prompts go to a reviewer agent (see
169 [Auto-review](https://developers.openai.com/codex/concepts/sandboxing/auto-review)).
170
169Full access means using `sandbox_mode = "danger-full-access"` together with171Full access means using `sandbox_mode = "danger-full-access"` together with
170`approval_policy = "never"`. By contrast, the lower-risk local automation172`approval_policy = "never"`. By contrast, the lower-risk local automation
171preset is `sandbox_mode = "workspace-write"` together with173preset is `sandbox_mode = "workspace-write"` together with
172`approval_policy = "on-request"`, or the matching CLI flags174`approval_policy = "on-request"`, or the matching CLI flags
173175`--sandbox workspace-write --ask-for-approval on-request`.`--sandbox workspace-write --ask-for-approval on-request`. You can then keep
176`approvals_reviewer = "user"` for manual approvals or set
177`approvals_reviewer = "auto_review"` for automatic approval review.
174 178
175If you need Codex to work across more than one directory, writable roots let179If you need Codex to work across more than one directory, writable roots let
176you extend the places it can modify without removing the sandbox entirely. If180you extend the places it can modify without removing the sandbox entirely. If
193[Codex app features](https://developers.openai.com/codex/app/features#approvals-and-sandboxing), and for the197[Codex app features](https://developers.openai.com/codex/app/features#approvals-and-sandboxing), and for the
194IDE-specific settings entry points, see [Codex IDE extension settings](https://developers.openai.com/codex/ide/settings).198IDE-specific settings entry points, see [Codex IDE extension settings](https://developers.openai.com/codex/ide/settings).
195 199
196200Automatic review, when available, doesn't change the sandbox boundary. ItAutomatic review, when available, does not change the sandbox boundary. It is
197201reviews approval requests, such as sandbox escalations or network access, whileone possible `approvals_reviewer` for approval requests at that boundary, such
198202actions already allowed inside the sandbox run without extra review. Seeas sandbox escalations, blocked network access, or side-effecting tool calls
199203[Automatic approval reviews](https://developers.openai.com/codex/agent-approvals-security#automatic-approval-reviews)that still need approval. Actions already allowed inside the sandbox run
200204for the policy behavior.without extra review. For the reviewer lifecycle, trigger types, denial
205semantics, and configuration details, see
206[Auto-review](https://developers.openai.com/codex/concepts/sandboxing/auto-review).
201 207
202Platform details live in the platform-specific docs. For native Windows setup,208Platform details live in the platform-specific docs. For native Windows setup,
203behavior, and troubleshooting, see [Windows](https://developers.openai.com/codex/windows). For admin209behavior, and troubleshooting, see [Windows](https://developers.openai.com/codex/windows). For admin