[Windows][Desktop 26.901.20858] "Approve for me" (guardian-approvals) permission mode unavailable with API-key auth (gate 3902016271)
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
Environmental snapshot: Windows 11 build 26200; MSIX OpenAI.Codex 26.901.1978.0; embedded App 26.901.20858; bundled app-server/CLI 0.153.0; ~/.codex uses API-key auth (preferred_auth_method = "apikey", no auth.json/auth.toml, custom provider). The local config.toml has no features.guardian_approval entry.
Repro
-
Open any conversation's permission dropdown (composer permissions control or workspace settings).
-
Observed options: "请求批准 / Ask (default)", "完全访问权限 / Full access", "自定义 / Custom (config.toml)".
-
The "帮我批准 / Approve for me (guardian-approvals)" option is absent/hidden; where surfaced elsewhere it is disabled with "需要此工作空间中的默认沙盒权限 / Requires the default sandbox permissions in this workspace".
-
config.tomlcurrently has:approval_policy = "on-request" sandbox_mode = "workspace-write" [sandbox_workspace_write] sandbox = "elevated"
Expected vs Actual
Expected: "帮我批准 / Approve for me" mode (guardian-approvals: only request approval for detected risky operations) should be selectable, especially since the runtime auto-review path is active for this user.
Actual: the guardian option is unavailable for this configuration, silently.
Root-cause observations (app.asar of 26.901.20858)
- The permission dropdown derives agent modes through a selector (
zto):u = isAutoReviewRequiredForSelectedModel || isGuardianApprovalEnabledByStatsig || hasAuthoritativeGuardianApprovalDefault;l = axt(resolvedConfig) ?? true, whereaxt(e) = Hbt(e, 'guardian_approval')andHbtreads the booleanconfig.features.guardian_approval(defaults totruewhen absent). Theguardian-approvalsmode is retained only whenu && l(or when it is the only available mode).isGuardianModeAvailableandshowGuardianOptionboth descend from these values. isGuardianApprovalEnabledByStatsigisdynamicConfig.guardian_approval === true, and the app registers this as gate3902016271with featureKeyguardian_approval.- A separate helper (
XNr) requiresagentMode === 'auto' && !isConfigDataPending && isGuardianModeAvailable && showGuardianOptionfor the guardian option to appear. - The config-to-mode resolver (
ixt) mapsworkspace-write+ a default[sandbox_workspace_write]block intoauto/granular/guardian-approvals; with an explicitapproval_policy = "on-request"it resolves toauto. Note: the "defaultness" check (rxt) only inspectswritable_roots,network_access,exclude_slash_tmpandexclude_tmpdir_env_var;sandbox = "elevated"is not part of that check. - Isolation: the same session runs with
approvals_reviewer = auto_review(runtime automatic approval review works), so the runtime mechanism is available; only the agent-mode guardian option is gated off at the UI layer.
Correction note
An earlier draft of this issue attributed the missing mode to a non-default [sandbox_workspace_write] block and to a missing guardian-approval permission profile. Re-checking the source shows both are incorrect: rxt ignores the sandbox field, and axt is a config.features.guardian_approval boolean check that defaults to true. The most plausible gating factor is the u branch (Statsig gate 3902016271, a model-specific auto-review requirement, or an authoritative guardian-approval default) rather than the local config.
Related, not duplicates
- #39973 (retirement of
approval_policy="untrusted"without an equivalent replacement; the guardian mode appears designed as its successor). This issue tracks the new UI-layer availability of that successor. - #29915 (permission/approval mode selection does not persist for new or existing threads).
- #41462 / #41741 (auto-review UX/behavior issues, different surface).
Notes / boundaries
- Statsig runtime values and
isAutoReviewRequiredForSelectedModelcannot be observed from outside the runtime, so which disjunct ofufails is not proven; theu && lstructure, the gate id, and the local-config irrelevance are verified from source. - No config/UI change was made while investigating.
Request
Please confirm whether "帮我批准 / Approve for me (guardian-approvals)" is intentionally unavailable for API-key/custom-provider setups (gate 3902016271 not enabled, or a model without an auto-review requirement); if intended, a clear in-UI explanation for why it is missing would help. If not intended, this should restore the mode or surface the actionable requirement instead of hiding it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the mentioned selectors zto, ixt, XNr, axt, and the Statsig gate 3902016271 in the desktop permission-mode code. Verify which branch prevents guardian-approvals for API-key/custom-provider sessions, then confirm whether the intended result is restoring the mode or exposing a clear requirement in the UI.
Written by the indexing model from the issue text.
Assessment
- Domain
- authorization, desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100