Repository navigation
Description
What version of the Codex App are you using?
Windows desktop; the executable used by the running app-server reports codex-cli 0.154.0-alpha.6.2. The separately installed CLI reports 0.154.0 and was not the affected execution surface.
What platform is your computer?
Windows with PowerShell 7. The active task uses approval policy never with filesystem sandbox disabled/full access. No local exec-policy rule files were loaded. Observed September 13, 2026 UTC.
What issue are you seeing?
Codex's command tool rejects PowerShell here-string data sent to Python as a forced file deletion. The command only prints two literal words. It contains no PowerShell deletion command, Python file operation, network operation, or URL.
What steps can reproduce the bug?
Submit this exact command through the Windows desktop command-execution tool:
@'
print('Remove-Item', '-Force')
'@ | python -Observed in the installed runtime: immediate pre-process rejection, approximately 0.3 seconds:
exec_command failed: CreateProcess { message: "Rejected(... rejected: blocked by policy)" }
The tool did not create PowerShell or execute Python. A separate direct literal-output control did execute and returned exit code 0:
Write-Output 'Remove-Item example.txt -Force'That control also only prints text; it requests no deletion. We did not retry a real destructive command or weaken any policy.
What is the expected behavior?
The Python command should print Remove-Item -Force. Here-string contents and external-program data must not be interpreted as PowerShell command invocations. Preserve the intended protection for actual forced deletions.
Additional information
A read-only parse with PowerShell's own AST of the original diagnostic that led to this minimized example found python as its sole command name and no PowerShell command parameters. That diagnostic was searching local logs; no deletion operation was requested.
The behavior is consistent with the public Windows safety heuristic flattening/tokenizing script text and has_force_delete_cmdlet recognizing deletion words and force flags inside rough segments, without preserving here-string/data boundaries:
This is source correlation, not an assertion that the public commit exactly built the installed executable. The rejection above was observed directly.
Related: #40060 concerns an unrelated URL plus a launch verb. This example contains no URL and no launch verb and exercises the forced-deletion/data boundary instead.
Please provide a parser-aware fix, regression tests covering literal data/here-strings, and a supported fixed release/version. Please expose a stable classifier/reason identifier and triggering span instead of only the generic policy rejection. An allow-all setting or disabled protection is not requested.
Submitted by Codex at the account owner's explicit request. No credentials, private paths, repository content, or raw session logs are included.
Activity
post1917a commentedon Oct 1, 2026
Fresh reproduction on 2026-10-01, Windows desktop, with the actual parent command runner reporting codex-cli 0.159.2. Desktop package: OpenAI.Codex 26.928.2636.0. Effective task context:
approval_policy=never,sandbox_policy=danger-full-access,permission_profile=disabled.I independently reproduced the literal-output example through the desktop
exec_commandtool. Only the Python executable path below is substituted; the Python statement and PowerShell here-string/pipeline shape are unchanged:Actual result: pre-process rejection ending in
CreateProcess ... rejected: blocked by policy. The Python statement only prints two literal words; it performs no file operation, process launch, or network request.The independent control:
ran successfully, exit code 0, and printed
Remove-Item example.txt -Force.This follows an earlier rejection of a larger here-string Python script whose purpose was to write diagnostic findings to a local coordination journal. The deletion words appeared only in diagnostic string data, not in commands submitted for execution. The small printing example above now provides a separately executed reproduction.
Read-only comparison on 2026-10-01 found identical bytes for
windows_dangerous_commands.rs,powershell_parser.ps1, andcore/src/exec_policy.rsacross the officialrust-v0.159.2,rust-v0.159.3, and then-currentmain. No newer client was installed or runtime-tested in this comparison. In 0.159.2's exec policy, a dangerous match under Never returns Forbidden; the observed error does not itself identify the classifier branch.Please preserve the distinction between PowerShell invocations and literal data supplied to another program, and add regression coverage for this non-mutating example. A stable reason and triggering span would also help. No protection setting was changed and no actual deletion was attempted in these probes.
olinkluzz1v commentedon Oct 18, 2026
I’m seeing a similar pattern in Codex desktop on Windows with PowerShell. Under Full access (
danger-full-access, approval policynever), some commands were rejected before execution with onlyblocked by policy, without identifying the matching rule.We also observed a permissions mismatch: the UI showed Full access, but a resumed turn still used
on-request/workspace-writeand displayed approval prompts.What worked for us:
Programmatically resuming the chat did not reliably pick up the changed setting in our case.
This is a workaround, not a confirmed permanent fix. We did not change security policies or disable safeguards. Possible command-parsing false positives remain unconfirmed because the rejection did not expose the matching rule.
soonong commentedon Oct 18, 2026
The same false-positive family also affects a read-only binary/string inspection in the Windows desktop runtime
codex-cli 0.163.0-alpha.10.2.Installed desktop: app
26.1013.40934, build20770, prod channel; Windows package26.1013.4894.0. The official updater reportsup_to_date. The affected turn usesapproval_policy: neverwithdanger-full-access.The observed command was rejected before process creation with
blocked by policy. It reads the Codex executable as bytes, searches for diagnostic strings, and lists cache file names. The diagnostic search array includes this literal data:PowerShell's native AST parses the exact recorded command with zero errors. Its only CommandAst names are
Get-Command,Get-ChildItem, andSelect-Object; the other operations read bytes or inspect strings. There is no deletion invocation. The rejected command was not rerun or disguised through another execution path.I compared the recorded input with the public source tag matching the executable version,
rust-v0.163.0-alpha.10.2:remove-itemand-forcetogether. The laterGet-ChildItem -Forceis not needed for the match.blocked by policy.A static JavaScript port of the tagged shlex/segment algorithm matches that same array segment. This is exact recorded-input/source correlation, not a newly instrumented or compiled Rust execution trace. Two reviewers independently checked the source chain.
The newer URL-specific change #54076 / 80b88a7 leaves this forced-deletion predicate and the opaque-script path in place; it does not address this case.
Please fix command-versus-data provenance for this path and identify the supported fixed desktop/runtime release. Please also return a specific classifier/reason and triggering span instead of the generic message. An allow-all rule or disabled safety check is not requested.
Suggested regression coverage, not newly executed shell commands:
No credentials, private file paths, application data, or raw session logs are included.
dmytro1973 commentedon Oct 26, 2026
Reproduced on 2026-10-26 against the unmodified Rust classifier from
rust-v0.163.0-alpha.11.2, commit51f97c6bca5500edbb986f6d9fe64fa2e63cbdd4.The active Windows desktop command runner reports
codex-cli 0.163.0-alpha.11.2. Desktop updater metadata reports app26.1016.62342, build21477, prod channel. A read-only diagnostic containing deletion words only as literal marker data was rejected withCreateProcess ... Rejected(... blocked by policy).I isolated windows_dangerous_commands.rs in a small Rust test crate. The source was unchanged and verified identical after writing it locally. Direct dependencies match that tag's Cargo.lock: once_cell 1.21.4, regex 1.12.3, shlex 1.3.0, url 2.5.8. Toolchain: rustc/cargo 1.93.1.
Results:
The following strings were passed only to
is_dangerous_command_windowsas synthetic argv data. None were executed by a shell.The source of
has_force_delete_cmdletremains identical in the tested tag,rust-v0.164.0, and current main. The newer independent-command path still excludes scripts containing a pipe, retaining the opaque-token fallback for this here-string/pipeline example. This newer-version comparison is source inspection only, not a desktop runtime test.Please preserve command-versus-data provenance for this path, add regression coverage for the benign examples, and identify a supported fixed desktop release. Actual deletion and dynamic execution should retain their protection.
No rejected command was replayed, no protection setting was changed, and no private paths, credentials, bank/mail data, or session logs are included.
sawbg commentedon Nov 11, 2026
Confirmed again on 2026-11-11 in the Windows desktop runtime codex-cli 0.167.0-alpha.3.2. This is a fresh, non-mutating reproduction of #45232, with matching controls and version-pinned source analysis.
Environment:
OpenAI.Codex 26.1103.7773.0; primary runtime package26.1110.778.0.codex-cli 0.167.0-alpha.3.2.10.0.26300, build26300; bundled PowerShell7.6.9; Python3.14.7.approval_policy=never, filesystem sandbox disabled/full access; configured revieweruser.Executed through
functions.execcallingexec_command, this command was rejected before process creation:Result:
exec_command failed: CreateProcess ... rejected: blocked by policy.The otherwise equivalent control succeeded with exit code 0:
A separate literal-output control also succeeded:
PowerShell's native
Parser.ParseInputreports zero parse errors and onlypythonas a CommandAst name in each here-string example. Pythonast.parsefinds only a dictionary assignment and aprintcall. These probes contain no file operation, dynamic evaluation, import, URL, or network request. No fixture was created or deleted.The matching published tag resolves to commit
c40729ea5cf8e947481b130c59807273eda2f8e9. Its source supports this explanation:powershell_commands_are_independentexcludes scripts containing a pipe; the opaque fallback remains available for here-string pipelines.parse_powershell_invocationandhas_force_delete_cmdlettokenize/segment script text without preserving this data boundary. A read-only port of the segment check matches the audit string'sremove-itemand-forceatoms together; neither control matches.Neverand prompts underOnRequest; the formatter gives WindowsOtheronly the generic rejection text.This is an observed runtime false positive plus matching-version source correlation. The installed classifier was not instrumented, and the Rust classifier was not rebuilt in this investigation.
Practical impact: following an authorized temporary-build cleanup rejection, a separate command meant only to write audit receipts was also rejected because its data described the cleanup. Repeating user authorization in chat cannot change the non-interactive policy branch. Official Auto-review documentation says Auto-review has no requests to evaluate under
never; this error should not be attributed to a reviewer verdict without evidence.Please fix command-versus-data provenance for this fallback while preserving protection for real forced deletion and dynamic execution. Add coverage for these literal-data controls, expose the matched classifier condition and triggering span, and identify the supported fixed runtime release. The rejection should also explain the supported interactive review path when applicable.
Submitted with AI assistance at the affected user's explicit request. No personal paths, project content, credentials, account/chat identifiers, or raw session logs are included. No protection was disabled, no alternative deletion executor was used, and no rejected deletion was retried during this investigation.
liuzhoucheng commentedon Nov 16, 2026
Fresh non-mutating reproduction and a follow-up approval-mode check.
At the time of the reproduction, desktop updater metadata reported app
26.1106.51428, build26605(prod). A separately invoked local binary reportedcodex-cli 0.167.0-alpha.4.1; this is not asserted to identify every component of the desktop command runner.Successful control:
A separate command was rejected before process creation:
The rejected Python program only constructs two strings and prints the list length. It has no filesystem access, deletion, network request, or child-process operation. The two programs differ in structure and output, so this is not presented as a strict single-token A/B experiment.
The complete persisted response ends with
CreateProcess ... Rejected(... rejected: blocked by policy)and the command tool displaysWall time 0.0 seconds. Both calls had the same recorded effective context:approval_policy: neverapprovals_reviewer: usersandbox_policy: danger-full-accesspermission_profile: disabledThe rejected request was submitted at
2026-11-15T16:04:34.346Z. No internal exec request ID, matched rule, decision source, or triggering span was exposed. This occurrence should not be attributed to an Auto-review verdict merely because a global default selects Auto-review.Follow-up on 2026-11-16: after selecting Ask for approval in this chat and starting a fresh user turn, the recorded effective policy was instead:
{ "approval_policy": { "granular": { "sandbox_approval": false, "rules": false, "skill_approval": false, "request_permissions": true, "mcp_elicitations": true } }, "approvals_reviewer": "user", "sandbox_policy": { "type": "workspace-write", "network_access": false } }The developer permission block explicitly states that false categories are automatically rejected. Thus the UI selection did not establish a command-rule approval prompt path in this turn. A normal workspace-only Python file read succeeded. The previously rejected sample was not rerun, disguised, or executed through another route after this change.
Please fix command-versus-data provenance for the literal-data case and expose a stable classifier/reason and triggering span. Please also document a supported desktop review path when
rules=falseprevents a command approval request from reaching the user, and identify a fixed desktop/runtime release.No protection was disabled. This report contains no usernames, private paths, project content, credentials, account/chat IDs, or raw session logs.