2 2
3> For the complete documentation index, see [llms.txt](https://learn.chatgpt.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.3> For the complete documentation index, see [llms.txt](https://learn.chatgpt.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.
4 4
5Auto-review replaces manual approval at the sandbox boundary with a separate5Auto-review sends eligible approval requests to a separate reviewer agent.
6reviewer agent. The main Codex agent still runs inside the same sandbox, with6Your sandbox, command rules, and tool settings determine which actions need
7the same approval policy and the same network and filesystem limits. The7approval. The reviewer decides whether those actions can proceed.
8difference is who reviews eligible escalation requests.
9 8
10Auto-review only applies when approvals are interactive. In practice, that9Auto-review only applies when approvals are interactive. In practice, that
11 means `approval_policy = "on-request"` or a granular approval policy that10 means `approval_policy = "on-request"` or a granular approval policy that
25[reviewer-policy configuration](#configuration). The warning doesn't restore24[reviewer-policy configuration](#configuration). The warning doesn't restore
26the sandbox boundary or override organization policy.25the sandbox boundary or override organization policy.
27 26
28## Select automatic review27
28
29
30## Select Auto-review
29 31
30In the desktop app, choose **Approve for me** from the permissions control32In the desktop app, choose **Approve for me** from the permissions control
31below the composer. Check that it's selected for the current chat. See33below the composer. Check that it's selected for the current chat. See
34For the CLI or a local Codex configuration, set36For the CLI or a local Codex configuration, set
35`approvals_reviewer = "auto_review"` with an eligible interactive approval37`approvals_reviewer = "auto_review"` with an eligible interactive approval
36policy, such as `approval_policy = "on-request"`. Changing the approval policy38policy, such as `approval_policy = "on-request"`. Changing the approval policy
37alone doesn't select the reviewer. Managed requirements take precedence over39alone doesn't select the reviewer. Administrators can
38local settings; see [Managed configuration](https://learn.chatgpt.com/docs/enterprise/managed-configuration#configure-automatic-review-policy).40[require Auto-review](https://learn.chatgpt.com/docs/enterprise/managed-configuration#configure-auto-review-policy)
41for their organization.
39 42
40## How auto-review works43## How Auto-review works
41 44
42At a high level, the flow is:451. The main agent proposes an action, such as running a command.
43 462. If the action needs approval, Codex creates a request.
441. The main agent works inside `read-only` or `workspace-write`.
452. When it needs to cross the sandbox boundary, it requests approval.
463. If `approvals_reviewer = "auto_review"`, Codex routes that approval request473. If `approvals_reviewer = "auto_review"`, Codex routes that approval request
47 to a separate reviewer agent instead of stopping for a person.48 to a separate reviewer agent instead of stopping for a person.
484. The reviewer decides whether the action should run and returns a rationale.494. The reviewer decides whether the action should run and returns a rationale.
50 agent is instructed to find a materially safer path or stop and ask the51 agent is instructed to find a materially safer path or stop and ask the
51 user.52 user.
52 53
53Auto-review is a reviewer swap, not a permission grant. It does not expand
54`writable_roots`, enable network access, or weaken protected paths. It only
55changes how Codex handles actions that already need approval.
56
57## When it triggers54## When it triggers
58 55
59Auto-review evaluates approval requests that would otherwise pause for a human.56Auto-review evaluates approval requests that would otherwise pause for a human.
60These include:57These include:
61 58
62- Shell or exec tool calls that request escalated sandbox permissions.59- Shell or exec tool calls that request escalated sandbox permissions.
63- Network requests blocked by the current sandbox or policy.60- Commands that match a [command rule](https://learn.chatgpt.com/docs/agent-configuration/rules) with
61 `decision = "prompt"`, including commands inside the sandbox.
62- Network requests to destinations that require approval. An explicit network
63 deny rule blocks the request.
64- File edits outside the allowed writable roots.64- File edits outside the allowed writable roots.
65- MCP or app tool calls that require approval based on their tool annotations65- MCP or app tool calls that require approval based on their tool annotations
66 or configured approval mode.66 or configured approval mode.
67 67
68Auto-review does not run for routine actions already allowed inside the68Actions that already have permission to run proceed without review.
69sandbox. If a command can run under the active `sandbox_mode`, or a tool call
70stays within the allowed policy, the main agent continues without review.
71 69
72Computer Use is a separate case. App approvals for Computer Use still surface70Computer Use app-level access prompts go directly to the user. Eligible
73directly to the user, so Auto-review does not replace those app-level prompts.71Computer Use tool calls can separately trigger Auto-review.
74 72
75## What auto-review blocks73## What Auto-review blocks
76 74
77At a high level, Auto-review is designed to block actions such as:75At a high level, Auto-review is designed to block actions such as:
78 76
81- broad or persistent security weakening79- broad or persistent security weakening
82- destructive actions with significant risk of irreversible damage80- destructive actions with significant risk of irreversible damage
83 81
84The exact policy lives in the open-source Codex repository:82See [Configuration](#configuration) for the default rules and how to customize them.
85[policy_template.md](https://github.com/openai/codex/blob/main/codex-rs/prompts/templates/guardian/policy_template.md)
86and
87[policy.md](https://github.com/openai/codex/blob/main/codex-rs/prompts/templates/guardian/policy.md).
88That policy can be customized per enterprise with `guardian_policy_config` or
89per user with local [`[auto_review].policy`](/codex/config-file/config-advanced#approval-policies-and-sandbox-modes).
90 83
91## What the reviewer sees84## What the reviewer sees
92 85
93The reviewer is itself a Codex agent with a narrower job than the main agent:86The reviewer evaluates the specific action that triggered the approval request.
94decide whether a specific boundary-crossing action should run.
95 87
96The reviewer sees a compact transcript plus the exact approval request. That88The reviewer sees a compact transcript plus the exact approval request. That
97typically includes user messages, surfaced assistant updates, relevant tool89typically includes user messages, surfaced assistant updates, relevant tool
98calls and tool outputs, and the action now being proposed for approval. It can90calls and tool outputs, and the action now being proposed for approval. It can
99also perform read-only checks to gather missing context, but it does so rarely.91also perform read-only checks, such as inspecting a directory before approving
92its deletion.
100 93
101Hidden assistant reasoning is not included. Auto-review sees retained94Hidden assistant reasoning is not included. Auto-review sees retained
102chat items and tool evidence, not private chain-of-thought.95chat items and tool evidence, not private chain-of-thought.
111- Continue only with a materially safer alternative.104- Continue only with a materially safer alternative.
112- Otherwise, stop and ask the user.105- Otherwise, stop and ask the user.
113 106
114Codex also applies a rejection circuit breaker per turn. In the current107For most models, the Codex CLI interrupts the turn after 3 consecutive denials
115open-source implementation, Auto-review interrupts the turn after `3`108or 10 denials in the last 50 reviews in that turn. For models designated for
116consecutive denials or `10` denials within a rolling window of the last `50`109cybersecurity, the CLI interrupts the turn on the first denial.
117reviews in the same turn.
118 110
119Any non-denial resets the consecutive-denial counter. When the breaker trips,111Any other review outcome resets the consecutive-denial count. When Codex
120Codex emits a warning and aborts the current turn with an interrupt rather than112reaches a denial limit, it displays a warning and stops the turn.
121letting the agent loop on more escalation attempts.
122 113
123Timeouts are surfaced separately from explicit denials, and the main agent is114Timeouts are surfaced separately from explicit denials, and the main agent is
124informed that a timeout alone is not proof that the action is unsafe.115informed that a timeout alone is not proof that the action is unsafe.
136 127
137## Configuration128## Configuration
138 129
139For setup details, see130The [reviewer template](https://github.com/openai/codex/blob/rust-v0.167.0/codex-rs/prompts/templates/guardian/policy_template.md)
140[Managed configuration](https://learn.chatgpt.com/docs/enterprise/managed-configuration#configure-automatic-review-policy).131tells the reviewer how to assess an action. Codex inserts the security policy
132into that template and specifies the response format separately. The CLI uses
133the reviewer model's default policy when available. Otherwise, it uses the
134[bundled policy (`policy.md`)](https://github.com/openai/codex/blob/rust-v0.167.0/codex-rs/prompts/templates/guardian/policy.md).
141 135
142The default reviewer policy is in the open-source Codex repository:136**To add rules**, set `extra_policy` under `[auto_review]` in local
143[prompts/templates/guardian/policy.md](https://github.com/openai/codex/blob/main/codex-rs/prompts/templates/guardian/policy.md).137`config.toml`, or set the top-level `guardian_extra_policy` in managed
144Enterprises can replace its tenant-specific section with138`requirements.toml`. Codex applies these rules alongside the active policy.
145`guardian_policy_config` in managed requirements. Individual users can also set
146a local
147[`[auto_review].policy`](/codex/config-file/config-advanced#approval-policies-and-sandbox-modes)
148in their `config.toml`, but managed requirements take precedence:
149 139
150```toml140**To replace the policy**, copy the complete policy you want to adapt. If you
151[auto_review]141use the bundled default, copy the full contents of `policy.md`. Edit the rules
152policy = """142you want to change, then put the full text in local `[auto_review].policy` or
153YOUR POLICY GOES HERE143managed `guardian_policy_config`. Omitted rules drop out of the replacement.
154"""144Codex still uses the reviewer's template and response format.
155```145
146Codex resolves the two settings independently and ignores blank values.
147Managed `guardian_policy_config` takes precedence over local `[auto_review].policy`.
148Managed `guardian_extra_policy` takes precedence over local `[auto_review].extra_policy`.
149For example, if your organization sets only a replacement policy, your local
150`extra_policy` still adds rules to it.
156 151
157To customize the policy, copy the whole default policy wording first, then152For organization-wide setup, see
158iterate based on your individual risk profile.153[Configure Auto-review policy](https://learn.chatgpt.com/docs/enterprise/managed-configuration#configure-auto-review-policy).
159 154
160## Configure an authorized cybersecurity engagement155## Configure an authorized cybersecurity engagement
161 156
162For authorized security work, combine automatic review with a written157For authorized security work, combine Auto-review with a written
163engagement scope and a least-privilege [permission profile](https://learn.chatgpt.com/docs/permissions).158engagement scope and a least-privilege [permission profile](https://learn.chatgpt.com/docs/permissions).
164Use an approved lab target, document the actions and engagement window, and159Use an approved lab target, document the actions and engagement window, and
165keep production systems, unrelated hosts, credentials, and persistent changes160keep production systems, unrelated hosts, credentials, and persistent changes
166out of scope unless explicitly authorized.161out of scope unless explicitly authorized.
167 162
168Both `[auto_review].policy` and `guardian_policy_config` replace your current163This local `config.toml` example enables Auto-review and adds engagement
169reviewer policy. They don't merge with policies bundled with your model or164rules to the active policy. Replace the example target and actions with your
170managed by your organization. The built-in review instructions and response165approved scope.
171format still apply. Before using either example, copy the complete current
172policy, keep every existing rule, and add the rules for your approved work.
173Replace the uppercase placeholder with that complete policy. If you can't
174access the current policy, don't override it.
175
176The following local `config.toml` template enables review and adds scoped
177conditions after the existing reviewer policy:
178 166
179```toml167```toml
180approval_policy = "on-request"168approval_policy = "on-request"
182default_permissions = ":workspace"170default_permissions = ":workspace"
183 171
184[auto_review]172[auto_review]
185policy = """173extra_policy = """
186PASTE THE COMPLETE ACTIVE REVIEWER POLICY HERE BEFORE USING THIS EXAMPLE.
187
188## Environment Profile174## Environment Profile
189- Authorized target: lab.example.com.175- Authorized target: lab.example.com.
190- Approved actions: inspect the target, reproduce authorized vulnerabilities,176- Approved actions: inspect the target, reproduce authorized vulnerabilities,
200"""186"""
201```187```
202 188
203Replace the example target and allowed actions with the actual approved scope.189Enforce target restrictions with independent filesystem and network rules.
204Enforce target restrictions with independent filesystem and network rules;190For an organization, put the same engagement rules in the top-level
205reviewer instructions don't replace those boundaries.191`guardian_extra_policy` in managed `requirements.toml`. The following
206 192requirements select Auto-review and restrict the available permission profiles.
207Organizations can enforce the same conditions in managed `requirements.toml`:
208 193
209```toml194```toml
210allowed_approval_policies = ["on-request"]195allowed_approval_policies = ["on-request"]
212allowed_sandbox_modes = ["read-only", "workspace-write"]197allowed_sandbox_modes = ["read-only", "workspace-write"]
213default_permissions = ":workspace"198default_permissions = ":workspace"
214 199
215guardian_policy_config = """
216PASTE THE COMPLETE ACTIVE REVIEWER POLICY HERE BEFORE USING THIS EXAMPLE.
217
218## Environment Profile
219- Authorized target: lab.example.com.
220
221## Tenant Risk Taxonomy and Allow/Deny Rules
222- Allow only approved actions against the documented engagement target.
223- Deny out-of-scope hosts, production access, credential theft, persistence,
224 data exfiltration, destructive operations, and attempts to bypass policy.
225- Deny ambiguous or high-impact actions until a human explicitly approves the
226 exact target, action, and side effects.
227"""
228
229[allowed_permission_profiles]200[allowed_permission_profiles]
230":read-only" = true201":read-only" = true
231":workspace" = true202":workspace" = true
236`allowed_sandbox_modes` also prevents full access in deployments that still use207`allowed_sandbox_modes` also prevents full access in deployments that still use
237legacy `sandbox_mode`.208legacy `sandbox_mode`.
238 209
239Managed `guardian_policy_config` takes precedence over a user's local210Keep `approval_policy = "on-request"` or another
240`[auto_review].policy`. Keep `approval_policy = "on-request"` or another
241eligible interactive approval policy and keep an enforceable sandbox boundary.211eligible interactive approval policy and keep an enforceable sandbox boundary.
242With `approval_policy = "never"`, `:danger-full-access`, or `--yolo`, an action212With `approval_policy = "never"`, `:danger-full-access`, or `--yolo`, an action
243can avoid creating the boundary-crossing approval request that review requires.213can avoid creating the boundary-crossing approval request that review requires.
249 219
250See [Models and Trusted Access](https://learn.chatgpt.com/docs/cyber-safety) and [recommended220See [Models and Trusted Access](https://learn.chatgpt.com/docs/cyber-safety) and [recommended
251configuration](https://learn.chatgpt.com/docs/cyber-safety/recommended-configuration) for model access,221configuration](https://learn.chatgpt.com/docs/cyber-safety/recommended-configuration) for model access,
252engagement setup, and custom agent workflows. See [Managed configuration](https://learn.chatgpt.com/docs/enterprise/managed-configuration#configure-automatic-review-policy)222engagement setup, and custom agent workflows. For custom API or
253for enterprise precedence and supported client versions. For custom API or
254Agents SDK harnesses, use [Guardrails and human review](https://developers.openai.com/api/docs/guides/agents/guardrails-approvals#review-cybersecurity-actions-before-execution).223Agents SDK harnesses, use [Guardrails and human review](https://developers.openai.com/api/docs/guides/agents/guardrails-approvals#review-cybersecurity-actions-before-execution).
255 224
256## Reduce review volume without weakening security225## Reduce review volume without weakening security
267- Add narrowly scoped [prefix rules](https://learn.chatgpt.com/docs/agent-configuration/rules). Prefer precise command236- Add narrowly scoped [prefix rules](https://learn.chatgpt.com/docs/agent-configuration/rules). Prefer precise command
268 prefixes such as `["cargo", "test"]` or `["pnpm", "run", "lint"]` over broad237 prefixes such as `["cargo", "test"]` or `["pnpm", "run", "lint"]` over broad
269 patterns such as `["python"]` or `["curl"]`. Broad rules often erase the238 patterns such as `["python"]` or `["curl"]`. Broad rules often erase the
270 boundary Auto-review is meant to guard.239 boundary Auto-review is meant to guard. For cybersecurity models, the CLI
240 ignores `allow` prefix rules and honors `prompt` and `forbidden` rules.
271 241
272Auto-review session transcripts are retained under `~/.codex/sessions` by242Auto-review session transcripts are retained under `~/.codex/sessions` by
273default, so you can ask Codex to analyze past traffic there before changing243default, so you can ask Codex to analyze past traffic there before changing