Skip to content

[Windows Codex Desktop] Service restart rejected as “blocked by policy” despite user reviewer and full filesystem access #42968

Open

Description

@Molinist

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:

  1. The configured approval reviewer is the user.
  2. The task has full filesystem access.
  3. The requested action is a local service/application restart, not a deletion or broad destructive operation.
  4. The local project/cleanup instructions do not forbid service startup.
  5. The restart is rejected before execution with only blocked by policy.
  6. 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:

  1. Execute the command.
  2. Ask the user for an explicit one-time approval if a separate protected-operation rule applies.
  3. 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

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

  1. added
    bug
    app
    windows-os
    sandbox
    on Sep 5, 2026
  2. github-actions commented on Sep 5, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  3. windPeng1231231 commented on Sep 8, 2026

    @windPeng1231231

    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 $bridgePid and Start-Process -WindowStyle Hidden with 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):

    exec_command failed: CreateProcess {
      message: "Rejected(\"... rejected: blocked by policy\")"
    }
    

    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 with never there 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 only blocked 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.

  4. Josh-Gamer commented on Sep 11, 2026

    @Josh-Gamer

    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:

    • Windows dangerous-command results are collapsed into DangerousCommandMatch::Other in is_dangerous_command.rs.
    • exec_policy.rs renders that category as blocked by policy.
    • The orchestrator forwards the forbidden requirement as a string rejection.

    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.

    Field Contract
    schema_version 1.
    stage, decision pre_execution, forbidden for this slice.
    source execpolicy only when established by the emitting component; otherwise unknown.
    reason_code Closed categories: policy_rule_forbidden, approval_unavailable, or unknown. Describes the decision cause.
    match_category Separate closed classification category, initially powershell_url_launch_pattern, forced_rm, other_dangerous_pattern, or unknown. A heuristic match is not a finding that the command is malicious.
    parser_path lowered_commands, whole_invocation_fallback, not_applicable, or unknown, from the actual evaluation path.
    approval_policy Normalized enum from the effective request configuration, or unknown; no configuration dump.
    diagnostic_ref Fresh opaque identifier for this decision, reused in its local diagnostic event and error rendering; not a command hash, session ID or credential.

    An 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

    1. Preserve the classification category when the existing predicate matches. A compatibility boolean wrapper can retain current callers. Preserve branch order; do not infer a PowerShell launch category from every Windows true result.
    2. Carry actual parser provenance and the decisive policy evaluation into the diagnostic record. Do not rerun a different classifier solely to explain a completed decision. If causal provenance is missing, report unknown.
    3. Carry optional typed metadata through the internal forbidden/rejection path. Add a sanitized event to the existing local logging infrastructure and a short reason to the existing tool-facing error. This first slice does not require a new public RPC schema.
    4. Keep recognizable rejection wording and the existing message-size limit. Older consumers can receive text; clients without diagnostic metadata use the current fallback. Logging/rendering failure must leave the denial intact and must not start the command.

    Example human-readable addition:

    Blocked before execution: the PowerShell URL-launch heuristic matched, and approval policy is never. This classification may be a false positive. Diagnostic ref: ...

    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.

    Case Required assertion
    Nested Python/here-string fixture and safe controls from #40060 Before/after decisions match the same baseline for each actual parser/platform path. Capture accurate metadata where available; do not call the known false positive fixed.
    Actual URL-launch patterns and existing forced-delete fixtures Existing protection and specific messages remain effective; classification categories identify only the predicate that matched.
    Explicit forbidden rule plus a heuristic-looking command The decisive rule source wins; no fabricated rule ID or classifier causality.
    Same fixture under supported approval modes Allow/prompt/forbid outcomes are unchanged; a prompt is not recorded as a denial. Preserve applicable granular-policy behavior.
    Error propagation through the tool boundary Category, source and diagnostic reference survive to the bounded final error/local event; pre-execution denial starts zero processes and causes zero retries.
    Dummy secrets, URLs, paths, patch text and long/multibyte inputs No canary leaks into the new payload or final diagnostic rendering; output remains within the existing cap.
    Missing metadata, unknown categories, logging/formatting failure and concurrent calls Safe fallback; original denial preserved; one reference per decision, with no cross-call attribution.

    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.

  5. zhiqiangtang9215-ship-it commented on Sep 24, 2026

    @zhiqiangtang9215-ship-it

    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.

  6. eaglejl commented on Sep 24, 2026

    @eaglejl

    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

    • Windows 11; installed desktop package version 26.917.8451.0 (identified from the executable/package path).
    • At the affected invocation, the local execution log records approval_policy=Never and sandbox_policy=DangerFullAccess.
    • The intended action was PowerShell Start-Process -WindowStyle Hidden launching 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.
    • The tool rejected the request before process creation with this error structure (private command arguments omitted):
    exec_command failed: CreateProcess ... rejected: blocked by policy
    

    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

    • Static PowerShell parsing of the original command: no syntax errors.
    • Official CLI execpolicy check against the user's rule file: {"matchedRules":[]}. This only tests that supplied rule file, not all internal/cloud policy layers.
    • The documented Windows system requirements.toml, legacy user managed_config.toml, and workspace/drive-root project config files were absent.
    • Read-only indexed queries of a short execution-log time window exposed the effective approval/sandbox modes, but not the specific rule or deciding component.
    • No permission, rule, ACL, or network configuration changes, alternate execution channel, or repeated unchanged launch attempts were used to bypass the denial.
    • This is an observed affected-session report, not a clean-profile minimal reproducer. The specific classifier described in Windows execpolicy false positive when Start-Process and an unrelated URL appear in the same PowerShell script #40060 has not been established as the cause here.

    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:

    method=feedback/upload
    errorCode=-32603
    failed to upload feedback: Sentry rejected feedback upload with HTTP status 403 Forbidden
    

    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.

  7. eaglejl commented on Sep 24, 2026

    @eaglejl

    Follow-up to my report above: a static comparison now narrows the likely cause, without executing or reformulating the denied command.

    1. Recovered the original September 23 13:18 UTC tool payload locally and parsed its PowerShell AST as data only:

      • syntax errors: 0;
      • Start-Process command nodes: 1;
      • HTTP URL inside that Start-Process command extent: false;
      • Invoke-WebRequest command nodes: 2, containing loopback HTTP URLs used for subsequent checks.
        No command was executed during this analysis; no private payload is attached.
    2. The currently installed runtime reports codex-cli 0.155.0-alpha.16.3. In the corresponding public tag:

    This makes #40060 a concrete candidate explanation for our command structure and effective never mode, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appbugsandboxwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions