Skip to content

Windows: exec_command returns “blocked by policy” in Full Access without an actionable reason #52966

Open

Description

@MilosK88

What version of Codex CLI is running?

0.153.4 at the time of the rejection

What subscription do you have?

Pro x 20

Which model were you using?

Gpt 6 Astra Max

What platform is your computer?

Windows x64

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

VS Code integrated terminal, PowerShell 7.6.6.0

Codex doctor report

The output of codex doctor --json. If unsupported, enter Not available in the installed CLI.

What issue are you seeing?

Codex CLI 0.153.4 on Windows rejected a dependency-acquisition command before launching PowerShell. The only explanation was “blocked by policy,” with no actionable decision details.

The operation was acquiring the official npm package @supabase/[email protected] through Deno into a task-private cache, to qualify an application’s dependency graph. It did not request application execution, package lifecycle scripts, deployment, or access to production services.

Observed behavior

  • Tool path: functions.exec → tools.exec_command → intended PowerShell launch → intended Deno child.
  • The tool returned a CreateProcess error containing Rejected(...) and “blocked by policy.”
  • Neither PowerShell nor Deno started.
  • No process exit code, acquired dependencies, or generated lockfile resulted.
  • The stored error rendering contains the literal truncation marker “…1421 chars truncated…”. The complete submitted request remains in the session transcript.

Effective settings at rejection
approval_policy = never
approvals_reviewer = user
sandbox_mode = danger-full-access

There was no interactive approval dialog. /approve offered no actionable entry. I understand that approval_policy=never does not provide interactive approval; I am not reporting the absence of that dialog as the underlying bug.

Recorded reproduction context

  1. Run Codex CLI 0.153.4 from the VS Code PowerShell terminal.
  2. Use Full Access with the effective settings above.
  3. Have the agent submit the recorded PowerShell wrapper, which uses ProcessStartInfo and explicit argument boundaries to invoke Deno install --entrypoint for the npm candidate, with a private cache, explicit configuration/lock paths, and controlled environment.
  4. Observe the pre-spawn rejection.

This describes the recorded incident, not a separately established minimal reproduction.

Diagnostics already completed

  • Installed execpolicy check against the exact outer command argument vector returned exit 0 and {"matchedRules":[]}.
  • This establishes no match in the evaluated rules, not approval by every execution layer.
  • No relevant PreToolUse or PermissionRequest hook was found in the inspected configuration sources.
  • No managed requirements file was found at the documented local Windows location; restrictions elsewhere have not been ruled out.
  • A notification-hook error occurred after the rejection and was logged as continuing; it does not explain the pre-spawn failure.
  • Ordinary inspection and Git operations worked.
  • Available logs did not expose the responsible component, rule, reviewer, or decision reference.

Correlation details
CLI: 0.153.4
Session: 01a11aa3-dbd6-75d1-977e-ffa53ff3029e
Turn: 01a1262d-a230-71e3-a338-7f57b0af7aa7
Call: call_35c52507dcef4ba4a799834351e082c4
Request: 2026-10-10T14:19:05.808Z
Response: 2026-10-10T14:19:06.049Z

The complete request and stored response are at lines 4900 and 4902 of the affected session transcript. Please retain the uploaded-thread reference associated with this report.

Expected behavior and requested investigation
Please identify which component produced Rejected, which decision or rule it applied, and the supported remedy.

If this is an intentional restriction, please explain the applicable approval or administrator action. If this is a client defect, please identify a confirmed fix and affected/fixed versions. The current generic response provides no way to distinguish those cases.

Impact
Dependency acquisition, full SDK typechecking, and packaging qualification remain blocked. Independently verified source changes have been committed, so the remaining issue is qualification rather than Git commit functionality.

What steps can reproduce the bug?

Uploaded thread: 01a11aa3-dbd6-75d1-977e-ffa53ff3029e

What is the expected behavior?

No response

Additional information

No response

Activity

  1. added
    bug
    on Oct 10, 2026
  2. added
    CLI
    windows-os
    sandbox
    tool-calls
    on Oct 10, 2026
  3. lekyucv commented on Oct 15, 2026

    @lekyucv

    I'm using Codex on Windows with PowerShell 5.1.

    Codex rejected an authorized offline test before launching the process:

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

    The Git preflight and SHA256 verification succeeded. No test process started.

    Could you clarify which policy blocked this command and the officially supported way to resolve it?

  4. btm5200-byte commented on Oct 17, 2026

    @btm5200-byte

    Another Windows Codex case: exec_command blocked before process creation

    I'm experiencing a similar issue on Windows while using Codex for a local C# development workflow.

    Environment and incident details

    • Platform: Windows desktop
    • Tool: exec_command
    • Intended shell: Windows PowerShell
    • Incident date: October 18, 2026 (KST)
    • Exact rejection timestamp: Not available
    • Tool call ID: Not available in the retained diagnostic report
    • Error: rejected: blocked by policy
    • Detailed policy reason: Not provided

    What Codex was attempting

    The task was to prepare an isolated, non-production C# compilation and negative-test workspace.

    The rejected command attempted to:

    1. Create new src, bin, and tmp directories inside an isolated workspace.
    2. Copy two existing C# source files without modifying the originals.
    3. Create a minimal C# negative-test harness.
    4. Write a source contract file.

    No administrator elevation, production deployment, or modification of existing protected files was requested.

    Observed behavior

    • The command was rejected before process creation.
    • No process started from the rejected command.
    • No source files were created by the rejected command.
    • Compilation attempts: 0
    • Functional test executions: 0
    • Automatic retries: 0
    • Policy bypass attempts: 0
    • Existing source files modified: 0

    The tool returned only:

    rejected: blocked by policy

    Follow-up investigation

    A separate read-only investigation confirmed the blocked operation and tool name, but the actual policy rule was not disclosed.

    The apply_patch tool appears to be available for general file editing. However, I could not establish whether it is officially permitted to perform this specific source preparation task after the exec_command rejection.

    I have not attempted to bypass the restriction using another shell, encoded commands, or alternative execution methods.

    Questions for the maintainers

    1. Which policy or enforcement component rejected this exec_command invocation?
    2. Does the rejection apply only to the particular PowerShell command, or to the underlying file-creation operation?
    3. Is using apply_patch for new files in an isolated workspace an officially supported alternative in this situation?
    4. Where can I retrieve the exact denial timestamp, tool call ID, and applicable policy rule?
    5. What is the recommended way to resume this authorized development task without bypassing or weakening security protections?

    I am not requesting a security bypass. I would appreciate clarification of the applicable restriction and the officially supported way to proceed.

    Thank you.

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