Allow on Windows for powershell read commands whilst still restricting editing
Resolved 💬 8 comments Opened Sep 16, 2025 by robertmylne Closed Jan 24, 2026
💡 Likely answer: A maintainer (LaelLuo, contributor)
responded on this thread — see the highlighted reply below.
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_
8 Comments
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?
Yes
Does this also apply to the powershell commands like
Get-Content? The agent was choosing to use those instead of the unix-like aliases likecatNot 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 CodexThe correct configuration for allowing read-only PowerShell commands while restricting editing would be:
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.