Sandlock: Confining AI Agent Code with Unprivileged Linux Primitives
Sandlock is a lightweight Linux process sandbox that compiles static, input-independent policy into kernel-enforced rules while a narrow supervisor handles runtime-dependent decisions and virtualized effects, enforcing filesystem, network, IPC, and syscall policies without root, cgroups, images, or mandatory namespaces. It supports dynamic network decisions, HTTP-level access control, TOCTOU-safe inspection of execve arguments, and reversible filesystem effects, adding roughly 5 ms of startup overhead and running Redis at bare-metal throughput on the authors' workstation. Its pipeline operator further supports per-stage confinement for separating data, network, and untrusted-content capabilities.