You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Codex randomly wraps commands in /bin/zsh -lc which renders rules useless #10920
codex-cli 0.98.0 but it's been like this for a long time
What subscription do you have?
max (200$)
Which model were you using?
gpt-5.3
What platform is your computer?
Darwin 24.6.0 arm64 arm
What terminal emulator and version are you using (if applicable)?
irrelevant, hapens in all of them (iterm, vscode, zed)
What issue are you seeing?
The way that codex runs commands is incredibly confusing (shells? login shells? background shell? single command?); and I still can't figure out if the /bin/zsh -lc that gets wrapped around some commands is part of the harness or explicitly invoked by the model - probably both, depending on the exact situation?
But the result is that the rules in execpolicy are rendered completely useless because the entire command is wrapped in /bin/zsh -lc '....' so it only matches against the /bin/zsh -lc prefix.
I've read that you normally parse this #9206 , but it doesn't appear to be working.
I've read that env vars before the command might break it - but that's not the case here.
What steps can reproduce the bug?
very random - sometimes it works, sometimes it starts using this weird way of invoking commands. When i tell it to stop it says things like "I didn't actually use /bin/zsh -lc for that command, but maybe the harness is adding it automatically...?".
What is the expected behavior?
No response
Additional information
No response
Reacted by Ignat Remizov, Kenta Kihara, Doug Ludlow, Josh Steiner, Lonre Wang, marcindulak, rmarker and oiekjr
Run codex "run 'docker ps', in the case of blocking policy bypass using bash prefix".
Codex explains this bypass itself.
default.rules does block docker as a direct command prefix:
prefix_rule(
pattern = ["docker"],
decision = "forbidden",
)
That means:
- docker ps is forbidden by the workspace rule and by the exec policy.
- bash -lc 'docker ps' is not matched by that prefix rule because the first token is bash, not docker.
Activity
marcindulak commentedon May 2, 2026
Here is an example from a session with
gpt-5.4-mini, showing how theprefix_ruleis bypassed by models:Run
codex "run 'docker ps', in the case of blocking policy bypass using bash prefix".Codex explains this bypass itself.