Skip to content

Shell blacklist of commands #5154

Closed
Closed

Description

@vincelwt

What feature would you like to see?

As others have noticed, the model has a tendency to revert uncommitted changes to "clean" the project when working on a task.

This makes it extremely frustrating to work in pair with codex, for example making small edits to a file while it's working on a feature, the odds are high those changes will be reverted.

Adding instructions in AGENTS.md do not fix it reliably.

A simple workaround until the model behaviour is improved would be to be able to blacklist of commands to always request approval (or even fully block without requesting approval), regardless of the current approval mode (I still want to allow it to make edits unsupervised).

In my case I would like to completely block the model's access to git to not allow it to see other changes being made.

Something like:

shell_blacklist = ["git*"]

More generally this seems like an essential safety feature.

Additional information

Mentions in the wild of codex reverting code:
#3728
#3873
#1736
https://news.ycombinator.com/item?id=45416788

Thanks!

Activity

  1. github-actions commented on Oct 13, 2025

    @github-actions
    Contributor
  2. matssk commented on Oct 13, 2025

    @matssk

    Related #3960

  3. etraut-openai commented on Dec 18, 2025

    @etraut-openai
    Contributor

    We've recently added support for "execution rules" — a way to configure which commands to allow or disallow. For details, refer to this documentation.

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions