Skip to content

Codex on Windows rejects an authorised command with “blocked by policy” but gives no reason or recovery action #56722

Open

Description

@clanmacarthur

Summary

Codex desktop on Windows rejected an authorised operation before PowerShell started. The error says “blocked by policy” but does not identify the blocking rule or explain how to resolve it.

I am reporting the missing explanation and recovery guidance. I am not asking to bypass security controls.

Environment

  • Codex desktop on Windows, using PowerShell.
  • Incident: 24 October 2026, approximately 13:09 UTC.
  • Tool: exec_command.
  • Effective settings recorded for the attempt: approval_policy=Never and sandbox_policy=DangerFullAccess.
  • Exact desktop version was not captured in the evidence reviewed.

Intended operation

Replace one specific idle local Node.js background program with a checked replacement.

The submitted command included checks of the existing process’s identity, readiness, active connections and saved receipt files before stopping it. It would then start the replacement with separate output logs.

Actual result

The tool returned this error before execution:

“exec_command failed: CreateProcess … rejected: blocked by policy”

The ellipsis above omits private command details.

  • Rejection occurred in approximately 0.1 seconds.
  • No shell output or execution-session identifier was returned.
  • No policy-rule identifier or actionable explanation was provided.
  • A subsequent read-only check confirmed the original process remained running and no replacement log files existed.

Investigation already performed

  • A nonexecuting “codex execpolicy check” against the accessible local rules and known PowerShell wrapper returned exit code 0 with matchedRules: [].
  • This does not establish what the complete effective policy allowed.
  • Inspection of 182 app-server log entries for the affected attempt, plus relevant desktop logs, did not identify the rejecting rule, an approval request or an automatic-review decision.
  • The error truncated part of the expanded command. The original submitted script is retained privately.
  • No security settings were changed, and the refused operation was not retried through another tool.

Expected behaviour

If an operation is blocked, Codex should explain which control rejected it and provide the supported next action—or clearly state that it requires product support.

Questions

  1. Which execution layer can produce this refusal under the recorded settings?
  2. How can the applicable rule or decision be inspected safely?
  3. Is this expected enforcement or a product fault?
  4. What supported recovery action should the user take?

Personal paths, account details, project addresses, credentials and internal conversation identifiers have been omitted from this public report. Further diagnostic details would require a suitable private support channel.

