You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
codex/claude-code: Ubuntu 24.04 bwrap-userns-restrict profile breaks Claude Code's sandbox; suggest Claude Code's bwrap profile #1309
On Ubuntu 24.04, the AppArmor setup that the codex module's README links to breaks Claude Code's sandbox when the claude-code module runs in the same workspace. A profile from Claude Code's docs works for both agents.
Background
#1251 was closed by #1258. That PR made the codex module warn when bwrap is missing and linked to Codex's sandboxing docs. For Ubuntu 24.04, those docs recommend Ubuntu's bwrap-userns-restrict profile from apparmor-profiles.
That profile runs every process bwrap starts under the unpriv_bwrap profile. Claude Code's sandbox creates a nested user namespace inside bwrap for its seccomp helper, and unpriv_bwrap blocks it:
apply-seccomp: write /proc/self/setgroups (nested userns is capability-restricted; caller must provide CAP_SYS_ADMIN)
Repro
Tested on Ubuntu 24.04.5 with distro bubblewrap installed and Codex 0.171.0. Each check writes to /etc from inside the agent's sandbox.
Setup
codex sandbox --
Claude Code sandboxed Bash
No AppArmor profile, restriction on
bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted
abi <abi/4.0>,
include <tunables/global>
profile bwrap /usr/bin/bwrap flags=(unconfined) {
userns,
include if exists <local/bwrap>
}
Suggested changes
In the codex and claude-code module READMEs, recommend the profile above for Ubuntu 24.04, or note that bwrap-userns-restrict breaks Claude Code's sandbox. The claude-code README currently doesn't mention bubblewrap or AppArmor.
Optional: warn when kernel.apparmor_restrict_unprivileged_userns=1 and no AppArmor profile covers /usr/bin/bwrap. Today's check only looks for bwrap on PATH, so the RTM_NEWADDR failure from codex: document and check Linux bubblewrap/AppArmor prerequisites #1251 gets no warning when bwrap is installed.
Related: #1251, #1258, #1266 (a container variant with a different error).
Activity
linear-code commentedon Nov 20, 2026
REG-144