Skip to content

all commands in sandbox mode fail and need approval #3140

Closed

Description

@phynias

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

Activity

  1. added
    bug
    on Sep 4, 2025
  2. MagicalTux commented on Sep 7, 2025

    @MagicalTux

    Same issue on Gentoo linux.

  3. simsicon commented on Sep 9, 2025

    @simsicon

    Same here

  4. wodexiaobai322 commented on Sep 15, 2025

    @wodexiaobai322

    use codex --sandbox danger-full-access --dangerously-bypass-approvals-and-sandbox

  5. samuelstevens commented on Sep 17, 2025

    @samuelstevens

    Same problem on Ubuntu

    Linux 5.14.0-427.76.1.el9_4.x86_64 x86_64 x86_64

  6. SharkWipf commented on Sep 26, 2025

    @SharkWipf

    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=y it 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.

  7. jjsantos01 commented on Oct 18, 2025

    @jjsantos01

    Same on WSL 2 (Ubuntu)

  8. hn-yu commented on Oct 20, 2025

    @hn-yu

    use codex --sandbox danger-full-access --dangerously-bypass-approvals-and-sandbox

    smooth like butter

  9. added
    sandbox
    on Nov 2, 2025
  10. mohag commented on Nov 7, 2025

    @mohag

    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=y it 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.

    WSL1 with an emulated kernel seems to have issues as well

  11. etraut-openai commented on Nov 18, 2025

    @etraut-openai
    Contributor

    I think the remaining issue here is captured in #6665, so I'm going to close this issue.

  12. GertBurger commented on Nov 28, 2025

    @GertBurger

    The same occurs on BitBucket pipeline, irrespective of which sandbox arguments are provided:

    /bin/bash -lc ls in /opt/atlassian/pipelines/agent/build exited 101 in 4ms:
    thread 'main' panicked at linux-sandbox/src/linux_run_main.rs:30:9:
    error running landlock: Sandbox(LandlockRestrict)
    
  13. caibirdme commented on Feb 2, 2026

    @caibirdme

    I'm using devcontainer, which is just a docker container, and it's impossible for me to recompile the kernel...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsandbox

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions