Shell blacklist of commands

Resolved 💬 3 comments Opened Oct 13, 2025 by vincelwt Closed Dec 18, 2025

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 ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