Code review feature completely broken due to bad sandboxing
What version of Codex is running?
v0.66.0
What subscription do you have?
Team
Which model were you using?
gpt-5.1-codex-max
What platform is your computer?
macOS 15
What issue are you seeing?
Any of the /review commands is not being able to run simple shell commands, like git status --short, even though I am executing with --yolo (skipping all permissions and such).
Errors look like this:
└ git: warning: confstr() failed with code 5: couldn't get path of DARWIN_USER_TEMP_DIR; using /tmp instead
git: error: couldn't create cache file '/tmp/xcrun_db-8dRHB1xN' (errno=Operation not permitted)
git: warning: confstr() failed with code 5: couldn't get path of DARWIN_USER_TEMP_DIR; using /tmp instead
git: error: couldn't create cache file '/tmp/xcrun_db-e13d9WWl' (errno=Operation not permitted)
What steps can reproduce the bug?
Install Codex version v0.66.0 on a macOS 15 machine, start it with --yolo and use the /review command.
What is the expected behavior?
It can run commands outside of the sandbox, because I started it with --yolo.
Additional information
No response
Bumped to v0.69.0 (I install via brew, so sometimes it lags behind on versions a bit) and the same issue still occurs.
Bumped to v0.71.0 hoping that this would be fixed already: still broken.
@etraut-openai: I can only reproduce this issue in the CLI. Through the extension the /review command works fine. I think that CLI label makes sense here.
I encountered the same issue in the CLI as well
@etraut-openai I'm facing the same issue, and it's really bothering me. When using the /review command in CLI, it prompts the following: git: warning: confstr() failed with code 5: couldn't get path of DARWIN_USER_TEMP_DIR; using /tmp instead git: error: couldn't create cache file '/tmp/xcrun_db-SQmI6uR4' (errno=Operation not permitted)
I reverted the codex version to v0.65.0 without any issues; all subsequent versions have this problem.
One more codex-cli release, 0.72.0 this time, the issue is still present. @etraut-openai, do you think you guys will fix this anytime soon? Kind of losing hope here.
@etraut-openai I'd like to work on this. Is this still available?
@anupammaurya6767, you're welcome to investigate the root cause. Post anything you find here.
@etraut-openai Found the root cause: review mode was hardcoding the sandbox policy to read-only, ignoring --yolo.
I think you are on a good lead, @anupammaurya6767, but you are focussed on the wrong thing.
git status is somehow trying to write files outside the project's folder (see the error git: error: couldn't create cache file '/tmp/xcrun_db-8dRHB1xN' (errno=Operation not permitted)). So a heavily constrained read-only sandbox won't work.
The read-only sandbox should allow a git status to run, even if that git status needs to write a file to /tmp.
I am not sure if git changed the implementation of git status to write these temporary files or if just the read-only sandbox got so good that even writes to /tmp are now blocked.
This indicates that we might need a special "review" sandbox that will allow git commands to write to /tmp if they need.
@etraut-openai @douglascamata Thanks both for the clarification and extra detail.
I first assumed this was a /review + --yolo regression, but given that the always‑read‑only review sandbox is intentional, the real issue is that it’s now too strict for normal git usage: git status (and likely other git commands) need to write temp/cache files under /tmp, and those writes are being blocked, so even a “read‑only” review sandbox needs some controlled write capability.
A possible path forward would be a dedicated “review” sandbox policy that still keeps the workspace and other sensitive paths read‑only, but explicitly allows safe transient writes (like git’s temp files under /tmp) so /review works as expected. If that direction sounds acceptable, I’m happy to help explore what that policy should look like and try a prototype once you’re okay with the approach. @etraut-openai
A dedicated sandbox policy for /review doesn't sound like the right solution. That adds too much complexity.
Seems like we have more users reporting similar issues: #8105 and #8104.
Understood, a dedicated review sandbox policy would add complexity.
@etraut-openai A simpler fix: use the existing WorkspaceWrite policy for review, but configure it so the workspace itself is read-only (via read_only_subpaths) while /tmp remains writable. This lets git commands write their temp files to /tmp without allowing writes to the workspace.
If that direction works, I can draft a small change to switch review from ReadOnly to WorkspaceWrite with the workspace marked as a read-only subpath.