'Yes, and don't ask again for commands that start with' too narrow

Resolved 💬 7 comments Opened Jan 6, 2026 by AprilGrimoire Closed Jan 13, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

codex-cli 0.77.0

What subscription do you have?

Plus

Which model were you using?

gpt-5.2

What platform is your computer?

Linux 6.18.1-gentoo x86_64 AMD Ryzen 7 8845H w/ Radeon 780M Graphics

What issue are you seeing?

Yes, and don't ask again for commands that start with `ls -la /home/april/.config/hypr`

What steps can reproduce the bug?

Uploaded thread: 019b9228-130e-7642-a093-18b1f0581bf5

What is the expected behavior?

Yes, and don't ask again for commands that start with `ls`

Additional information

Hopefully there should be other restriction, for example ls > /lib64/ld-linux-x86-64.so.2 would be devastating.

View original on GitHub ↗

7 Comments

Gumbraise · 6 months ago

still on 0.78.0

fury0928 · 6 months ago

@etraut-openai may I work on this bug?

My approach is like this way - Modify both functions to use only the first token (base command) instead of the full command
Change will be affected try_derive_execpolicy_amendment_for_prompt_rules() and try_derive_execpolicy_amendment_for_allow_rules() function, let me know if I can put with this suggestion.

Thank you

etraut-openai contributor · 6 months ago

The parameters for a command can greatly impact what it does. For example, rm foo and rm -rf . have very different effects, so we can't use just the first token.

If you want finer-grained control over commands that you allow, you can check out our recently-added support for execution policy rules.

AprilGrimoire · 6 months ago
The parameters for a command can greatly impact what it does. For example, rm foo and rm -rf . have very different effects, so we can't use just the first token. If you want finer-grained control over commands that you allow, you can check out our recently-added support for execution policy rules.

Why don't let the model decide what generality of no prompt to suggest?

MNeMoNiCuZ · 5 months ago

Every other CLI editing tool handles this gracefully. If it requests too broad a command, the user will just reject and explain why.
As it is, it's a useless option as it uses the entire command as "...commands that start with..."

  Would you like to run the following command?

  $ Select-String -Path js\app.js -Pattern "searchUrl" -Context 1,1

  1. Yes, proceed (y)
› 2. Yes, and don't ask again for commands that start with `Select-String -Path js\app.js -Pattern "searchUrl"
     -Context 1,1` (p)
  3. No, and tell Codex what to do differently (esc)

Like, this is baffling, how is this not solved? It makes the CLI completely useless as I need to approve EVERY SINGLE COMMAND it tries to execute, unless it's doing EXACTLY the same operation again.

And it's the same every time it tries to save a file:

  Would you like to make the following edits?

  js/app.js (+6 -2)

...

› 1. Yes, proceed (y)
  2. Yes, and don't ask again for these files (a)
  3. No, and tell Codex what to do differently (esc)

Should I really have to approve every file to be written to? Why don't you let me approve writing to files for the session, and for all files inside the working directory? Is this not the entire point of the tool?!

What am I missing?

jamesxsc · 4 months ago

Also happy to work on this

MNeMoNiCuZ · 4 months ago

Please @jamesxsc, be the hero we need!