Security model

cell jails semi-trusted commands. Read this page before trusting it with anything more.

What cell is for

Running code you don’t fully trust — AI-generated scripts, third-party build recipes, dependency-installer shell — on machines you do trust, as a normal user, without giving that code access to your secrets, your network, or your other processes.

The isolation layers

layer mechanism what it stops
filesystem pivot_root onto fresh tmpfs, host fs detached not hidden reading host secrets even knowing exact paths
processes own pid namespace, payload is pid 1 seeing or signalling host processes
network own net namespace, loopback-only by default any external connectivity unless mediated
environment scrubbed, per-variable opt-in leaking host env secrets into the payload
file descriptors close_range hygiene, payload gets exactly 0/1/2 inheriting host fds (sockets, files)
privileges no_new_privs + seccomp BPF blocklist mount, bpf, io_uring, keyctl, kexec, modules, perf, userfaultfd, x32-ABI bypass
resources cgroup v2 pids + memory caps (best effort) fork bombs, memory exhaustion
writes landlock --strict-writes + nested ro binds writing outside designated scratch areas

Every layer is verified by the threat harness — 48 checks that attack the jail rather than test features — and 7/7 planted mutant bugs are caught by it. The matrix runs across kernels 6.1–6.17 on bare metal, cloud VPS and EC2.

What cell is NOT

Not a hostile-multi-tenant boundary. The payload shares your kernel. A kernel exploit inside the jail is a host compromise. This is the honest shared-kernel caveat, stated permanently — if you need hardware-virtualization isolation you need a VM, not a namespace jail. The VM end of that spectrum is being explored in spore, a small KVM supervisor in machin that brings its own kernel — early research, not a product, and not a proven isolation boundary.

Not a sandbox for unknown-untrusted malware. Semi-trusted means: code that isn’t actively exploiting kernel zero-days but absolutely will try to read your .ssh, your env tokens, and your network if you let it.

The egress mediation design

In --net proxy mode the jail keeps its loopback-only netns — there is no route out, so bypassing the proxy is structurally impossible, not merely firewalled. The listener inside the netns is accepted by the parent process outside the jail; no proxy code runs inside the boundary. Policy is applied to the resolved IPv4 before dialing the literal address, so:

  • private/loopback/link-local/CGNAT destinations are denied by default — the proxy cannot be turned into an SSRF bridge against host or LAN services
  • DNS rebinding has no window (resolve once, check, dial the literal IP)
  • every decision is an evidence record with byte counts

Host capability boundaries

Honest detection, never silent claims:

  • unprivileged LXC containers without nesting=1 block user namespaces entirely — cell cannot run there at all, and says so at exit code 91
  • docker containers can nest cell with seccomp=unconfined + apparmor=unconfined on the container — but docker’s locked /proc masks force a degradation: the jail binds the outer proc and sees container-wide process argv. Never silent: it warns on stderr, every time
  • cgroup delegation is host-dependent; when unavailable cell warns no resource limits enforced rather than pretending
  • pre-6.6 kernels are supported (the remount locked-flags quirk is handled), but the matrix is how we know — see design.md for results

Evidence and audit

Every run appends a JSON record to the audit log: timestamp, argv, policy hash, enforcement status, outcome. Written by the host parent after reaping — the payload cannot tamper with it. Environment values never appear in evidence; keys only. Failed launches are recorded: a denied launch is evidence too.