Skip to content

Linux: the Isolated tier by default, and the Landlock ABI ladder

From 0.20.0, openmoat run on Linux starts the Isolated tier (bubblewrap) by default where bubblewrap works, and the Lightweight tier (Landlock and seccomp) otherwise. macOS has the Lightweight tier only.

Linux, openmoat run … bubblewrap works bubblewrap missing or blocked
(no flag) Isolated tier Lightweight tier; says why on every start and records it in the audit log (run-isolation-unavailable)
--isolate Isolated tier refused (exit 64)
--no-isolate Lightweight tier, recorded in the audit log (run-no-isolate); from 0.21.0 the network namespace covers the project as --isolate does the same, with the project granted entry by entry (Project files on Linux)
any of these under require.run: full-boundary Isolated tier; --no-isolate refused refused (exit 64)
Terminal window
openmoat doctor # "openmoat run starts the Isolated tier (bubblewrap works here)"
openmoat run -- claude # the Isolated tier here, or the Lightweight one with a warning
openmoat run --no-isolate --write ~/.claude --write ~/.claude.json -- claude

The rows are in the audit log under the run’s own session (openmoat show, host moat-run, tool isolation). On macOS --no-isolate changes nothing and writes nothing. To refuse rather than fall back, add require.run: full-boundary to your policy.

  • Only the project, sandbox.read_roots, the agent’s executable, the --write paths and an empty temp directory, each at its usual path. The rest of the home directory (~/.ssh, ~/.aws, other projects) does not exist in there.
  • Denied paths inside them are hidden. A denied read (the project’s .env files) is covered by an empty placeholder no one may open; a denied write (.git, .claude/settings.json) is mounted read-only. .env, .envrc and .moat directly in the project are covered even when they are missing.
  • Writes go only to the project, the temp directory (in memory, gone when the session ends) and the --write paths.
  • Network goes only to OpenMoat’s proxy, through a network namespace with nothing but loopback. There is no DNS.
  • The Lightweight tier’s Landlock rules and seccomp filter apply inside too, so Linux 6.7 or later is needed.

An MCP server started with openmoat mcp proxy --sandbox also runs in the Isolated tier on Linux from 0.20.0, so a path outside the project and the read roots is not there for it at all.

It needs bwrap in /usr/bin, /bin or /usr/local/bin (never taken from PATH) and unprivileged user namespaces:

Terminal window
sudo apt install bubblewrap # or: sudo dnf install bubblewrap
openmoat doctor # says which tier openmoat run starts here

On Ubuntu 24.04, AppArmor restricts unprivileged user namespaces unless kernel.apparmor_restrict_unprivileged_userns is 0 or an AppArmor profile allows bwrap.

An agent that no longer starts. An agent whose runtime lives elsewhere in your home (a Node or Python install under ~/.local or a version manager’s folder) can need that folder in sandbox.read_roots:

sandbox:
read_roots: ["/usr", "~/.nvm"]

openmoat run needs Landlock ABI 4 (Linux 6.7). Where the kernel has more, it adds what a newer ABI brings beside the seccomp filter, never in its place, so an older kernel keeps exactly the protection it had (ADR-082):

Landlock ABI First Linux What openmoat run does with it
4 6.7 required: files and the proxy’s TCP port
5 6.10 not used (device ioctl): the terminal’s own calls must work; seccomp refuses TIOCSTI and TIOCLINUX
6 6.12 used: abstract Unix sockets and signals outside the sandbox refused
7 6.15 not used (kernel audit logging): OpenMoat’s audit log records its own decisions
8 7.0 not used (one ruleset for all threads): OpenMoat’s proxy thread must stay outside
9 7.1 used: a pathname Unix socket made outside the sandbox cannot be connected or sent to
10 7.2 used (since 0.26.0): every UDP bind, connect and send is refused, beside seccomp’s refusal of UDP sockets
11 7.3 nothing to add (no_new_privs is set already)
12 7.4 not used yet (capabilities, namespaces): seccomp refuses new namespaces

