Custom sandboxing
Resolved 💬 4 comments Opened Oct 3, 2025 by o1lo01ol1o Closed Dec 18, 2025
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What feature would you like to see?
Related to #4665 ; i'd like codex to be able to run a command with a PATH environment that I provide it. Currently, in a nix project, codex seems to be unable to run basic compiler tasks because it cannot enter the nix environment.
Are you interested in implementing this feature?
_No response_
Additional information
_No response_
4 Comments
Potential duplicates detected:
Powered by Codex Action
Are you looking for
https://github.com/openai/codex/blob/main/docs/config.md#sandbox_mode
search for
writable_roots@Meowzz95 No, my issue is that
nix-shellor the equivalent will load a shell with all my tools for the given project. if I launch codex, codex does not have access to that shell. Codex is not allowed to invoke that shell and, though nix is fast all things considered, it should not reload the shell every time it needs to check the compiler output.the shell policy should default to
allbut apparently codex does not take the ambient PATH at execution because it doesn't have any of the tools, includingnix-shell:This policy might be able to do something if I could populate it from the given path during the nix shell evaluation:
[shell_environment_policy]
inherit = "all"
set = { PATH = "$NIX_SHELL_PATH" }
But that's already a bit more janky then just passing through the PATH to
codexThis feature request hasn't received any upvotes or additional posts in over two months, so I'm going to close it out.