all commands in sandbox mode fail and need approval
Resolved 💬 11 comments Opened Sep 4, 2025 by phynias Closed Nov 18, 2025
💡 Likely answer: A maintainer (etraut-openai, contributor)
responded on this thread — see the highlighted reply below.
What version of Codex is running?
codex-cli 0.27.0
Which model were you using?
gtp-5
What platform is your computer?
ubuntu devcontainer
What steps can reproduce the bug?
i am starting codex with codex --full-auto -C /workspace/pixelot --search, but every edit fails with
thread 'main' panicked at linux-sandbox/src/linux_run_main.rs:28:9:
error running landlock: Sandbox(LandlockRestrict)
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
? Codex wants to run rg -n "Sidebar\.tsx$|Popular Communities|AtSign|community" -S src -g '!/node_modules/'
command failed; retry without sandbox?
▌Allow command?
▌ Yes Always No, provide feedback
it does this for pretty much any command in the workspace. i have to ok them all.
What is the expected behavior?
_No response_
What do you see instead?
have commands work without having to remove the sandbox.
Additional information
_No response_
11 Comments
Same issue on Gentoo linux.
Same here
use ``
codex --sandbox danger-full-access --dangerously-bypass-approvals-and-sandbox``Same problem on Ubuntu
Linux 5.14.0-427.76.1.el9_4.x86_64 x86_64 x86_64
So apparently landlock was added to Codex recently, as it worked fine for me before. Obviously it's not a great idea to just disable sandboxing and giving Codex full access to your entire machine, so the proper solution, so for those who want a proper fix:
Landlock is a Linux kernel feature, if you're running a non-standard/non-supported/custom/old kernel it might not be supported.
Most if not all stock distro kernels should support landlock, but if you're running a non-standard kernel, you'll either have to switch kernel or recompile with landlock enabled (
CONFIG_SECURITY_LANDLOCK=y).After I rebuilt my kernel with
CONFIG_SECURITY_LANDLOCK=yit started working without issue for me.A clearer error message would be nice here, since it's not obvious at all what's going on here, but at least the root cause is known now.
Same on WSL 2 (Ubuntu)
smooth like butter
WSL1 with an emulated kernel seems to have issues as well
I think the remaining issue here is captured in #6665, so I'm going to close this issue.
The same occurs on BitBucket pipeline, irrespective of which sandbox arguments are provided:
I'm using devcontainer, which is just a docker container, and it's impossible for me to recompile the kernel...