removing "codex --enable use_legacy_landlock" will cause a lot of issues for a lot of people

Resolved 💬 6 comments Opened Apr 21, 2026 by user-22-33-56 Closed Apr 21, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of the Codex App are you using (From “About Codex” dialog)?

0.122.0

What subscription do you have?

the 20 dollar one

What platform is your computer?

ubuntu/pop os 24.04 (actually its running inside a docker container on that host)

What issue are you seeing?

https://github.com/openai/codex/issues/14919#issuecomment-4076504751

this solution
codex --enable use_legacy_landlock

is something i rely on heavily in order for my codex to run in a docker container.

removing this flag will cause huge issues with my workflow.

and i'm sure there are a lot of others that will have this issue too.

please dont remove it or i will have to like fork the repo and figure it out.

i got this warning when updating today

[features].use_legacy_landlock is deprecated and will be removed soon.

<img width="676" height="356" alt="Image" src="https://github.com/user-attachments/assets/2a10cffc-9306-4fdc-b7e9-03be59576439" />

the whole reason i have to do the legacy thing is because of an issue with ubuntu 24.04 new security around permissions.

What steps can reproduce the bug?

i saw the warning when i run

codex --enable use_legacy_landlock

What is the expected behavior?

i just want to keep this feature

Additional information

_No response_

View original on GitHub ↗

6 Comments

github-actions[bot] contributor · 3 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #17337

Powered by Codex Action

viyatb-oai contributor · 3 months ago

hey @user-22-33-56, thanks for the feedback. The main reason we’re moving away from landlock is that Codex needs one Linux sandbox path with more consistent filesystem, namespace, and network behavior across environments. The current direction is bwrap plus seccomp, which gives us a clearer isolation boundary and better fail-closed behavior.

If your host environment can’t run that sandbox directly, a good workaround is to run Codex inside a container and let Docker be the outer security boundary. We have an example devcontainer here:

https://github.com/openai/codex/tree/main/.devcontainer

In VS Code, open the folder in a devcontainer using .devcontainer/devcontainer.secure.json, or from the CLI run:

devcontainer up --workspace-folder . --config .devcontainer/devcontainer.secure.json

Inside the container, you can either keep Codex’s Linux sandbox enabled if the container grants the needed bwrap capabilities, or run Codex with --sandbox danger-full-access if the container itself is the intended isolation boundary.

mikkom-aimbition · 3 months ago

Currently your default sandbox configuration FAILS on all vanilla ubuntu based systems - you need to fix it or provide clear instructions on how to get bubblewrap working on defauly Ubuntu installation.

DO NOT REMOVE THE LEGACY CONFIG before you have provided documentation and tested yourself how to get your default sandbox working on default Ubuntu installation.

etraut-openai contributor · 3 months ago

Please refer to this documentation which @viyatb-oai just posted. Let us know if that's helpful or if you have any follow-up questions.

viyatb-oai contributor · 3 months ago

@mikkom-aimbition can you please try this? ubuntu 25.x ships with a profile bwrap-userns-restrict with apparmor-profiles that is somehow not on Ubuntu 24.04 by default - it was removed due to a Flatpak regression. See https://www.ubuntuupdates.org/package/core/noble/main/updates/apparmor-profiles and https://apparmor.net/news/release-4.0.2/

sudo apt update
sudo apt install apparmor-profiles apparmor-utils

dpkg -L apparmor-profiles | grep bwrap-userns-restrict

sudo install -m 0644 \
  /usr/share/apparmor/extra-profiles/bwrap-userns-restrict \
  /etc/apparmor.d/bwrap-userns-restrict
viyatb-oai contributor · 2 months ago

@mikkom-aimbition ^ this fix worked for someone else https://github.com/openai/codex/issues/14936#issuecomment-4296166611.

I've updated the docs to reflect this https://developers.openai.com/codex/concepts/sandboxing#prerequisites - please let me know if its missing anything. Thanks!