Skip to content

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

Closed as not planned

Description

@AprilGrimoire

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.

Activity

  1. added
    CLIIssues related to the Codex CLI
    sandboxIssues related to permissions or sandboxing
    on Jan 6, 2026
  2. Gumbraise commented on Jan 6, 2026

    @Gumbraise

    still on 0.78.0

  3. fury0928 commented on Jan 8, 2026

    @fury0928

    @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

  4. etraut-openai commented on Jan 13, 2026

    @etraut-openai
    Contributor

    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.

  5. AprilGrimoire commented on Jan 16, 2026

    @AprilGrimoire
    Author

    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?

  6. MNeMoNiCuZ commented on Feb 5, 2026

    @MNeMoNiCuZ

    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?

  7. jamesxsc commented on Feb 27, 2026

    @jamesxsc

    Also happy to work on this

  8. MNeMoNiCuZ commented on Feb 27, 2026

    @MNeMoNiCuZ

    Please @jamesxsc, be the hero we need!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLIbugSomething isn't workingsandboxIssues related to permissions or sandboxing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions