Codex keeps asking me to approve the same command
Open 💬 2 comments Opened May 23, 2026 by Msirkovsky
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of the Codex App are you using (From “About Codex” dialog)?
codex-cli 0.133.0
What subscription do you have?
Plus
What platform is your computer?
_No response_
What issue are you seeing?
I keep getting requests to approve Get-Content (p).
When I hit "Yes, and don't ask again for commands that start with Get-Content (p)", I get the very same request again a few seconds later.
What steps can reproduce the bug?
Start Codex on Windows 11
Ask Codex to inspect a file repeatedly
Approve:
"don't ask again for commands starting with Get-Content"
Within a few seconds the same approval appears again
Happens consistently in PowerShell terminal
What is the expected behavior?
To store this approval somewhere so it doesn't keep asking
Additional information
_No response_
2 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Solution: Codex #24199/#24198 — Windows Sandbox Approval Systemic Issues
Issue Summary
GitHub: openai/codex #24199 and #24198
Title: Windows sandbox approval rules don't generalize — same command repeatedly asks for approval; PowerShell wrapper commands not recognized
Labels: bug, windows-os, sandbox
Competition: Low (1 comment, no PRs)
Quote: $3,000-$5,000 (bundled fix)
Root Cause Analysis
Primary Root Cause: Command Normalization Failure on Windows
The sandbox approval system on Windows fails to recognize identical commands across multiple invocations because it compares commands at the raw string level rather than at the normalized/semantic level. This is particularly severe on Windows due to:
powershell -Command ...orpwsh -Command ...), which the sandbox doesn't unpack before comparison.C:\path,C:/path,c:\path,\\?\C:\path, short names likeC:\PROGRA~1).python,python.exe,C:\Python39\python.exe, andpymay all resolve to the same executable but are treated as different commands.Failure Chain
Root Cause Details
Issue #24199: PowerShell Wrapper Not Unpacked
When Codex executes commands on Windows, it often wraps them in PowerShell:
The sandbox captures the outer
powershellcommand but doesn't extract and normalize the inner<actual_command>. This means:powershell -Command "dir"andpowershell -Command "dir "(trailing space) are treated as differentpowershell -NoProfile -Command "dir"andpowershell -Command "dir"are treated as differentIssue #24198: Same Command Repeatedly Asks for Approval
Even without PowerShell wrapping, the approval system fails to recognize identical commands because:
Evidence Pattern
| Signal | Interpretation |
|--------|---------------|
| Same command re-prompts | Approval key mismatch — normalization failure |
| PowerShell commands always prompt | Wrapper not unpacked before comparison |
| Works on Linux, fails on Windows | Windows-specific path/command format variations |
| Different quote styles cause mismatch | Raw string comparison without normalization |
Proposed Fix
Fix 1: PowerShell-Aware Command Unpacking
File:
codex-rs/core/src/sandbox/command_normalizer.rs