Repository navigation
Description
What version of Codex is running?
codex-cli 0.25.0
Which model were you using?
gpt-5
What platform is your computer?
Microsoft Windows NT 10.0.26100.0 x64
What steps can reproduce the bug?
Simply use Codex in a basic way on Windows. It uses PowerShell for almost all operations (reading file contents, searching for files, enumerating directories) and asks for permission for every operation. Telling it to stop asking for permission has no effect.
Here is a screenshot example:
What is the expected behavior?
It should be able to perform basic harmless operations within the current directory and its subdirectories, such as reading files, scanning directories, and searching for text without asking permission for each operation.
Also, explicitly prefixing every operation with "powershell -NoProfile -Command ..." is fairly weird.
What do you see instead?
✔ You approved codex to run powershell -NoProfile -Command 'rg -n -S -e "gamelist" -e "recentlist" -e "recentList" -e "gameList"
src' this time
✓ ⌨️ powershell -NoProfile -Command 'rg -n -S -e "gamelist" -e "recentlist" -e "recentList" -e "gameList" src'
✔ You approved codex to run powershell -NoProfile -Command 'Write-Output "Opening gameListSlice.ts to inspect fetch functions
and triggers."; Get-Content -TotalCount 350 src/stores/slices/gameListSlice.ts' this time
✓ ⌨️ powershell -NoProfile -Command 'Write-Output "Opening gameListSlice.ts to inspect fetch functions and triggers.";
Get-Content -TotalCount 350 src/stores/slices/gameListSlice.ts'
✔ You approved codex to run powershell -NoProfile -Command 'Get-Content src/stores/slices/gameListSlice.ts -TotalCount 1000 |
Select-Object -Index 0..999' this time
✗ ⌨️ powershell -NoProfile -Command 'Get-Content src/stores/slices/gameListSlice.ts -TotalCount 1000 | Select-Object -Index
0..999'
Select-Object : Cannot bind parameter 'Index'. Cannot convert value "0..999" to type "System.Int32". Error: "Input string
was n
ot in a correct format."
At line:1 char:88
+ ... lices/gameListSlice.ts -TotalCount 1000 | Select-Object -Index 0..999
+ ~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Select-Object], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.SelectObjectCommand
✔ You approved codex to run powershell -NoProfile -Command '(Get-Content src/stores/slices/gameListSlice.ts -Raw)' this time
✓ ⌨️ powershell -NoProfile -Command '(Get-Content src/stores/slices/gameListSlice.ts -Raw)'
✔ You approved codex to run powershell -NoProfile -Command '$content = Get-Content -Raw src/stores/slices/gameListSlice.ts;
$content.IndexOf('"'loadAllGameLists'); "'$content.Substring(0, [Math]::Min($content.Length, 2000))' this time
✓ ⌨️ powershell -NoProfile -Command '$content = Get-Content -Raw src/stores/slices/gameListSlice.ts;
$content.IndexOf('"'loadAllGameLists'); "'$content.Substring(0, [Math]::Min($content.Length, 2000))'
? Codex wants to run powershell -NoProfile -Command '$content = Get-Content -Raw src/stores/slices/gameListSlice.ts; $start =
$content.IndexOf('"'loadAllGameLists'); "'$content.Substring($start, [Math]::Min(2400, $content.Length - $start))'
▌Allow command?
▌ Yes Always No, provide feedback
▌ Approve and run the command
Additional information
Unfortunately Codex-cli is unusable on Windows like this.
As an aside, I am using Claude Code extensively and Gemini-cli occasionally on the same Windows setup, and they work fine.
Activity
vthorsteinsson commentedon Aug 29, 2025
Even writing output to the conversation requires permission!
...and the PowerShell invocations more often than not fail because vertical pipes or parentheses are not quoted or backslash-escaped correctly. Then you need to approve them twice!
rwjdk commentedon Aug 29, 2025
@vthorsteinsson If you dare, then /approval and choose Full Auto then you are only asked about applying pacth code (which is a bug as it happen even if you run dangerous sandbox mode)... Making it better for now
rodrigo-web-developer commentedon Aug 29, 2025
Same problem with codex-cli
0.27.0.There's not sense on confirming every shell command. Makes codex an useless extension because you still need a manual interaction.
Even if I set approvals to never, it still asking permission for each command, even if I choose "Run always".
BTW, I think prefix
powershell -NoProfile -Commandis very weird too.I just set to
Agent (full access)in VS Code and it works, but I dont think is the best option.gt732 commentedon Aug 30, 2025
Same thing happens to me in windows and WSL. Even adding the commands to “safecommands” in the confit file does nothing. I have to approve every single command. 🙁
Sing303 commentedon Aug 31, 2025
Made a PR to fix #2988
desmondkr commentedon Aug 31, 2025
TL;DR "--yolo"
I had the same issue even using "--full-auto" and set "/approval" to "Full Access"
When using "--yolo" I don't get asked to allow a command. I just get asked to apply changes to e.g. a script file. Might help a bit. In Gemini CLI with "--yolo" I don't even have to approve changes to files.
https://www.reddit.com/r/OpenAI/comments/1n4gk3w/how_to_adjust_permissions_in_codex_so_i_can_stop/
DynamicCE commentedon Sep 1, 2025
same issue
DennisJansenDev commentedon Sep 1, 2025
Yeah same issue, basically useless, I can do research and write code by myself faster than this.
Oren-T commentedon Sep 1, 2025
Also having this issue and it is totally useless to me right now.
angeloprado commentedon Sep 2, 2025
someone please merge the PR
jdiago-passerelle commentedon Sep 2, 2025
Same with the VS Code extension, need to approve every single tool call
rben01 commentedon Sep 3, 2025
I need to approve every shell command in the VSCode extension on macOS, even when I select “run every time”
shurkanTwo commentedon Sep 3, 2025
I also have the same issue.
For me the extension also doesn't seem to load my configuration.
I have this in project specific settings.json and in global vs code settings.json:
{ "chatgpt.config": { "approval_policy": "never", "shell": "C:Program FilesGit\bin\bash.exe" } }I also thried to configure it in settings.toml globally but still no effect.
But still when checking in the session files it always says the following. Even after reloading and restarting VS Code:
<approval_policy>on-request</approval_policy>pwsh.exe
61 remaining items
etraut-openai commentedon Nov 19, 2025
For the past two weeks, we've been testing and refining a new Windows-native sandbox implementation for the Codex CLI and IDE extension. Today, we've released new versions of the CLI (0.59.0) and extension (0.4.44, or pre-release 0.5.44) that incorporate the latest bug fixes for this feature. The new Windows sandbox is still considered "experimental", but we think it's ready for broader use, and we welcome you to give it a try. For more details, refer to this documentation. With the new sandbox enabled, you should see far fewer approval requests.
Today we also announced a new model: GPT-5.1-Codex-Max. In addition to being more token efficient and able to solve longer-horizon problems, it also has improved support for Windows code generation and tool usage. Give it a try, and let us know what you think.
fschieber88 commentedon Nov 19, 2025
I have been using codex-cli with the Terminal app on Windows 11 and gpt-5.1-codex-max for the past hour and the difference compared to before is night and day. It now just works! Navigating folders, running commands, reading, creating and editing files. It just works! Thank you
nos1609 commentedon Nov 20, 2025
@etraut-openai Did I got it right by the Windows sandbox mode you mean this one?
https://learn.microsoft.com/ru-ru/windows/security/application-security/application-isolation/windows-sandbox/
Looks like these are related #6521
etraut-openai commentedon Nov 20, 2025
@nos1609, no that's not the sandbox I'm referring to. The codex team has implemented a sandbox mechanism that leverages restricted tokens in the Windows kernel to provide write protections for file system locations outside of your working directory. You can read more about it here.
etraut-openai commentedon Nov 20, 2025
With the new Windows sandbox now ready for broad use, I'm going to mark this issue as closed. There are undoubtedly many additional improvements that we still need to make for codex on Windows. Many of these are already reported as open bugs. If you see further issues with Windows tool permissions or sandboxing, please open new issues with repro steps and additional details. That will help us focus our attention on the most important issues.
matt-lohkamp-pa commentedon Nov 21, 2025
For what it's worth, while the update did help to significantly reduce the number of 'allows' you need to click through on windows, I feel like "Allow this session" can't be functioning as intended. As an example from today -
each of these 'edited' entries marked in blue asked for confirmation, and each one I answered with 'Allow this session' - but what exactly am I allowing, given that the next request, often to edit the same file, just results in another nag to grant permission?
this is using the codex plugin in vscode:
Identifier: openai.chatgpt
Version: 0.4.46
Last Updated: 1 day ago
Size: 125.90MB
is this still expected behavior? because it feels like it's checking in too often Claude might have asked once at the beginning of the process, or maybe even once per file, but would not have bugged me over and over again every time it wants to make an edit to the same file, especially not once I'd already granted it permission for the session.
BlueMond commentedon Dec 8, 2025
I'm being asked for approval for file edits within the sandboxed workspace even though I am in the "Agent" mode. "Allow this session" also doesn't seem to work; It will continue to ask for permission for file edits, even after clicking that option. Hopefully I'm not misunderstanding either of these functionalities, but this was previously resolved and has only recently become an issue again.
etraut-openai commentedon Dec 8, 2025
As I mentioned above, if you see further issues with Windows tool permissions or sandboxing, please open new issues with repro steps and additional details. That will help us focus our attention on the most important issues. Thanks!
I'm going to lock this issue to prevent additional posts.