Skip to content

Windows: validation commands rejected with ‘blocked by policy’ without an actionable diagnostic #46012

Open

Description

@DPerryII

What version of Codex CLI is running?

0.154.0-alpha.6.2 (from /status)

What subscription do you have?

CLI /status reports Pro Lite

Which model were you using?

gpt-6-astra; reasoning xhigh

What platform is your computer?

Windows, native PowerShell. Exact Windows build and architecture were not collected.

What terminal emulator and version are you using (if applicable)?

PowerShell session; terminal emulator and version were not recorded.

Codex doctor report

Not run. This report uses existing rejection records and read-only diagnostics; no fresh reproduction or validation retry was attempted.

What issue are you seeing?

Two intended validation commands were rejected before process execution. Both errors reported the following excerpt (the original command representations were truncated):

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

No enforcing component, matched rule ID, approval identifier, or specific rationale was exposed. I cannot determine the permitted corrective action from the error.

The requested checks were PowerShell AST parsing of proposed setup/launch text without invoking it, followed by a separate TOML parse, compile-only check of embedded Python, JSON/UTF-8 transport checks, and read-only comparison with a preserved configuration. No setup, launch, or candidate validation occurred through these rejected calls.

The raw error does not establish that Auto-review caused either rejection. Earlier assistant wording attributed the failures to Auto-review; that attribution has been withdrawn as unsupported. The current fork's /approve command reports no recent Auto-review denials.

I am requesting diagnosis of the existing events, not an override or retry.

What steps can reproduce the bug?

Uploaded thread: 01a0aba9-3f3c-7b61-83ce-a21a15159b22

Historical sequence only; no minimal reproduction has been rerun:

  1. In the original Windows CLI task, functions.exec constructed seven proposed PowerShell blocks as text and dispatched an in-memory PowerShell AST parsing command through exec_command. The outer dispatch was:
    text(await tools.exec_command({cmd:command,max_output_tokens:3500}));
    The nested command was rejected before process execution.
  2. An intervening functions.exec submission failed locally with JavaScript SyntaxError: Unexpected token 'import'. It dispatched no nested command and is a separate event, not a policy rejection.
  3. A subsequent functions.exec submission dispatched the separate TOML/Python/transport/configuration checks:
    text(await tools.exec_command({cmd,max_output_tokens:2500}));
    That nested command was also rejected before process execution.

Original event identifiers (2026-09-16, UTC):

Check Rejection timestamp Outer tool-call ID Broker cell / nested call
PowerShell AST parsing 17:15:50.486622Z call_c11dprh24vTadPsHtK8Csf2C 607 / tool-1 (exec_command)
TOML/Python/transport checks 17:17:32.434604Z call_qTeYCyviZJJnL6ZSV2UuHCiv 609 / tool-1 (exec_command)

Original task: 01a0a81e-f14a-7091-9c70-7eb81936a761
Original turn: 01a0ab2d-07ea-79b1-acca-bf3e7703b109
Current fork/uploaded thread: 01a0aba9-3f3c-7b61-83ce-a21a15159b22

The original error representations omitted 58,371 and 25,334 characters respectively. The retrieved JavaScript wrappers reference stored payloads through load(...), so those wrappers alone are not complete expanded command payloads.

What is the expected behavior?

For a blocked command, provide an actionable diagnostic identifying the enforcing policy component and matched rule or a correlation identifier that allows support to determine them. Respect all existing protections.

Please clarify:

  • Which component and rule rejected each call?
  • Did approval_policy = "never" contribute, or was another restriction responsible?
  • What supported corrective action, if any, permits the intended validation while retaining the existing protections?

I am not asserting that the commands should have been allowed, and I am not requesting that protections be disabled.

Additional information

Current diagnostics:

  • /status: permission profile astra-aos1-r01-p02, workspace with network access, approval policy never.
  • /debug-config: packaged defaults, system config, global user config, user astra-aos1-r01-p04.config.toml, then session flags.
  • Reported requirements: none.
  • Session flags shown: log_dir and model_reasoning_effort = "xhigh".
  • The preserved p04 configuration explicitly sets default_permissions = "astra-aos1-r01-p02" and approval_policy = "never". The p02 label is therefore consistent with the p04 file name.
  • Current settings do not independently prove the effective settings at rejection time.

Read-only inspection found both original errors in the configured codex-tui.log, at lines 56752 and 56940. The reporting module is codex_core::tools::router; this identifies where the error was logged, not the enforcing policy component. Nearby broker records corroborate the call IDs and cells above but expose no policy rationale.

Nearby execution_started=true fields refer to the outer functions.exec handler; they do not establish execution of the rejected PowerShell commands.

The project uses synthetic data. The prior run and candidate remain preserved. Validation remains paused. No rejected validation operation was retried during troubleshooting, and no permission/configuration change was made to bypass the rejection. Account email, personal filesystem prefixes, and full transcript contents are omitted from this public report.