Since 0.26.0, ABI 10 (Linux 7.2) is used: every UDP bind, connect and send is refused by Landlock too, beside seccomp’s refusal of UDP sockets, and the boundary record gains landlock_udp. openmoat doctor also shows one 0 to 100 protection score per tier, naming each missing step and the Linux release that brings it (Protection score and strict mode).

See what applies on your kernel:

Terminal window
openmoat doctor --verbose # landlock Landlock ABI 6 here: `openmoat run` applies ABI 4, 6; …
openmoat sandbox show --format json | jq .lightweight.landlock.abi
openmoat run --verbose -- claude # prints the same before the agent starts

Every run also writes it to the audit log, as Landlock’s restrict_self reported it, in the run’s boundary record (rule run-boundary, which from 0.21.0 replaces the run-landlock-abi row), and checks after the agent starts that the ruleset and the seccomp filters are in force (The boundary record).

Datagram socket pairs. From 0.20.0 the seccomp filter allows socketpair() only for stream and sequenced-packet sockets (which Node, Python and Chromium use). A datagram pair fails with EPERM, because it could reach a pathname socket outside the sandbox such as /dev/log.

openmoat init turns on the agents’ own sandboxes (Claude Code, Codex, Cursor). On Linux each needs what its documentation lists: Claude Code needs bwrap and socat on PATH, and all three need to create user namespaces as you, which Ubuntu 23.10 and later restrict through AppArmor by default (kernel.apparmor_restrict_unprivileged_userns=1). Since 0.25.0, openmoat doctor says when an agent’s own sandbox cannot start commands on this machine, and why. Nothing needs root, and nothing on the machine changes; the fixes are yours to run.

Since 0.26.0, openmoat doctor gives each agent the AppArmor fix its own documentation gives, and catches Ubuntu’s bwrap-userns-restrict profile for Claude Code, whose sandbox fails under it although a plain bwrap works. So follow the fix doctor names for each agent:

Terminal window
$ openmoat doctor
! Claude Code the agent's own sandbox cannot start commands on this machine: kernel.apparmor_restrict_unprivileged_userns is 1 (Ubuntu's AppArmor restriction on user namespaces), so its Bash commands fail (`failIfUnavailable`, no unsandboxed commands). To fix it: the AppArmor profile the agent's sandboxing documentation gives for /usr/bin/bwrap, in /etc/apparmor.d/bwrap (`profile bwrap /usr/bin/bwrap flags=(unconfined) { userns, }`, with its `abi` and `include` lines), then `sudo systemctl reload apparmor` and restart the agent; or `sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0`, which lifts the restriction for every program until the next reboot; …
$ openmoat status
! Claude Code own sandbox cannot start commands here: user namespaces are blocked → openmoat doctor lists the fixes

openmoat status --format json lists the same under own_sandbox_linux, with bwrap_userns_restrict when Ubuntu’s profile applies.

OpenMoat never runs sysctl or sudo, and no policy setting leaves one agent’s sandbox off: its hook still decides each call. The details: USAGE.md.

  • A deny match created after the session starts is not hidden (a .env.local a command writes, a .env in a new folder); the hook still decides the agent’s own tool calls on it.
  • The agent and its commands share one sandbox, as in the Lightweight tier: whatever the agent needs, npm test gets too.
  • A project with more than a million files and folders is refused by the Isolated tier: each is looked at to find what to hide.
  • Without bubblewrap, the Lightweight tier restricts the network by port only. From 0.21.0 it grants the project entry by entry, so the project’s .env, .git and .moat at its top stay covered, but nothing can be created directly at the top (Project files on Linux).
  • No Isolated tier on macOS yet: openmoat run --isolate refuses there and names what is missing.

The full reference: SANDBOX.md, ADR-080 and ADR-082.