Linux: codex-cli 0.81+ sandbox fails with landlock; 0.79/0.80 ignore --sandbox flags
Resolved 💬 7 comments Opened Jan 15, 2026 by vincentsch Closed Jan 15, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor)
responded on this thread — see the highlighted reply below.
Summary
On Ubuntu 24.04.3 (Xubuntu), codex-cli 0.81+ fails any sandboxed run with:
error running landlock: Io(Os { code: 1, kind: PermissionDenied, message: "Operation not permitted" })
Only --dangerously-bypass-approvals-and-sandbox works.
Additionally, in 0.79/0.80 the --sandbox flag appears ignored (acts like workspace-write even when read-only or danger-full-access is passed).
Environment
- OS: Ubuntu 24.04.3 LTS (Xubuntu)
- Kernel: 6.14.0-37-generic
- AppArmor enabled;
kernel.apparmor_restrict_unprivileged_userns=1 /sys/kernel/security/landlockis missing- Install method:
npm install -g @openai/codex@<version>
Minimal repro (0.81+)
codex exec --sandbox workspace-write \
-c model=gpt-5.2-codex -c reasoning_effort=xhigh -c max_tokens=8000 \
--full-auto "Run 'true' using exec."
Expected
trueexecutes successfully inside sandbox.
Actual
- Landlock setup fails with
Operation not permittedbefore command runs.
Version matrix (tested)
| Version | Result (sandboxed run) | Notes |
|---|---|---|
| 0.79.0 | Works | --sandbox read-only still allows /tmp writes; --sandbox danger-full-access still blocks writes outside workspace (flag ignored). |
| 0.80.0 | Works | Same behavior as 0.79.0. |
| 0.81.0 | Fails | Landlock permission denied. |
| 0.84.0 | Fails | Landlock permission denied. |
Additional observations
- The CLI header always reports
sandbox: workspace-writeregardless of--sandboxvalue (0.79/0.80). --dangerously-bypass-approvals-and-sandboxworks on 0.81/0.84.
Workaround
- Pin to
@openai/codex@0.80.0, or bypass sandbox (not ideal).
Happy to run more diagnostics if you have specific data to collect.
7 Comments
Opened PR #9295 with a graceful fallback: if unshare/uid_map/mount steps fail with EPERM, skip the new read-only bind mounts and continue with Landlock-only enforcement (pre-0.81 behavior). Tests: cargo test -p codex-linux-sandbox.
This totally ruins Codex CLI's utility on Linux for me. I reverted to 0.80.0.
We're working on a fix. Apologies for the regression.
No worries; thanks for a great tool!
This should be addressed in 0.85, which has been published. If you're still seeing problems, let us know.
Update: 0.85.0 fixes the Landlock crash on my Ubuntu 24.04 host.
However,
--sandbox read-onlystill permits/tmpwrites and--sandbox danger-full-accessstill blocks writes outside the workspace, so the CLI still behaves like workspace-write regardless of the flag.Figured it out:
--full-autooverrides any--sandboxflag by design (forcesworkspace-write). I wrote it up here: https://www.vincentschmalbach.com/how-codex-cli-flags-actually-work-full-auto-sandbox-and-bypass/