Activity

  1. added
    bug
    on Sep 16, 2026
  2. added
    CLI
    windows-os
    sandbox
    tool-calls
    on Sep 16, 2026
  3. victorccaldas commented on Sep 17, 2026

    @victorccaldas

    Same root cause as #41779. I posted a full analysis there rather than duplicate it:

    #41779 (comment)

    Short version: the classifier already knows which Windows heuristic matched, then collapses every match into a single Other variant, which renders as blocked by policy. The information is computed and then discarded, so the message can be made specific without changing any allow/deny decision. There is a reference implementation and test evidence linked in that comment.

  4. Crrbachi commented on Sep 28, 2026

    @Crrbachi

    Additional Windows desktop occurrence. I am requesting an actionable diagnostic and supported recovery path, not a policy bypass.

    Environment: Windows 11; desktop app 26.924.2738.0; bundled backend codex-cli 0.158.0-alpha.2.1. A separate CLI on PATH is 0.139.0. The affected work was local to a private repository; its name, paths and transcripts are intentionally omitted.

    Two different local validation requests through functions.exec → exec_command were rejected before process creation with only CreateProcess ... rejected: blocked by policy, without a matched rule, reviewer rationale, or action ID in the tool output:

    1. 2026-09-26 17:41:52 UTC: a PowerShell wrapper prepared hash checks, a bounded read-only Codex CLI subagent smoke, and a 90-second process cutoff. Nothing in that rejected request ran. A later direct invocation did run but was invalid for this project's gate, so it is not claimed as recovery.
    2. 2026-09-27 11:34:22 UTC: a PowerShell wrapper prepared a temporary local copy, three modes of a Node validation CLI, and cleanup of that copy. The rejected request did not run. Unit tests, build and independent static audit of the candidate passed separately; the affected CLI check remains NOT_RUN.

    The UI item may contain additional information; this report does not infer that Auto-review caused the rejection. Official documentation says Auto-review only applies when approval is interactive, whereas the task context used approval_policy=never.

    Could maintainers identify which component rejected the requests, expose the matched rule/reason/action ID to the agent and user, and specify a supported way to complete the intended local validation? We will not retry equivalent commands through another shell, tool, actor or permission mode without a documented route. I can provide a sanitized session identifier or further redacted diagnostics through an appropriate private channel.

  5. Crrbachi commented on Sep 28, 2026

    @Crrbachi

    Additional diagnostic identifiers from a bounded, read-only review of local logs:

    • 2026-09-26 17:41:52.709 UTC — call call_Y9963B8gSFM3VjTd6MVebTlE
    • 2026-09-27 11:34:22.039 UTC — call call_bVKtBrX1en96i9HzreUNSdGL

    Both calls returned exec_command failed: CreateProcess ... rejected: blocked by policy before a process was created. The inspected structured history and nearby local engine logs did not expose a separate action ID, matched rule, deciding component, or detailed reason. This is limited to the local records reviewed; I am not inferring the cause. Could maintainers correlate these call IDs and timestamps with the decision and advise the supported recovery path? I have omitted command text, repository details, personal paths, and transcripts.

  6. markchandlerjr commented on Sep 28, 2026

    @markchandlerjr

    Additional occurrence involving local documentation writes on Windows. User-authorized report; private business documents, local paths, and full transcripts are omitted.

    Environment

    • Windows 11 Pro, version 10.0.26200, 64-bit.
    • Installed desktop package: OpenAI.Codex 26.924.2738.0.
    • Bundled CLI: 0.158.0-alpha.2.1, also recorded in the affected task.
    • Original turn context recorded approval_policy="never" and sandbox_policy.type="danger-full-access".

    Observed failure

    On 2026-09-28 at 16:31:38 UTC, exec_command rejected a PowerShell here-string piped into Python, before execution:
    CreateProcess { message: "Rejected(... rejected: blocked by policy)" }
    One explicitly authorized exact-command retry at 16:50:09 UTC returned the same error.

    The command would create two local Markdown explanations, update a local Markdown index, read/hash selected source files, and write two JSON source inventories. It did not invoke Graphify, install software, launch a server, delete files, or transmit data. The approximately 13.7K-character command embedded prose and ordinary documentation links. No specific policy category, matched rule, approval item, or recovery path was exposed.

    Read-only diagnostic findings

    • Embedded Python parses successfully when treated as data, without executing it.
    • Expected new files remained absent.
    • The checked user rule file contains 95 allow rules, no prompt/deny rules. A check of the preserved full argv against that file returns matchedRules:[]; this does not cover all runtime heuristics or managed controls.
    • Other reads and some unrelated writes in the same task succeeded, including commands using the same here-string/Python shape.
    • Available local logs expose no detailed rationale. Bounded Windows AppLocker and Defender warning/error checks around the incidents yielded no corresponding events; Code Integrity events inspected concerned unrelated Chrome graphics DLLs.
    • Auto-review attribution is unverified; the original approval mode was never.
    • No security configuration was changed, no equivalent denied writes were routed elsewhere, and no new runtime reproduction was attempted during diagnosis.

    The Windows heuristic analysis linked earlier in this issue is relevant. Current upstream source maps Windows dangerous-command matches to Other and renders Other as "blocked by policy", but we have not established the exact predicate or source revision used for this incident. Similar symptoms alone are not proof of the same cause.

    Please identify the rejecting condition and a supported recovery path, or expose a specific reason/correlation identifier for this class of local documentation request. A privacy-safe reproduction can be prepared if maintainers specify what is needed.

    Incident call IDs:

    • call_wsSJkj0RNol8Tbn45h5TDM8r
    • call_0rMkLDlZW10Ulfz9iMjBIC9W
  7. Guustaa03 commented on Sep 28, 2026

    @Guustaa03

    Additional Windows CLI occurrence; feedback has been uploaded.

    Uploaded thread: 01a08c59-9002-7200-9f3c-1c3435809e15

    Latest documented rejection: 2026-09-27 at 08:15:57.639428 UTC, in that session.

    The previous local investigation recorded:

    • Codex CLI 0.157.1; the background server executable also identified as 0.157.1.
    • Windows / native PowerShell.
    • Historical context at rejection: approval_policy=never, DangerFullAccess, approvals_reviewer=user.
    • A functions.exec → exec_command diagnostic intended to read public, version-pinned Supabase CLI source and run the already installed supabase-go.exe start --help. The corrected request supplied an explicit working directory, process-local telemetry opt-outs, and plain URL strings.
    • Rejection before process creation, through a CreateProcess / Rejected error ending in blocked by policy. That request produced no HTTP results and no help output. The available error did not identify the deciding layer, matched rule, or specific rationale.

    The preserved command and working directory were checked against the session log and matched. Local inspection found 40 allow rules and no prompt/forbidden rules in the inspected user default.rules; no relevant system/project rule files were found. Checking the complete target command as data against that specific rule file returned exit 0 and matchedRules: []. This does not establish permission for actual execution or cover the server's complete decision chain.

    The client also reported “No recent auto-review denials in this thread.” The rejection therefore has not been established as an auto-review denial. No policy configuration was changed, the server was not restarted, and the rejected operation has not been retried since that latest documented event.

    Could maintainers correlate the uploaded thread and timestamp with the rejected tool call, identify the enforcing component and available reason/rule ID, and explain the supported next step for this diagnostic? Similar error text does not establish the same underlying cause as the other reports here.

    Personal filesystem paths and private project contents are omitted from this public comment.

  8. markchandlerjr commented on Sep 28, 2026

    @markchandlerjr

    Additional Windows desktop evidence from thread 01a0e124-c288-7ca3-acb7-72d6447f9922:

    Local coordination-document updates were rejected before process creation with CreateProcess … rejected: blocked by policy.

    September 28, 2026, UTC:

    • 22:06:02.493 — call_zLQOHuFHacw7Pgpo442gs7yZ
    • 22:11:03.290 — call_RvkopdrkvVFw8fRIgCsyoS4J
    • 22:33:11.260 — call_m0H9kSnp88dcWUMTCMIlDNCO

    Saved turn contexts report approval_policy=never and DangerFullAccess. Unrelated writes in the same directory succeeded. The rejection responses and bounded surrounding local logs did not expose a deciding rule or rationale.

    Typing /approve in the affected desktop chat arrives as ordinary chat text; no picker or approval confirmation appears.

    Please identify the enforcing component and provide a supported recovery path for these exact actions. We are not requesting that protections be disabled. No private document contents or raw logs are included here.

  9. TheEUF commented on Oct 8, 2026

    @TheEUF

    Additional owner-authorized Windows desktop occurrence. This is a request for an actionable diagnostic and a supported recovery path, not a policy override.

    Preserved incident window: 2026-10-04 approximately 14:47–14:50 UTC. This is a window from existing evidence, not a precise rejected-call timestamp.

    An original exec_command PowerShell request was rejected before process creation with CreateProcess ... Rejected: blocked by policy. It was intended to clear credential-related environment variable names in that process and perform bounded, read-only Git identity/status checks. The preserved result records that neither the environment clearing nor the Git checks executed. A preceding, separately authorized single-PID CIM query succeeded; that does not establish eligibility for the rejected request.

    The available error exposes no matched rule, deciding component, detailed reason, or request/action ID. The original request and error are preserved locally. No equivalent request has been retried through another shell, tool, actor, or permission mode, and no security configuration has been changed. Historical execution settings and installed version at the rejection are not independently established by this particular evidence artifact; please do not infer them from other reports in this issue.

    The current official 0.161.0 changelog mentions preserving Windows sandbox runner launch errors, but it does not establish that this pre-process policy rejection is fixed or identify its predicate.

    Could maintainers:

    1. Identify the enforcing component and exact blocking condition for this class of request, or specify what correlation metadata is needed through an appropriate private support channel?
    2. Confirm whether a released fix applies, and describe the supported recovery procedure while retaining protections?
    3. Explain how the desktop user can retrieve the actionable denial reason when the tool response supplies none?

    Personal paths, private repository contents, full command text, session transcripts, and credential values are intentionally omitted. This comment itself does not authorize or prove recovery.

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

    CLIbugsandboxtool-callswindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions