Skip to content

Unusable on Windows due to permission ask for every shell command #2860

Closed

Description

@vthorsteinsson

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:

Image

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

  1. added
    bug
    on Aug 29, 2025
  2. vthorsteinsson commented on Aug 29, 2025

    @vthorsteinsson
    Author

    Even writing output to the conversation requires permission!

    ✔ You approved codex to run powershell -NoProfile -Command 'Write-Output "Searching boardSlice for game over handling and list
    refreshes."; rg -n -S -e "game over|gameover|gameState|over|time-expired|resign|timeout|end" src/stores/slices/boardSlice.ts;
    Write-Output "Open file head"; Get-Content -TotalCount 200 src/stores/slices/boardSlice.ts' this time
    

    ...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!

    ✔ You approved codex to run powershell -NoProfile -Command "rg -n -S -e \"loadAllGameLists\\(\" src; rg -n -S -e
    \"loadFinishedGames\\(\" src; rg -n -S -e \"loadOngoingGames\\(\" src; rg -n -S -e \"loadChallengeList\\(\" src" this time
      ✗ ⌨️ powershell -NoProfile -Command "rg -n -S -e \"loadAllGameLists\\(\" src; rg -n -S -e \"loadFinishedGames\\(\" src; rg -n
    -S -e \"loadOngoingGames\\(\" src; rg -n -S -e \"loadChallengeList\\(\" src"
        Missing closing ')' in expression.
            + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
            + FullyQualifiedErrorId : MissingEndParenthesisInExpression
    
  3. added
    windows-os
    on Aug 29, 2025
  4. rwjdk commented on Aug 29, 2025

    @rwjdk

    @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

  5. rodrigo-web-developer commented on Aug 29, 2025

    @rodrigo-web-developer

    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 -Command is very weird too.

    I just set to Agent (full access) in VS Code and it works, but I dont think is the best option.

  6. gt732 commented on Aug 30, 2025

    @gt732

    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. 🙁

  7. Sing303 commented on Aug 31, 2025

    @Sing303
    Contributor

    Made a PR to fix #2988

  8. desmondkr commented on Aug 31, 2025

    @desmondkr

    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/

  9. DynamicCE commented on Sep 1, 2025

    @DynamicCE

    same issue

  10. DennisJansenDev commented on Sep 1, 2025

    @DennisJansenDev

    Yeah same issue, basically useless, I can do research and write code by myself faster than this.

  11. Oren-T commented on Sep 1, 2025

    @Oren-T

    Also having this issue and it is totally useless to me right now.

  12. angeloprado commented on Sep 2, 2025

    @angeloprado

    someone please merge the PR

  13. jdiago-passerelle commented on Sep 2, 2025

    @jdiago-passerelle

    Same with the VS Code extension, need to approve every single tool call

  14. rben01 commented on Sep 3, 2025

    @rben01
    Contributor

    I need to approve every shell command in the VSCode extension on macOS, even when I select “run every time”

  15. shurkanTwo commented on Sep 3, 2025

    @shurkanTwo

    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

  16. 61 remaining items

  17. etraut-openai commented on Nov 19, 2025

    @etraut-openai
    Contributor

    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.

  18. fschieber88 commented on Nov 19, 2025

    @fschieber88

    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

  19. nos1609 commented on Nov 20, 2025

    @nos1609
  20. etraut-openai commented on Nov 20, 2025

    @etraut-openai
    Contributor

    @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.

  21. etraut-openai commented on Nov 20, 2025

    @etraut-openai
    Contributor

    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.

  22. matt-lohkamp-pa commented on Nov 21, 2025

    @matt-lohkamp-pa

    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 -

    Image

    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.

  23. BlueMond commented on Dec 8, 2025

    @BlueMond

    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.

  24. etraut-openai commented on Dec 8, 2025

    @etraut-openai
    Contributor

    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.

  25. locked as resolved and limited conversation to collaborators on Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugwindows-os

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions