Rules are useless

Resolved 💬 4 comments Opened Jan 14, 2026 by yassenb Closed Jan 15, 2026

What version of Codex is running?

0.80.0

What subscription do you have?

Plus

Which model were you using?

gpt-5.2-codex

What platform is your computer?

Linux 6.8.0-90-generic x86_64 x86_64

What issue are you seeing?

Codex prompts me for every test in needs to run, for example rspec some_spec.rb

What steps can reproduce the bug?

Add a rule file in ~/.codex/rules/ with something like:

# rspec via PATH or binstubs
prefix_rule(
    pattern = [["rspec", "bin/rspec", "./bin/rspec"]],
    decision = "allow",
    justification = "Allow rspec outside the sandbox.",
)

# bundle exec rspec
prefix_rule(
    pattern = ["bundle", "exec", "rspec"],
    decision = "allow",
    justification = "Allow bundle exec rspec outside the sandbox.",
)

Then tell codex to run some test

What is the expected behavior?

Codex runs the test without having to require permissions

Additional information

The problem is that every command is actually prefixed with your shell, for example all the rules that I have that were created automatically go like:

prefix_rule(pattern=["/usr/bin/zsh", "-lc", "APP_ENV=test bundle exec rspec spec/web/gql/operator/query_spec.rb spec/web/gql/operator/mutations/delete_spec.rb"], decision="allow")

So every command is prefixed by my shell /usr/bin/zsh which makes rules useless unless they're an absolute exact match. So there's no way for me to say "run any tests with rspec without requiring permission" while still keeping Codex safe and not allowing everything

View original on GitHub ↗

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