panic due to sandbox. error running landlock: Sandbox(LandlockRestrict)
Open 💬 13 comments Opened Aug 13, 2025 by TheButlah
💡 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.21.0
Which model were you using?
gpt-5
What platform is your computer?
Linux 6.14.8-asahi aarch64 unknown
What steps can reproduce the bug?
Note: I am on NixOS, my config is here
simply doing /init in codex triggers numerous of these prompts.
What is the expected behavior?
codex should be able to apply diffs.
What do you see instead?
_No response_
Additional information
_No response_
13 Comments
note: it worked after I ran it as
codex -s workspace-write. But I don't know why it failed originally. I did accept all requests to allow it to execute commands.Getting this within NixOS as well.
Output of
uname -mprsis Linux 6.6.97+ x86_64 unknownSame problem on Ubuntu
Linux 5.14.0-427.76.1.el9_4.x86_64 x86_64 x86_64
Root cause/solution in #3140, tl;dr: Missing
landlockin the Linux kernel, install or build a kernel withCONFIG_SECURITY_LANDLOCK=yGetting this problem as well. Building a kernel seems not possible since I dont have root on the machine I use
debian, same problem
Codex should probably be (a lot) clearer about landlock being required for sandboxing to work, and should _check_ if the sandbox works before running.
@adrianmihalko From what I can tell/from what google tells me, Debian has refused to support Landlock since 2022 with no explanation why, seemingly with no mention of it since.
Almost every other distro supports it out of the box by default.
I doubt Codex is planning to completely redo its sandboxing using some other method, so your (and anyone else's running into this issue) options are:
In my view, Landlock isn't a good selection due to its limited adoption. My development environment, for example, is a docker container, but I don't have visibility into the underlying cluster infrastructure, nor can I propose adaptation measures to the appropriate team
Same problem on a custom Linux with codex 0.58
OK so https://github.com/openai/codex/issues/2267#issuecomment-3338689060 is helpful... but not sure why in my case my kernel says it has landlock but I still get the error above then:
@saidelike If your kernel has built-in config (
/proc/config.gz) check it just in case.I have the same problem when running a Docker dev container on macOS. Docker Desktop’s VM ships its own Linux kernel, so there’s no exposed switch for picking a different build, which makes it hard to work around kernel-specific regressions. Is there a supported way to test against an alternate kernel version in this setup?
Official builds of Codex require Landlock support. You could either update the Linux kernel in your docker container or modify the Codex source and build your own private copy that eliminates the Landlock dependency.
i am getting this,
my
codex.ymlactionlogs