Public bug reported:

# Ubuntu 26.04.1 LTS — AppArmor/Bubblewrap compatibility failure
prevents Claude Code sandbox initialization

## Summary

I am reporting a reproducible compatibility issue involving Ubuntu
26.04.1 LTS, AppArmor, Bubblewrap and Anthropic's Claude Code sandbox
runtime.

Claude Code cannot initialize its local shell sandbox under the current
Ubuntu security configuration. Even a basic `pwd` command fails before
execution begins.

I am requesting a technical investigation into whether this behaviour is
expected under Ubuntu's current AppArmor policy, whether the policy or
sandbox implementation requires correction, and whether coordination
with Anthropic is necessary.

## System environment

- Ubuntu 26.04.1 LTS
- KDE Plasma 6, Wayland
- Kernel: 7.0.0-44-generic
- AppArmor: 5.0.2-0ubuntu1~26.04.1
- Bubblewrap: 0.11.1-1ubuntu0.3
- Socat: 1.8.1.1-1ubuntu0.1
- Claude Desktop: 6.28899.6
- Claude Code: 2.1.332

## Kernel security configuration

```text
kernel.apparmor_restrict_unprivileged_userns = 1
kernel.unprivileged_userns_clone = 1
user.max_user_namespaces = 116902
```

AppArmor service status: active.

The installed AppArmor profile `/etc/apparmor.d/bwrap-userns-restrict`
includes the `unpriv_bwrap` profile, which restricts capabilities within
the user namespace.

## Steps to reproduce

1. Install and configure Claude Desktop and Claude Code.
2. Enable local sandboxing and strict sandbox mode.
3. Select Manual permissions.
4. Create and select an isolated, disposable test workspace.
5. Request execution of a harmless `pwd` command.

## Expected behaviour

The sandbox initializes successfully and executes the command within its
restricted environment while preserving Ubuntu's existing security
protections.

## Actual behaviour

Sandbox initialization fails before the requested command executes.

```text
apply-seccomp: write /proc/self/setgroups
(nested userns is capability-restricted;
caller must provide CAP_SYS_ADMIN): Permission denied
```

Exit code: 1.

## Corresponding kernel audit evidence

```text
apparmor="DENIED"
operation="capable"
class="cap"
profile="unpriv_bwrap"
capability=21
capname="sys_admin"
```

This denial was recorded in the kernel journal during the
troubleshooting session on November 30, 2026.

## Related upstream reports

- https://github.com/anthropics/claude-code/issues/105194
- https://github.com/anthropics/claude-code/issues/43454
- https://github.com/anthropics/sandbox-runtime/issues/428
- https://github.com/anthropics/sandbox-runtime/issues/429

## Requested investigation

I would appreciate clarification regarding the following:

- Is this capability denial the expected behaviour of Ubuntu's current 
Bubblewrap AppArmor profile?
- Is the incompatibility caused by Ubuntu's security policy, the underlying 
sandbox implementation or an interaction between the two?
- Is there an officially supported resolution that preserves the existing 
security model?
- Can Canonical coordinate with Anthropic and the relevant upstream maintainers 
to resolve this incompatibility?

I am not requesting that Ubuntu weaken its default security protections.
AppArmor and unprivileged user namespace restrictions provide important
security boundaries that I intend to retain.

Disabling AppArmor, broadly granting additional capabilities or
weakening system-wide namespace restrictions is not an acceptable
workaround.

I am available to provide additional read-only diagnostic information
and perform controlled regression testing.

Thank you for investigating this issue.

Jeff Petovello

** Affects: apparmor (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2178496

Title:
  Ubuntu 26.04.1 LTS: AppArmor/Bubblewrap capability denial prevents
  Claude Code sandbox initialization

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/2178496/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to