Shell blacklist of commands

Resolved 💬 3 comments Opened Oct 13, 2025 by vincelwt Closed Dec 18, 2025
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

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:

```config.toml
shell_blacklist = ["git*"]


More generally this seems like an essential safety feature.

### Additional information

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

Thanks!

View original on GitHub ↗

3 Comments

github-actions[bot] contributor · 10 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #4969
  • #5082

Powered by Codex Action

matssk · 10 months ago

Related #3960

etraut-openai contributor · 8 months ago

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