PATH is overwritten inside of the sandbox
Resolved 💬 7 comments Opened Apr 24, 2025 by mcolyer Closed Aug 7, 2025
What version of Codex is running?
0.1.2504221401
Which model were you using?
o4-mini
What platform is your computer?
darwin | arm64 | 24.4.0
What steps can reproduce the bug?
- ```
echo ruby --version
```
2 reasoning|1 tool
What is the expected behavior?
That it respects my rbenv path. It looks like seatbelt might be overriding the PATH which forces the system ruby.
What do you see instead?
/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/boots
trap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:
(stripped my personal paths at the end there)
Additional information
Happy to solve this another way, the goal is just to be able to us the proper ruby here.
7 Comments
https://github.com/openai/codex/issues/622
This isn't a good solution, but for now you can have it run
eval "$(rbenv init -)"; COMMAND GOES HEREI put the following in my
~/.codex/instructions.mdand it seems to work fine for now.I'm using mise and codex can't execute
npm.Can we configure bash profile for codex?
I searched documents and found:
Linux 6.10.14-linuxkit aarch64 unknownDarwin 24.5.0 arm64 armPATHshould be inherited by default. So this issue is labelled as a bug.https://github.com/openai/codex/blob/9846adeabf8593458bc9e3cef28e0dd6c89a59d1/codex-rs/config.md#shell_environment_policy
Thank you for the feedback! Please try again on the latest version of Codex CLI. If the issue persists, we'd appreciate a report or contribution to the
codex-rs/implementation. You can find more information in our project update: https://github.com/openai/codex/discussions/1174.