openai / openai/codex

Windows: exec_command rejected by policy before PowerShell starts.

Open
#44,839 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug CLI sandbox tool-calls windows-os
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

What version of Codex CLI is running?

0.153.4

What subscription do you have?

ChatGPT Pro

Which model were you using?

gpt-6-astra; reasoning effort: xhigh

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

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

Windows PowerShell 5.1.26100.9168

Codex doctor report
Not collected. No codex doctor --json report is available.
What issue are you seeing?

Preserved error fragments:

Script failed

Wall time 0.0 seconds

exec_command failed: CreateProcess

rejected: blocked by policy

No child PID or exit code was returned.

The error renderer itself truncated the embedded command with:

…7753 chars truncated…

The complete original tool request is preserved separately

What steps can reproduce the bug?

Uploaded thread: 01a08112-9bf0-7023-b0be-4f0267e588cf

What is the expected behavior?

If the operation is permitted by the active policy, the static checks and SelfTest should execute.

If it must be rejected, Codex should provide an actionable user-facing explanation identifying the responsible policy layer and the supported next step,
if one exists.

The generic "blocked by policy" response does not explain this rejection. This report does not request disabling security controls or bypassing a
restriction.

Additional information
  1. Windows Codex 0.153.4 was running with approval_policy=Never and sandbox_policy=DangerFullAccess.
  2. The agent submitted tools.exec_command through code-mode exec. The 7,330-character PowerShell command requested static script checks, Invoke-
    TestPublisherSigning.ps1 -SelfTest, and report writing. It did not invoke -OwnerRun or signing.
  3. The tool returned CreateProcess rejected: blocked by policy before PowerShell process creation. No child PID or exit code was returned.

Time: 2026-09-11T10:21:09Z
Call ID: call_8quUqwBQdqyaKjiJmWuWUnL6

The original request and response are preserved. No standalone minimal reproducer has been established, and the rejected operation was not retried.

Read-only policy analysis used the installed Codex execpolicy check, the original command as data, and the existing user default.rules file.

Exit code: 0
stdout: {"matchedRules": []}
stderr: empty

This did not execute the target command. It covers only the supplied rule file, not every runtime policy layer, and does not establish permission to
retry.

Feedback was recorded without logs.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the tools.exec_command runtime policy path on Windows and compare its rejection with the installed Codex execpolicy check, which reported no matches in the user default.rules file. Use the preserved original command and PowerShell SelfTest request to isolate a minimal reproducer; done means identifying the responsible policy layer and returning an actionable explanation or supported next step.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, rust
Domain
cli, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.