Repository navigation
v0.1.0 — first release
AgentCell — a ~1000-line AI-agent sandbox built directly on Linux kernel primitives. No Docker, no container runtime, no daemon required for the sandbox itself — it runs fully unprivileged (user namespaces).
./sand -- claude # isolated shell
./sand --net veth --mem 1G --timeout 600 -- codex # real networking + limits
./sand serve && ./sand exec <sock> -- python3 x.py # ~2 ms per command
What's inside
Isolation (unprivileged)
- cgroup v2 limits:
cpu.max/memory.max/pids.max/io.max(--io-rbps/--io-wbps) - 6 namespaces via clone(2); tmpfs root +
pivot_root; fresh/proc/dev/sys - Landlock path allowlist; hand-built seccomp-BPF deny-list as a balanced binary-search tree
--overlay DIR: copy-on-write views — agent edits freely, host never touched
Observability & enforcement (root daemon)
agentlsm serve: BPF LSM enforcement onlsm/file_open— per-cell deny prefixes, hot-swappable at runtime (sand lsm deny/allow/reset), kernel-side and invisible to the payload- unified live event stream (
sand lsm -f [deny,exec,open,net,trip]): LSM denials + exec/open/connect tracepoints + seccomp escape attempts (viaraw_syscalls/sys_exit) --net veth: daemon-provisioned veth + NAT (10.200.0.0/16), full teardown on exitagentmon: standalone monitor for ad-hoc cgroups + kernel-audit tail
Human-in-the-loop
--ask: blocked syscalls park in-kernel, supervisor approves per call on the terminal (y/n/a/k)
Long-running mode
sand servesets up isolation once;sand execstreams commands over a unix socket with fds passed viaSCM_RIGHTS(~2 ms/command vs ~5 ms one-shot)
Verified
make check: 49 tests locally (Arch, kernel 7.x, bpf LSM), 29 on CI (ubuntu-latest; privileged tiers skip cleanly). Performance: ~5 ms startup, +2.8% syscall overhead, 2.1 GB/s tmpfs scratch.
Requirements
x86_64 Linux. Build: clang, libbpf, libelf, zlib, xxd. Sandboxing itself needs no root; agentlsm/agentmon/--net veth need root and (for enforcement) bpf in /sys/kernel/security/lsm.