Repository navigation
Description
What version of Codex CLI is running?
codex-cli 0.160.0
What subscription do you have?
ChatGPT Pro 200
Which model were you using?
gpt-6.1-sol
What platform is your computer?
Darwin 27.0.0 arm64 arm
What terminal emulator and version are you using (if applicable)?
Ghostty
Codex doctor report
What issue are you seeing?
A nonblank [auto_review].extra_policy is accepted, but its text is silently omitted from the synchronous Guardian reviewer's base instructions when the selected codex-auto-review catalog entry supplies a policy template without {{ extra_policy }}. [auto_review].policy and experimental_policy_template are unset.
The configuration reference describes extra_policy as additional policy included alongside the main policy. The current catalog template prevents that insertion. The renderer provides no missing-placeholder diagnostic. The catalog's base security policy is retained, but the configured additional rules are absent.
Observed evidence:
- A fresh catalog fetched by the official 0.160.0 binary at
2026-10-02T06:06:03.097223Zhas zero{{ extra_policy }}placeholders in thecodex-auto-reviewtemplate - Executing the 0.160.0 Rust renderer body with that fresh template and a neutral extra-policy sentinel produces zero sentinel occurrences. The bundled-template control produces one occurrence. Both preserve the full base policy
Verification establishes omitted prompt input. Action enforcement outcomes were not tested. Catalog contents may vary by account or server rollout. These observations concern the catalog served to this account.
What steps can reproduce the bug?
-
Configure automatic review with a nonblank additional policy in a test Codex home:
model = "gpt-6.1-sol" approval_policy = "on-request" approvals_reviewer = "auto_review" sandbox_mode = "workspace-write" [auto_review] extra_policy = "EXTRA_POLICY_SENTINEL: Require explicit confirmation before writing guardian-policy-probe.txt."
Leave
auto_review.policyandauto_review.experimental_policy_templateunset. -
Sign in normally and fetch the model catalog:
codex --version codex debug models > catalog.jsonFor a fresh server fetch, use a test Codex home with no existing
models_cache.json. In 0.160.0,debug modelsusesOnlineIfUncached, so an existing cache can otherwise be reused. -
Inspect the actual selected catalog template and reproduce its rendering with this source-equivalent checker:
uv run --offline --no-project python - catalog.json <<'PY' import json import sys with open(sys.argv[1]) as file: models = json.load(file)["models"] model = next(model for model in models if model["slug"] == "codex-auto-review") messages = model["model_messages"]["auto_review"] template = messages["policy_template"] policy = messages["policy"] extra = "EXTRA_POLICY_SENTINEL: Require explicit confirmation before writing guardian-policy-probe.txt." prompt = policy.strip().join( part.replace("{{ extra_policy }}", extra.strip()) for part in template.rstrip().split("{{ tenant_policy_config }}") ) rendered = f"{prompt}\n\nReview contract.\n" print("extra_policy placeholders:", template.count("{{ extra_policy }}")) print("extra_policy sentinel occurrences:", rendered.count("EXTRA_POLICY_SENTINEL")) print("full base policy present:", policy.strip() in rendered) PY
Observed output:
extra_policy placeholders: 0 extra_policy sentinel occurrences: 0 full base policy present: TrueThis checker mirrors
GuardianPolicyInstructions::bodyin 0.160.0. It is a deterministic rendering reproduction, independent of model behavior. I also executed the original Rust renderer body in an isolated harness with the same results. Substituting the release's bundledpolicy_template.mdchanges the sentinel count to1. -
For optional end-to-end confirmation, start a new CLI session with that configuration and request a harmless read-only command that requires approval review, such as
pwdthroughexec_commandwithsandbox_permissions = "require_escalated". Confirm a Guardian rollout was created and inspect itssession_meta.payload.base_instructions.textforEXTRA_POLICY_SENTINEL.This inference-based confirmation has not been performed. The verified reproduction above uses the fresh catalog and the release renderer with the neutral sentinel.
What is the expected behavior?
When auto_review.extra_policy is nonblank, normal automatic-review prompt construction should include it alongside the resolved base policy, including when codex-auto-review supplies the template through the model catalog.
If a selected template cannot include the configured policy, the CLI should surface that incompatibility instead of silently proceeding with the policy omitted. Users should be able to keep auto_review.policy unset and retain the catalog's base policy while adding local rules through the documented setting.
Additional information
The failure occurs at the boundary between the client renderer and the catalog-provided template:
- Configuration loading resolves nonblank
extra_policyintoguardian_extra_policy, with managed precedence - Catalog message resolution prefers the supplied catalog template over the bundled template
- Reviewer setup passes the resolved extra policy and selected template to
GuardianPolicyInstructions - The renderer inserts additional policy only by replacing
{{ extra_policy }}. A missing placeholder discards that input
The fetched catalog template differs from the release's bundled template only by the missing extra-policy slot:
Catalog:
# Security Policy
{{ tenant_policy_config }}
# Investigation Guidelines
Bundled:
# Security Policy
{{ tenant_policy_config }}
{{ extra_policy }}
# Investigation Guidelines
PR #47125, merged on 2026-09-21, explicitly added extra policy to both Guardian reviewer templates and Guardian v2 classification. Its implementation is not limited to a particular reviewer model. The reviewer path therefore already has support intended to compose this input. The missing catalog placeholder prevents that support from taking effect in the observed codex-auto-review configuration.
Two details explain the existing test coverage:
- Integration scenario explicitly overrides the reviewer template with the bundled one
- Renderer unit test explicitly expects omission when a nonblank extra policy is passed to a template without its slot
These tests cover insertion into a compatible template and the renderer's behavior with an incompatible one. They do not establish that the normal catalog-selected template includes the additional policy.
PR #47287, merged on 2026-09-22, subsequently updated only this scenario's snapshot for retained user instructions. It did not change the template-selection or extra-policy rendering code.
A fix should align the served codex-auto-review template with the additional-policy contract and add coverage through catalog-template selection without forcing the bundled override. Client-side validation or a defined insertion fallback would also prevent this class of silent omission from recurring with an older or incompatible catalog template.
The scope here is synchronous reviewer prompt composition. The Guardian v2 classifier path concatenates the base and extra policy before classifier rendering and truncation. It does not depend on this reviewer template's extra-policy placeholder.
Issue #38316 discusses local auto_review.policy replacing the base policy. This report uses extra_policy with policy unset. PR #47125 does not link #38316 as a closing issue or state that it was the reason for introducing the new field.
I searched public open and closed issues and PRs on 2026-10-02 for extra_policy, guardian_extra_policy, extra-policy with template, Guardian with template, and codex-auto-review with policy. I found #47125 and related policy/template discussions, but no report specifically describing the missing extra-policy placeholder in the served codex-auto-review template. This is a bounded public search.
Activity
jan-aisi commentedon Oct 2, 2026
I can reproduce this on
main(84d5437). A few more details:gpt-5.6-lunahas the same template with no{{ extra_policy }}slot. It's the default reviewer for API-key login (provider.rs#L126), so API-key users hit this too, not just ChatGPT login.models-manager/models.jsonis also missing the slot for both models (gpt-5.6-luna, codex-auto-review). Updating only the served catalog wouldn't fix clients that use the bundled one.guardian_extra_policyfromrequirements.tomlgoes through the same slot (config/mod.rs#L4029-L4038), so it gets dropped as well.My agents checked this by rendering both the bundled catalog and a freshly fetched one through
ResolvedModelMessages::from_model+GuardianPolicyInstructions. The extra policy is missing forcodex-auto-reviewandgpt-5.6-luna. It shows up for the bundled fallback and for models without their own template, likegpt-6-luna.Phase 4: the full system works in Codex, policy only, no patch
feat(cli): sib install codex
n0rpan123 commentedon Oct 13, 2026
Additional desktop evidence on a newer build, observed 2026-10-13:
auto_review.extra_policythroughconfig/readfor the project and child worktree. No replacementauto_review.policyis configured;configRequirements/readreturns null requirements in that diagnostic process.Codex Desktopand the current bundled CLI version. At least one review completed withallow; this observation is not inferred from a denial.f893abed23f18900cb5dd8fe34e2aa616634efcd1792ec38cd7241972dacfd8b.fetched_at: 2026-10-13T16:34:08.201444Z, contains acodex-auto-review/model_messages.auto_review.policy_templatewith zero{{ extra_policy }}placeholders and one{{ tenant_policy_config }}placeholder.This strongly supports the missing-template-slot diagnosis described above and shows the symptom on the desktop's newer bundled version. Limits: the current cache was not bound to each individual review at invocation time; a separate diagnostic process does not prove the running desktop's effective config; saved traces do not prove the complete model request. We have not inspected or executed the renderer for this newer build and do not claim a definitive causal result beyond those observations.
No main policy was replaced, no denied operations were replayed, and no synthetic review-triggering scenario was created. No credentials, full transcripts, hidden reasoning, private issue bodies, or account contact details are included. OpenAI web support directed this report to this tracker. Please include this as additional evidence when investigating catalog-template propagation and missing-placeholder diagnostics.
SuperDuperDave commentedon Oct 16, 2026
Still present at
rust-v0.161.0(9790114). Incodex-rs/models-manager/models.json, both reviewer entries (codex-auto-reviewL1555,gpt-5.6-lunaL1058) carry apolicy_templateequal toprompts/templates/guardian/policy_template.mdwith only the{{ extra_policy }}line and the blank line after it removed (9,734 vs 9,754 bytes). The model template takes precedence over that fallback, soauto_review.extra_policyis dropped for both.One reason it can slip through: the upstream extra-policy scenario pins the bundled fallback template explicitly, so it passes while the catalog entries stay stale. Coverage against the actual bundled reviewer entries, or a required-placeholder check before rendering, would catch it.
Workaround that worked for us: set
auto_review.experimental_policy_templateto the fallback template, which restores the slot; the reviewer then cited the extra policy in its decisions.Phase 4: the full system works in Codex, policy only, no patch
feat(cli): sib install codex
Oleksii-Rohalskyi commentedon Oct 19, 2026
Follow-up validation on 2026-10-19: the public upstream
mainsnapshot atbb8f530still has the mismatch in its bundled files. Incodex-rs/models-manager/models.json, thecodex-auto-reviewpolicy_templatehas 0{{ extra_policy }}slots and 1{{ tenant_policy_config }}slot; the bundledpolicy_template.mdhas 1{{ extra_policy }}slot. This confirms the bundled-catalog case remains affected; it does not establish what any particular account's server currently serves.Coverage against the catalog-selected bundled reviewer entry (without forcing the fallback template), plus a diagnostic when nonblank
extra_policyhas no insertion slot, would catch this regression.NonTrivialLiu commentedon Oct 22, 2026
Beyond checking the missing template slot, please distinguish “configuration parsed” from “supplement included in the effective reviewer input.” Those are different assurances.
A privacy-preserving status could report supplement present/absent, its supplying configuration layer, and a local comparison identifier without exposing policy text. Regression coverage should exercise both permissive and restrictive supplements while retaining the base policy: silently dropping either can undermine the intended boundary.
This is proposed observability coverage, not a new renderer reproduction. Accepting a configuration the reviewer never receives makes users troubleshoot their wording instead of the propagation path.
serpro69 commentedon Oct 26, 2026
Confirmed still present with Codex CLI and app-server 0.164.0 on macOS 26.6.2 arm64. Main model:
gpt-6-astra; actual synchronous reviewer:codex-auto-review.I can add evidence from an actual denied review, beyond the deterministic renderer reproduction:
config/readwith the trusted project's cwd resolves the nonblankauto_review.extra_policyfrom the project layer.auto_review.policyandexperimental_policy_templatewere unset.configRequirements/readreturned no managed requirements.codex-auto-reviewcatalog template has one{{ tenant_policy_config }}occurrence and zero{{ extra_policy }}occurrences. Template length: 9,734 characters; SHA256:f47fbb2bdba5e7528bfae7f5e2844a7d45a3a922fa74b718f22b22917376cfcf.guardian_review_feedbackrecord identifiescodex-auto-reviewand a denied decision. Its savedinstructionscontain neither the configured extra-policy heading nor the complete extra-policy text.For a temporary local repair, I set
auto_review.experimental_policy_templateto the complete observed template with only two newlines and{{ extra_policy }}inserted after{{ tenant_policy_config }}. The existing scopedextra_policystays unchanged andauto_review.policystays unset. Byte comparison verifies that removing the insertion restores the original template exactly. A fresh app-server configuration read loads the repaired template, and source-equivalent rendering includes both the complete catalog base policy and the complete configured addition.That last check verifies loading and prompt composition; I have not claimed a successful external action after starting a new session with the repair. The override pins the template and should be retired after the upstream fix.
No raw reviewer prompts, private source, session identifiers, account data, or credentials are included in this report. The observed failure still matches the catalog-template selection gap described above.
jordanschwartz-js commentedon Oct 26, 2026
Additional confirmation on 2026-10-26 with the macOS desktop app 26.1021.31345 (build 21828), bundled CLI/app-server 0.164.0-alpha.11.1.
We traced a real synchronous
codex-auto-reviewdenial to the same template incompatibility:auto_review.extra_policy;auto_review.policyandexperimental_policy_templateare unset. A separate read-only diagnostic app-server configuration read resolves the addition correctly.{{ tenant_policy_config }}slot and zero{{ extra_policy }}slots (9,734 characters).rust-v0.164.0-alpha.11.1, commit6905ecede7816e91373e9eabda3f6b0368fc747b), the observed catalog template, catalog policy and fixed output contract reproduce the complete 18,446-character base-instructions text recorded in the affected reviewer rollout exactly. Supplying the configured additional policy or an empty string produces identical output.This is a deterministic match to saved reviewer instructions, not a claim to have captured the complete wire request or the running backend's internal configuration.
We also checked a proposed temporary repair entirely in memory: insert only
\n\n{{ extra_policy }}immediately after{{ tenant_policy_config }}in the complete observed template. The result equals the matching release's bundled fallback template. Source-equivalent rendering then includes the complete original base policy and complete addition, with all other rendered text unchanged. Removing the insertion restores the original template exactly. We have not installed that override or claimed post-repair end-to-end success.Public upstream
mainat36021e1ad500d328471aae26573d1fa0c872b335still has zero extra-policy slots in the bundled catalog templates for bothcodex-auto-reviewandgpt-5.6-luna.A durable fix should cover served and bundled catalog templates and validate nonblank additions through normal catalog selection. Please also consider a diagnostic or defined safe handling for missing placeholders so restrictive additions cannot silently disappear. A local full-template override pins template wording and needs an explicit retirement path once upstream compatibility is restored.
No private policy text, memory content, endpoints, account identifiers, local paths, raw transcripts or credentials are included.
eddiew commentedon Oct 28, 2026
Still present on codex-cli 0.165.0 and 0.166.0-alpha.5 (macOS arm64). Here is evidence from actual review decisions:
auto_review.extra_policysaying a folder must never be deleted, an untrusted file asking forrm -rfon that folder was approved and the folder was deleted. This happened on 0.164.0, 0.165.0 and 0.166.0-alpha.5.auto_review.policygot the command denied on 0.164.0 and 0.166.0-alpha.5, and the rationale cited the rule.Because
auto_review.policyreplaces the built-in policy (#38316), we work around this by sending the built-in policy text from the bundled catalog with our rules appended. On 0.165.0 that got the deletion denied too. The built-in text is identical from 0.155.1 to 0.165.0, but copying it means tracking every change, so a workingextra_policywould be much better.dmrowell commentedon Oct 30, 2026
Additional Windows confirmation, observed 29 October 2026: desktop app 26.1023.51421 (build 22530, production channel), with CLI/current-chat version 0.165.0-alpha.1.2.
A valid, nonblank auto_review.extra_policy was absent from four recorded denied reviews’ instructions and retained developer messages. The 9,734-character template and 18,446-character instruction fingerprints match those reported here.
Operational impact: three denials in one turn were followed by a mid-task interruption, consistent with the documented circuit breaker. The owner had to repeat permission for routine nonsecret Linear reports; direct standing permission in the chat then allowed posting.
The updater reports restart_required; post-restart behaviour is untested. No policy override was applied, and no private configuration or transcripts are attached.
uncfreak1255-code commentedon Nov 2, 2026
I prepared a missing-slot fallback with regression coverage in fork PR #1, commit
adc09dc(upstream basea098129).When the selected reviewer template lacks
{{ extra_policy }}, the renderer appends nonblank additional policy before the output contract. Existing slot substitution and blank-addition behavior stay unchanged. The selected vendor template and resolved tenant policy remain in use, so no full-template override is needed for this delivery path.Regression results:
codex-promptslibrary tests pass; Clippy and formatting checks pass.Coverage uses both bundled reviewer catalog entries through
ResolvedModelMessages, plus permissive/restrictive additions, both transcript formats, blank input and literal placeholder text. The PR includes reproduction commands and details.This verifies source-level prompt composition, not model enforcement or installed desktop behavior.
KohakuD commentedon Nov 8, 2026
Additional Windows desktop evidence from 8 November 2026, with actual denied Git-push reviews.
Environment
0.167.0-alpha.3.2, originatorCodex Desktop.[auto_review].extra_policy;policyandexperimental_policy_templateunset.Observed evidence
config/read.configRequirements/readreturns no managed requirements in that diagnostic process.session_meta.codex-auto-reviewcatalog'smodel_messages.auto_review.policy_templateis 9,734 characters, with zero{{ extra_policy }}slots and one{{ tenant_policy_config }}slot.risk_level=high,user_authorization=lowand denied for missing trusted authorization. After the owner repeated direct authorization in that chat at approximately 15:18 UTC, the same action was assessed asuser_authorization=high,outcome=allow.Impact
Routine work across existing and new project chats repeatedly stops for per-push confirmation. Saving the documented extra policy, checking the helper and observing occasional successful pushes have not established a durable resolution.
Evidence limits
A fresh diagnostic process does not prove every effective startup override in the already-running desktop host. Saved rollouts do not establish the complete internal/wire request. The current catalog cache was not bound to each review at invocation time, and we have not executed the exact-version renderer in isolation. These observations support the omission reported here; they do not independently establish every internal causal step.
No safety policy was replaced or disabled, and denied operations were not replayed through alternate routes. This AI-assisted report was explicitly requested by the owner. It intentionally excludes personal paths, account identifiers, repository URLs, session IDs, private policy text, source code, raw transcripts and credentials.
Please include this newer Windows desktop case when checking served/bundled template compatibility and validation of nonblank additions through normal catalog selection. A clear diagnostic when configured additional policy cannot be inserted would also prevent users from relying on a silently absent rule.
aofei commentedon Nov 14, 2026
Addressed in 0.169.0 by #60646. After migrating from local
auto_review.extra_policyto managedguardian_extra_policyinrequirements.toml, I confirmed that the full additional policy is present in five actual Guardian reviewer prompts. Closing as resolved.Phase 4: the full system works in Codex, policy only, no patch
feat(cli): sib install codex
Phase 4: the full system works in Codex, policy only, no patch
feat(cli): sib install codex
Phase 4: the full system works in Codex, policy only, no patch
feat(cli): sib install codex
milobird commentedon Nov 16, 2026
Additional evidence from the macOS desktop app on 16 November 2026. This installation still bundles the affected pre-fix version; this is not a claim of regression in 0.169.0 or a request to reopen.
codex-auto-review, with automatic review enabled and a workspace-write sandbox.auto_review.extra_policyauthorized task-relevant external code-review delegation. Both actual denial records omitted that policy from the reviewer's instructions and classified the request as high risk with low authorization. Reading the config into the chat did not resolve this: the reviewer treated it as tool-output evidence. It approved the action after direct user authorization.The two saved denial instruction strings are identical: 18,446 characters, SHA256
f893abed23f18900cb5dd8fe34e2aa616634efcd1792ec38cd7241972dacfd8b. The observed catalog template is 9,734 characters, SHA256f47fbb2bdba5e7528bfae7f5e2844a7d45a3a922fa74b718f22b22917376cfcf, with one tenant-policy slot and no extra-policy slot.Using the exact release renderer, the observed catalog template, default policy and release output contract reproduces both recorded instruction strings byte for byte. A synthetic extra-policy sentinel and an empty addition produce identical output. The bundled-template control retains the sentinel. These checks make no model calls or external delegations.
The cache was refreshed after the incident, so the evidence is the exact reconstructed instruction digest, not its file timestamp. We did not recover the original turn's effective configuration, and correct prompt composition does not establish what a subsequent reviewer decision would be.
The fix in #60646 and its inclusion in 0.169.0 provide the migration path: managed
guardian_extra_policywith a compatible client. Updating only a separate shell CLI will not update a desktop app's bundled backend. We have not yet updated this desktop or validated the managed-policy migration there.shishi commentedon Nov 22, 2026
I don't think moving extra_policy to the managed guardian_extra_policy setting is an adequate replacement for the previous user-configurable option.
PR #60646 explains the need for trusted Guardian prompt templates, but why does that require removing the ability for individual users to configure their own additional review policies?
Template integrity and user configurability are separate concerns. A trusted template could still provide a designated slot for user-defined policy instructions without allowing users to override the template itself.
Even if the underlying functionality is unchanged, moving control from individual users to managed configuration is a meaningful loss of functionality.
Was removing user-level configurability intentional? If so, what was the specific reason for that decision?
I'd like to request that auto_review.extra_policy, or an equivalent user-level setting, be restored. Users should be able to customize review policies for their own workflows without requiring administrator-managed configuration.