Repository navigation
Description
[Codex]
Summary
During explicitly user-authorized cleanup of a disposable Codex test worktree, some compound PowerShell commands were rejected before execution with only rejected: blocked by policy. A shorter command targeting the same directory was allowed to execute.
The affected turn's runtime logs confirm Full access was effective, not merely selected in the UI:
approval_policy=Never
sandbox_policy=DangerFullAccess
This report concerns inconsistent or unexplained command-level rejection. The exact enforcing component and rule are unknown; a classifier false positive is suspected but not established.
Environment
- Observed: 22 October 2026.
- Windows desktop package:
OpenAI.Codex 26.1016.6573.0, verified withGet-AppxPackage. - Windows:
Microsoft Windows NT 10.0.26300.0, x64. - PowerShell:
7.6.6. - App-server version logged for the affected desktop session:
0.163.0-alpha.11. - Subscription tier: not collected.
- Tool path:
functions.execcallingexec_command. - The inspected local
default.rulescontained onlyallowdecisions. This does not rule out built-in, managed, or other execution-layer enforcement.
Observed sequence
- The user explicitly requested cleanup of a test chat and its disposable worktree.
- The chats were archived. The app removed the worktree contents and Git registration. Independent read-only inspection confirmed that the remaining target directory was empty.
- Compound PowerShell cleanup scripts with emptiness guards,
Remove-Item -LiteralPath, and subsequent cleanup/status checks were rejected before the submitted script executed:exec_command failed: CreateProcess { message: "Rejected(\"<PowerShell command> rejected: blocked by policy\")" } - No matched rule, policy source, reviewer decision, action-specific rationale, or supported resolution accompanied the rejection.
- A shorter script with a literal path and the same emptiness guard was allowed to execute. Windows then returned a separate filesystem error saying the directory was being used by another process.
- Later, after that transient lock cleared, the same shorter deletion script executed successfully. The target directory is now gone; no reboot or permission/policy changes were needed to complete that deletion.
The temporary Git branch was also deleted successfully through a separate normal Git command. This was not a blanket inability to modify the repository.
Sanitized command comparison
These are excerpts from the observed calls, with private paths replaced. They have not been independently minimized or reproduced in a fresh installation.
The rejected compound script included this form, followed by empty-parent-directory cleanup and read-only Git/filesystem status reporting:
$testDirectory = '<redacted disposable worktree path>';
if (Test-Path -LiteralPath $testDirectory) {
if (@(Get-ChildItem -Force -LiteralPath $testDirectory).Count -ne 0) {
throw 'Preserve unexpected remaining files'
};
try {
Remove-Item -LiteralPath $testDirectory -ErrorAction Stop
} catch [System.IO.IOException] {
Write-Output 'The empty test directory is still locked by a process.'
}
};
# Further parent-directory cleanup and read-only status checks followed.The shorter accepted call used this form:
if (Test-Path -LiteralPath '<same redacted disposable worktree path>') {
if (@(Get-ChildItem -Force -LiteralPath '<same redacted disposable worktree path>').Count -ne 0) {
throw 'Test directory is not empty'
};
Remove-Item -LiteralPath '<same redacted disposable worktree path>' -ErrorAction Stop
};
Test-Path -LiteralPath '<same redacted disposable worktree path>'On the successful later call, the final Test-Path returned False.
Expected behavior / requested diagnostics
- Evaluate this bounded, authorized cleanup consistently with the effective permissions and applicable policy.
- If compound command structure triggers a legitimate restriction, identify the enforcing component and rule, explain why it applies, and provide a supported resolution.
- Make a pre-execution policy rejection distinguishable from an OS sharing/locking error.
- Do not label a generic policy rejection as an Auto-review decision without evidence. The assistant initially made that attribution here, then corrected it.
- Expose enough policy provenance to diagnose this without repeatedly broadening permissions or guessing at command variants.
Related reports and evidence limits
- Windows: unexplained "blocked by policy" prevents test-artifact cleanup despite effective Full Access #54610 reports test-artifact cleanup rejected under effective Full access, on another desktop version.
- Windows desktop: local service startup denied with "blocked by policy"; effective full-access configuration lacks actionable denial diagnostics #56045 reports similarly opaque denials for local service startup.
- This occurred while cleaning up a successful workaround test for [Windows] New Worktree chats fail with Cannot serialize value; Local mode works #55827; the Worktree chat serialization error is a separate symptom.
No shared root cause with those reports has been established. The exact deny rule was not found in the accessible logs. Full access is not asserted to override every possible higher-priority policy; the inconsistency and missing diagnostics are the observed problems.
No private project names, usernames, filesystem paths, account/session identifiers, credentials, full configuration files, or raw transcripts are included.
Activity
github-actions commentedon Oct 22, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
sd68515 commentedon Oct 22, 2026
Codex seems to have recently added built-in rules that require approval for some deletion operations, even under yolo/full-access permissions. Combined with
approval_policy = "never", the approval request can never be emitted, so the command is rejected before execution.
Suggested config to try:
This keeps full filesystem access but restores the approval path and routes requests to auto-review instead of suppressing them.
If the rejection still occurs with this config, it likely comes from a lower-level command classifier/rule rather than the approval layer, and the policy source needs to be exposed for diagnosis.