Repository navigation
Description
What issue are you seeing?
Codex Desktop on Windows is rejecting an ordinary local service/application restart before the command executes, even though the effective settings show:
- approval reviewer: user
- filesystem access: full / unrestricted
- the applicable local cleanup/project rule does not prohibit starting or restarting services
The only runtime result surfaced to the agent/user is:
blocked by policy
The agent inspected the effective settings and rejection record and could not identify any documented setting that explains the denial. This creates a dead end: the user has already selected the permissive reviewer and full filesystem access, yet Codex still cannot perform the local operation and cannot say which rule rejected it.
Why this appears to be a product bug
The visible/effective configuration and the runtime decision contradict each other from the user's perspective:
- The configured approval reviewer is the user.
- The task has full filesystem access.
- The requested action is a local service/application restart, not a deletion or broad destructive operation.
- The local project/cleanup instructions do not forbid service startup.
- The restart is rejected before execution with only
blocked by policy. - No policy rule ID, classifier, matched command fragment, or recoverable approval path is exposed.
This is distinct from reports about exact file deletion and the known PowerShell URL/Start-Process classifier false positive. The common symptom is the same opaque pre-execution blocked by policy result.
Expected behavior
For a benign local restart under user-selected approval review and full filesystem access, Codex should do one of the following:
- Execute the command.
- Ask the user for an explicit one-time approval if a separate protected-operation rule applies.
- Return a concrete policy identifier and matched reason that explains why the operation is forbidden and what supported setting, if any, controls it.
It should not silently override the visible permission model with an unexplained hard block.
Diagnostic request
Please expose enough information to make these failures diagnosable:
- policy/rule identifier responsible for
blocked by policy - whether the block came from execpolicy, automatic approval review, Desktop host policy, or another hidden layer
- the matched command/operator or protected action category
- whether the decision is configurable by the user
- a correlation/request ID that support can use to inspect the backend decision
A reproducible harness diagnostic would also be useful: given a candidate command plus the effective sandbox/reviewer configuration, show the policy decision without executing the command.
Environment
- Platform: Windows
- Client: Codex Desktop
- Same-day Codex Desktop rollout on this machine reports bundled CLI
0.153.3; the exact affected task's app package version was not surfaced in the screenshot and can be supplied separately if needed. - The affected task reported full filesystem access and the user as approval reviewer.
Impact
This blocks ordinary local development/automation work after the user has already granted the permissions the product exposes. More seriously, the product cannot explain which rule remains in force, so the user is pushed into repeatedly changing settings without evidence. This materially undermines trust in the permission/approval model.
Related reports
- [Windows][Codex App] Exact user-authorized file deletion blocked by policy before PowerShell starts #38886 — exact user-authorized file deletion blocked before PowerShell starts
- Windows execpolicy false positive when Start-Process and an unrelated URL appear in the same PowerShell script #40060 — Windows execpolicy false positive involving
Start-Processand an unrelated URL
This report is intentionally separate because the affected operation is a service/application restart and the core problem is the contradiction between the effective user-selected reviewer/full-access state and an opaque hidden policy rejection.
Activity
github-actions commentedon Sep 5, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
windPeng1231231 commentedon Sep 8, 2026
Additional observed case on 2026-09-08: a local bridge restart was rejected before PowerShell started, while the task's supplied execution configuration explicitly reported danger-full-access / unrestricted filesystem, network enabled, and approval_policy = never. The user also confirmed selecting Full access in the desktop UI.
Environment: native Windows 10 build 19045, PowerShell 7.6.5, Codex desktop task. Exact desktop product version is unavailable (executable metadata did not reliably identify it).
The user requested a code fix. After tests and type checking passed, the agent attempted to load the fix by restarting only the local bridge. Read-only preflight confirmed the bridge was idle and identified its exact PID, executable and command line. The rejected PowerShell block checked localhost health, validated the PID against the expected executable/arguments, then used
Stop-Process -Id $bridgePidandStart-Process -WindowStyle Hiddenwith an explicit executable, working directory and redirected logs. It did not contain recursive deletion or a broad process-name kill.The tool returned this error structure (command body/path details omitted):
Reported tool wall time was 0.0 seconds. The command did not run; a subsequent health check confirmed the existing bridge was still available. No alternate execution path was used to bypass the denial. A minimal clean-project reproducer has not been established; this is evidence from the affected task.
This case adds a useful distinction from the issue's original user-reviewer configuration: the affected task reported
approval_policy = never. The current documentation says sandbox auto-review only applies to interactive approvals and that withneverthere is nothing to review: https://learn.chatgpt.com/docs/sandboxing/auto-review . That does not identify which layer actually denied this request. The assistant initially called it an automatic-review denial, then corrected that attribution because the tool exposed onlyblocked by policy.Please investigate the Full access / effective execution decision mismatch and expose the responsible policy/rule, matched reason, and a support correlation ID. If an independent policy intentionally forbids the operation, explain that restriction in the UI and error rather than leaving users to repeatedly change permission settings. This comment contains no credentials, internal project source, or full session transcript.
Josh-Gamer commentedon Sep 11, 2026
Proposal: bounded, privacy-safe diagnostics for execpolicy denials
Following the requests in this issue, I suggest a small first implementation slice that makes known execpolicy denials explainable without changing permission decisions.
My related occurrence and classifier-only reproduction are documented in #40060. The exact in-process branch responsible for that desktop rejection remains unconfirmed. This proposal does not present the standalone classifier result as a complete desktop reproduction.
1. Observed information loss
At inspected commit da20788df913:
DangerousCommandMatch::Otherin is_dangerous_command.rs.blocked by policy.This explains an available source-level information-loss path, not every desktop denial. Some other reasons already have specific messages.
2. First-slice boundary
Cover pre-execution denials whose deciding component is the open-source execpolicy path. Preserve existing allow/prompt/forbid decisions, classifier predicates and precedence, approval routing, platform semantics and worker/process behavior.
Do not combine this slice with the classifier false-positive fix, new approval controls, automatic retries, or a new command-execution/diagnostic endpoint. Browser/plugin policy, remote host refusals and automatic-review decisions require their own source instrumentation; generic error text must not be used to attribute them to execpolicy.
3. Minimal internal diagnostic contract
Create a versioned, typed record at the decision boundary. The following names are proposed, not existing API fields.
schema_version1.stage,decisionpre_execution,forbiddenfor this slice.sourceexecpolicyonly when established by the emitting component; otherwiseunknown.reason_codepolicy_rule_forbidden,approval_unavailable, orunknown. Describes the decision cause.match_categorypowershell_url_launch_pattern,forced_rm,other_dangerous_pattern, orunknown. A heuristic match is not a finding that the command is malicious.parser_pathlowered_commands,whole_invocation_fallback,not_applicable, orunknown, from the actual evaluation path.approval_policyunknown; no configuration dump.diagnostic_refAn explicit policy-rule denial must not be relabeled as a classifier denial merely because the same command also looks dangerous. Do not invent a rule ID or expose its filename/prefix; a safe opaque rule reference can be considered separately if the policy owner supplies one.
Illustrative synthetic record, not a recovered verdict for my incident:
{ "schema_version": 1, "stage": "pre_execution", "decision": "forbidden", "source": "execpolicy", "reason_code": "approval_unavailable", "match_category": "powershell_url_launch_pattern", "parser_path": "whole_invocation_fallback", "approval_policy": "never", "diagnostic_ref": "0f516edb-492d-4c1f-a682-7d35d68e7249" }4. Capture once, propagate, render safely
trueresult.unknown.Example human-readable addition:
Do not prescribe a retry, a settings change or an approval command unless that particular decision path actually supports it. Local correlation does not imply the reference has been uploaded or is available to support.
5. Privacy and compatibility
Use an allowlist of fixed enums and the opaque reference. Neither the new event nor its error suffix should contain raw commands, arguments, patches, URLs, filesystem paths, environment values, rule prefixes or free-text policy justification. Do not derive references from sensitive inputs.
Preserve the bounded, non-echoing behavior introduced by PR #42113. #32573 shows why hook-side redaction alone is insufficient; assertions must cover the final message too. This proposal does not claim to remove inputs already stored by other existing transcript/log paths.
Emit one bounded diagnostic event per actual denial through existing local logging controls and retention. No new background collection, persistent verbose-logging setting, or automatic upload. Unknown fields remain unknown.
6. Acceptance matrix
All command fixtures below are classified as data; they are not executed.
The change is ready for review only when decision-equivalence and final-output privacy tests pass. Desktop acceptance should separately verify one confirmed instrumented denial and one allowed control on the supported Windows executor; source-only tests must not be reported as that desktop acceptance.
7. Maintainer decision requested
Would this bounded execpolicy-first diagnostic contract fit the intended architecture, and should its acceptance criteria be tracked here or under #40060? I am proposing analysis and a testable design; no implementation, executed acceptance suite, maintainer adoption or deployed fix is claimed.
zhiqiangtang9215-ship-it commentedon Sep 24, 2026
Potentially related Windows report; the same root cause is not confirmed.
App: 26.917.62051, build 10789, prod.
Runtime: codex-cli 0.155.0-alpha.16.3.
Settings: danger-full-access, approval_policy=never, approvals_reviewer=user.
At 2026-09-24 01:37:46 and 01:39:37 UTC, exec_command returned “CreateProcess … rejected: blocked by policy” before process creation.
The requests were to prepare a controlled local Web/API restart script, and to start a local Web process against an existing local API. Available logs did not identify the rejecting policy.
In-app feedback ID: 01a0bc9f-60af-7102-a134-3cc1f07aa980
This currently blocks delivery of an already-built and isolated-tested UI update. Could a maintainer investigate the feedback ID and identify the applicable restriction or supported recovery procedure?
No logs, credentials, browser information, or project files are attached.
eaglejl commentedon Sep 24, 2026
Additional observed Windows desktop case, with explicit permission from the affected user to publish this sanitized report. The root cause has not been established.
Environment and observed command denial
26.917.8451.0(identified from the executable/package path).approval_policy=Neverandsandbox_policy=DangerFullAccess.Start-Process -WindowStyle Hiddenlaunching a reviewed local Python helper. It would listen only on loopback and use an existing SSH identity plus pinned host key to reach an owner-authorized office test server's loopback HTTP service. No SSH configuration, firewall, shared infrastructure, or customer business data changes were requested.Observed twice on September 23, 2026: approximately 05:40 UTC and 13:18 UTC. Between those observations the desktop/execution processes were restarted at approximately 11:29 UTC. The later invocation used the original tool and launch method; it did not request
require_escalated.Post-denial read-only checks found no new planned log directory and no loopback listener. Independent checks of the office environment had passed before the invocation; actual browser QA could not proceed because the local entry point was absent. We are not attributing this to a server or application failure.
Bounded diagnostics already performed
execpolicy checkagainst the user's rule file:{"matchedRules":[]}. This only tests that supplied rule file, not all internal/cloud policy layers.requirements.toml, legacy usermanaged_config.toml, and workspace/drive-root project config files were absent.Reporting itself also failed
The user tried the in-app feedback dialog. It showed “Feedback upload not confirmed.” The app log at 2026-09-23T16:02:20.494Z gives a more concrete result:
Thus we have no verified successful feedback receipt. This reporting failure is potentially related to the UI symptom in #43436, but neither a shared cause with that report nor a shared cause with the command denial is established.
Requested supported resolution
Could a maintainer identify the responsible policy layer, explain whether this operation is intentionally prohibited or potentially misclassified, and provide a supported diagnostic/review path? We are not requesting that safeguards be disabled. It would also help for the feedback UI to distinguish an explicit HTTP rejection from an uncertain receipt and provide a reliable report reference.
No credentials, account identifiers, internal addresses, customer records, project source, screenshots, raw logs, or full conversation are attached.
eaglejl commentedon Sep 24, 2026
Follow-up to my report above: a static comparison now narrows the likely cause, without executing or reformulating the denied command.
Recovered the original September 23 13:18 UTC tool payload locally and parsed its PowerShell AST as data only:
Start-Processcommand nodes: 1;Start-Processcommand extent: false;Invoke-WebRequestcommand nodes: 2, containing loopback HTTP URLs used for subsequent checks.No command was executed during this analysis; no private payload is attached.
The currently installed runtime reports
codex-cli 0.155.0-alpha.16.3. In the corresponding public tag:start-process.DangerousCommandMatch::Otherin is_dangerous_command.rs.AskForApproval::NeverproducesDecision::Forbidden;Otherrenders the generic error in exec_policy.rs and its rejection message mapping.This makes #40060 a concrete candidate explanation for our command structure and effective
nevermode, rather than merely a similar error message. However, we have not captured the actual in-process classification/parser path, run the original script through an instrumented classifier, or verified byte-for-byte provenance between the installed executable and that public tag. This is not a confirmed root-cause verdict or a successful workaround.Please confirm whether this is the intended #40060 classification path and advise a supported review/recovery procedure. We have not split the launch/check commands, changed approval settings/rules, or tried an alternate tool to evade the denial.