WSL: No solution to "Error: The combination of seccomp/landlock that Codex uses for sandboxing is not supported in this environment."?
What version of Codex is running?
0.1.2505172129
Which model were you using?
o4-mini
What platform is your computer?
Linux 4.4.0-19041-Microsoft x86_64 x86_64
What steps can reproduce the bug?
Issue happens randomly during normal use on WSL.
What is the expected behavior?
A useable agent.
What do you see instead?
Error: The combination of seccomp/landlock that Codex uses for sandboxing is not supported in this environment.
If you are running in a Docker container, you may want to try adding restrictions to your Docker container such that it provides your desired sandboxing guarantees and then run Codex with the --dangerously-auto-approve-everything option inside the container.
If you are running on an older Linux kernel that does not support newer features of seccomp/landlock, you will have to update your kernel to a newer version.
at file:///root/.nvm/versions/node/v22.15.0/lib/node_modules/@openai/codex/dist/cli.js:498:184
at ChildProcess.exithandler (node:child_process:421:5)
at ChildProcess.emit (node:events:518:28)
at x0.emit (file:///root/.nvm/versions/node/v22.15.0/lib/node_modules/@openai/codex/dist/cli.js:332:3112)
at maybeClose (node:internal/child_process:1101:16)
at Socket.<anonymous> (node:internal/child_process:456:11)
at Socket.emit (node:events:518:28)
at x0.emit (file:///root/.nvm/versions/node/v22.15.0/lib/node_modules/@openai/codex/dist/cli.js:332:3112)
at Pipe.<anonymous> (node:net:351:12)
Additional information
Codex has been perfectly useable over the last 2 weeks on WSL until today. Now I receive the above across a wide variety of prompts & tasks. I doubt it's a change in codex, more likely something in my project is suddenly triggering it. The --dangerously-auto-approve-everything doesn't change anything. Codex is no longer able to complete any tasks in this project as a result.
reporting same issue here
file:///.nvm/versions/node/v22.15.1/lib/node_modules/@openai/codex/dist/cli.js:498
`;function IHe(e){return new Promise((t,r)=>{let n=["--","true"];bHe(e,n,(a,i,o)=>{a?(zt(`Sandbox check failed for ${e} ${n.join(" ")}: ${a}`),zt(`stdout: ${i}`),zt(`stderr: ${o}`),r(new Error(THe))):t()})})}function DHe(){return AB||(AB=CHe()),AB}function wHe(){switch(process.arch){case"arm64":return"codex-linux-sandbox-arm64";case"x64":return"codex-linux-sandbox-x64";default:return"codex-linux-sandbox-x64"}}f();cl();function xHe(){return[`${process.env.HOME}/.pyenv`]}var E6="/usr/bin/sandbox-exec";function hce(e,t,r,n,a){let i,o,s=[...r,...xHe()];if(s.length>0){let{policies:g,params:_}=s.map((E,b)=>({policy:`(subpath (param "WRITABLE_ROOT_${b}"))`,param:`-DWRITABLE_ROOT_${b}=${E}`})).reduce((E,{policy:b,param:S})=>(E.policies.push(b),E.params.push(S),E),{policies:[],params:[]});i=`
at file:////.nvm/versions/node/v22.15.1/lib/node_modules/@openai/codex/dist/cli.js:498:184
at ChildProcess.exithandler (node:child_process:421:5)
at ChildProcess.emit (node:events:518:28)
at x0.emit (file:///.nvm/versions/node/v22.15.1/lib/node_modules/@openai/codex/dist/cli.js:332:3112)
at maybeClose (node:internal/child_process:1101:16)
at ChildProcess._handle.onexit (node:internal/child_process:304:5)
effectively duplicate of #973
I'm not sure what's up with that dangerously-auto-approve-everything flag that gets suggested. It doesn't seem to actually be implemented anywhere.
The environment variable CODEX_UNSAFE_ALLOW_NO_SANDBOX is already implemented and seems intended to let you skip sandboxing entirely (#699), but was always after the check for Darwin and also got placed after the check for Linux sandboxing (#763). That PR also mentions the flag, but I don't see implementation.
You could implement #996 on a custom codex build to be able to skip sandboxing using CODEX_UNSAFE_ALLOW_NO_SANDBOX.
Getting the same error Error: The combination of seccomp/landlock that Codex uses for sandboxing is not supported in this environment.
Thank you for the feedback. Please try using the latest version of Codex CLI. If the issue persists, we'd appreciate it if you could test it with the native/Rust implementation and let us know if it still occurs. More details can be found in our project update: https://github.com/openai/codex/discussions/1174.