Activity

  1. added
    bug
    app
    windows-os
    sandbox
    tool-calls
    on Oct 24, 2026
  2. ateliermarka25-lab commented on Oct 29, 2026

    @ateliermarka25-lab

    I observed the same symptom in a separate Codex Desktop session on Windows (29 October 2026).

    • Intended action: a user-authorized, read-only PostgreSQL metadata preflight with an interactive password prompt.
    • Tool: exec_command, attempting to launch pwsh.exe.
    • Error: exec_command failed: CreateProcess { message: "Rejected(\"…pwsh.exe…\" rejected: blocked by policy)" }.
    • The rejection occurred before PowerShell or psql started. There was no password prompt, database connection, or data change.
    • Saved tool output did not identify the matched rule, policy layer, or review action; the command text was truncated.

    Could maintainers clarify which policy layer can produce this refusal, whether it is expected or a potential false positive, and the officially supported review/authorization path? We are not asking to bypass security controls.

    All project identifiers, connection details, credentials, local paths, and session identifiers have been omitted.

  3. marcokrueger1988-sketch commented on Oct 30, 2026

    @marcokrueger1988-sketch

    A similar Windows Codex Desktop issue occurred on 27 October 2026. A user-authorized exec_command returned rejected: blocked by policy before any process started. Later, an unrelated read-only command succeeded, but the rejected command was not retried. We still have no matched rule, policy-layer identifier, or approval path. Could maintainers explain the official way to identify the reason and request a review? No private files, credentials, or session identifiers are shared here.

  4. blombera commented on Oct 30, 2026

    @blombera

    Adding diagnostics from another occurrence on 30 October 2026, including an uploaded session reference for maintainers.

    Environment

    • Windows x64: Microsoft Windows NT 10.0.26200.0.
    • Active Codex app-server daemon: 0.166.0, verified separately from the older 0.164.0 CLI on PATH.
    • VS Code terminal, Windows PowerShell.
    • Saved session metadata: approval mode never, sandbox policy {"type":"disabled"}.
    • Local configuration: approval_policy = "never", sandbox_mode = "danger-full-access", approvals_reviewer = "user".

    Observed failure

    An explicitly authorized operation to publish a member-vote-only Discord poll in a testing server and refresh its local bot process was rejected before PowerShell started:

    exec_command failed: CreateProcess ... Rejected ... blocked by policy
    

    The ellipses omit the private command, not an explanatory rationale. No matched rule, policy component, or supported approval action was returned.

    The daemon log records rejections at:

    • 2026-10-30T18:31:52.459890Z
    • 2026-10-30T18:36:10.311856Z
    • 2026-10-30T18:38:12.959403Z

    Read-only diagnostics

    • /approve reports no recent Auto-review denials in this thread.
    • The inspected user rule file contains nine allow rules and no prompt or forbid rule.
    • Checking the exact last rejected command against that file with the active 0.166.0 execpolicy check returns exit code 0 and {"matchedRules":[]}.
    • That result only covers the supplied local file; it does not establish what the complete runtime policy permits.
    • No requirements.toml was found in the user Codex directory or the documented Windows system location.
    • The daemon log repeats the generic rejection without an additional explanation.
    • Independent read-only Discord checks succeeded for bot authentication and the required channel permissions.

    No security-policy settings were changed during diagnosis. The exact rejecting rule and whether this is intended enforcement or a defect remain unknown.

    Uploaded thread: 01a18b6f-b604-7fe3-8a01-b6b6e71ba8d7 (the reference was prefilled by the feedback issue link).

    Could maintainers identify the rejecting component/rule for this uploaded occurrence and provide the supported resolution or review path? A diagnostic reason would also prevent this error from being incorrectly described as an Auto-review denial.

    This public comment contains no bot token, private project files, server/channel IDs, or raw session logs.

  5. SIGMA-CORE-AI commented on Nov 3, 2026

    @SIGMA-CORE-AI

    Additional Windows incident — November 3, 2026

    I encountered the same exec_command failed: CreateProcess / rejected: blocked by policy error in Codex desktop on Windows.

    Environment

    • Windows 11 Home 25H2, build 26200.9711
    • npm Codex CLI 0.162.1
    • Desktop-bundled Codex CLI 0.166.0-alpha.5.1
    • Incident timestamp: 2026-11-03 03:49:54 UTC

    Attempted operation

    An explicitly operator-authorized, non-model MXC sandbox qualification probe using temporary synthetic fixtures.

    Observed behavior

    The execution tool rejected the request before PowerShell started.

    The visible error contained exec_command failed: CreateProcess, Rejected(...), and rejected: blocked by policy.

    No process started. No model invocation, sandbox test, fixture creation, repository modification or security configuration change occurred.

    The response did not include a matching policy rule, enforcement component, decision identifier or supported resolution procedure.

    Previous diagnostics

    A separate Windows Codex sandbox diagnostic had recorded a historical ACL setup-refresh failure involving Windows sharing violation 32 on node_repl.exe. However, the attempted MXC probe never reached execution, so no causal connection between these observations is established.

    OpenAI Help Center’s automated support assistant suggested execpolicy or managed configuration as possible explanations but could not verify the actual enforcement layer. It also clarified that codex execpolicy check would not diagnose every Windows sandbox or operating-system policy denial.

    Questions for maintainers

    1. Which component produces this particular CreateProcess / blocked by policy rejection?
    2. Is there a supported way to identify the exact matching rule or decision for the rejected request?
    3. Can codex execpolicy check diagnose this failure, or is another officially supported diagnostic required?
    4. What is the appropriate resolution or escalation procedure when operator authorization exists but the execution tool denies the process without further explanation?

    I am requesting improved diagnostic visibility and a supported resolution, not instructions to bypass execution restrictions.


    Additional diagnostic reference for my November 3, 2026 Windows incident:

    The same execution-policy rejection has now been submitted through ChatGPT’s official Bug feedback form.

    Feedback ID: f0dd9669-129f-426a-b4fe-5fb7528b94a0

    Please use this reference to correlate the feedback submission with the incident reported above, if supported.

    The enforcement component and governing rule remain unidentified. No further blocked-command retries or security-policy changes have been attempted.

  6. daleelbalady commented on Nov 4, 2026

    @daleelbalady

    Also affected on Windows desktop app package 26.1027.6604.0, ChatGPT Plus. Specific shell operations were recorded as rejected before PowerShell started with "blocked by policy", while other PowerShell/Git commands and read-only SSH operations succeeded.

    Feedback successfully submitted: 01a1a6b7-bc30-7262-80a0-cf532fcaa257

    The retained records cover a combined bundle/SCP attempt on November 2 and separate local-preview startup and generated-artifact cleanup refusals. Exact timestamps and full original tool envelopes were not retained. A November 4 review of the transfer refers to the same November 2 event, not another attempt.

    The later session reports danger-full-access and approval policy never; this does not establish the settings at the time of the historical refusals. No matching local deny rule or review identifier was found in the available evidence. The original conversation is closed; rejected operations were not retried or routed through another tool.

    Could maintainers use the Feedback ID to identify the enforcing component and provide the supported review/recovery procedure? We are not asking to bypass security controls. No private project files, server addresses, credentials, or raw logs are included here.

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

    appbugsandboxtool-callswindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions