codex-rs/linux-sandbox/README.md
This crate is responsible for producing:
codex-linux-sandbox standalone executable for Linux that is bundled with the Node.js version of the Codex CLIrun_main() so that
codex-exec CLI can check if its arg0 is codex-linux-sandbox and, if so, execute as if it were codex-linux-sandboxcodex multitool CLIOn Linux, the bubblewrap pipeline prefers the system /usr/bin/bwrap whenever
it is available. If /usr/bin/bwrap is missing, the helper still falls back to
the vendored bubblewrap path compiled into this binary.
Codex also surfaces a startup warning when /usr/bin/bwrap is missing so users
know it is falling back to the vendored helper.
Current Behavior
SandboxPolicy / sandbox_mode configs remain supported./usr/bin/bwrap is present, the helper uses it./usr/bin/bwrap is missing, the helper falls back to the vendored
bubblewrap path./usr/bin/bwrap is missing, Codex also surfaces a startup warning instead
of printing directly from the sandbox helper.features.use_legacy_landlock = true (or CLI -c use_legacy_landlock=true)
to force the legacy Landlock fallback.cwd resolution.SandboxPolicy model stay on bubblewrap so nested read-only or denied
carveouts are preserved.PR_SET_NO_NEW_PRIVS and a
seccomp network filter in-process.--ro-bind / /.--bind <root> <root>..git,
resolved gitdir:, and .codex) are re-applied as read-only via --ro-bind./repo = write, /repo/a = none, /repo/a/b = write
keeps /repo writable, denies /repo/a, and reopens /repo/a/b as
writable again./dev/null on the symlink or first
missing component.--unshare-user and the PID namespace via --unshare-pid.--unshare-net.--unshare-net plus an internal
TCP->UDS->TCP routing bridge so tool traffic reaches only configured proxy
endpoints./proc via --proc /proc by default, but
you can skip this in restrictive container environments with --no-proc.Notes
codex debug landlock.