Allow on Windows for powershell read commands whilst still restricting editing
What feature would you like to see?
I don't want to allow codex to edit without approval. However, by doing this I also have to approve all reads. Which might require 20 approvals per request. Can we not just allow all reading commands whether with powershell or not.
Are you interested in implementing this feature?
No response
Additional information
No response
My solution is to add a prompt to prohibit the use of pwsh package command execution in AGENTS.md
Codex CLI config example (2025-09-16)
language = "en"
Only "trusted" read commands (ls, cat, sed, etc.) run without confirmation.
approval_policy = "untrusted"
Keep sandboxing sane while still allowing local edits in the workspace.
sandbox_mode = "workspace-write" use_plans_for_multistep = true [tools] web_search = false
With this setup, you can permit read-only PowerShell commands while still restricting editing or potentially destructive actions—very similar to how it works in Claude Code.
@iMAGRAY Does the above solution apply to the IDE extension as well?
Does this also apply to the powershell commands like Get-Content? The agent was choosing to use those instead of the unix-like aliases like cat
Does this also apply to the powershell commands like
Get-Content? The agent was choosing to use those instead of the unix-like aliases likecat
Not sure. This needs to be checked. But the configuration is quite flexible
@iMAGRAY The configuration example you provided contains invalid options that don't exist in Codex:
language = "en"- This configuration field doesn't exist in Codexuse_plans_for_multistep = true- This configuration field doesn't exist in Codex
The correct configuration for allowing read-only PowerShell commands while restricting editing would be:
approval_policy = "untrusted"
sandbox_mode = "workspace-write"
You can verify the actual supported configuration options in the Codex configuration documentation or by checking the configuration struct in the source code.
This should be working with recent versions of Codex. If you're seeing problems, please open a bug report.