codex icon indicating copy to clipboard operation
codex copied to clipboard

Separate approval policies for read vs write operations

Open dev-shinyu opened this issue 3 months ago • 2 comments

What feature would you like to see?

Hi Codex CLI team 👋

Currently, the approval_policy setting applies uniformly to all command executions. This means we can either:

Allow all commands automatically (never),

Prompt before every command (on-request), or

Block/disallow entirely.

However, in real development workflows it would be extremely useful to distinguish read-only operations (e.g. searching, grepping, analyzing files) from write operations (e.g. creating, editing, or deleting files).

Proposal: Introduce separate approval policies for read vs. write:

Read operations → allow automatic execution (no prompt).

Write operations → always require explicit approval.

This would give developers the convenience of seamless analysis and exploration, while still protecting against unintended or unsafe modifications to the workspace.

Example config idea:

sandbox_mode = "workspace-write" approval_policy.read = "never" approval_policy.write = "on-request"

This separation would significantly improve developer productivity and safety when using Codex CLI in real projects.

Thanks for considering this enhancement! 🙏

Are you interested in implementing this feature?

No response

Additional information

No response

dev-shinyu avatar Sep 16 '25 06:09 dev-shinyu

Yeah, I switched from Claude Code and immediately noticed this obvious major drawback.

VladTheFrontender avatar Oct 07 '25 22:10 VladTheFrontender

A whitelist of commands would be great. I don't need to be asked if i want to allow a cd command for example, or other completely safe shell commands.

adrianveen avatar Dec 03 '25 19:12 adrianveen