Bug Report: Commands failed to run in sandbox in Codex CLI
Resolved 💬 6 comments Opened Oct 8, 2025 by Icarus603 Closed Oct 8, 2025
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of Codex is running?
codex-cli 0.45.0
Which model were you using?
gpt-5-codex
What platform is your computer?
Darwin 24.6.0 arm64 arm
What steps can reproduce the bug?
This kind of errors occurred a lot: I asked codex to run "git add ." and it failed immediately and returned stuff like "failed in sandbox". But when I asked it to run it again and ask for my approval, it succeeded easily. Other kinds of commands failed like this too. Seems that Codex tends to run commands (bash/python etc.) in sandbox but not locally... Could you fix this and make it more robust?
What is the expected behavior?
The agent already lives in the terminal so it shouldn't be running things in sandbox. Codex CLI should just run the commands locally. (Donno if this is right...)
What do you see instead?
_No response_
Additional information
_No response_
6 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
(Note: this comment was generated by Codex.)
Thank you for reporting this! This appears to be a duplicate of #4928. We’ll track the issue there to keep discussion in one place. If you think this is an incorrect diagnosis, please reply here and we’ll revisit.
this is still happening to me on latest codex versions
This is incredibly annoying.
pnpm type-checkalways hangs, and winds up creating a new.pnpm-store/folder in my project folder due to pnpm running in some sort of sandbox.when i
git commitin another terminal, the codex sandbox stops working, the model goes for dirty-perl|python inline cmd edits instead of apply_patch due to sandbox failure: it doesnt recover.Solution/workaround found. Create
~/.codex/rules/pnpm.rulesand paste this into it: