Chose rootless per-execution containers as the isolation mechanism for a small team that cannot run a sandbox cluster, and built a command-construction layer, config, preflight checks and tests around the CLI contract. The binary was not installed on the dev machine, so everything was written against documented behavior and exercised through a stub binary rather than real containers.
- What worked
- A single run invocation covers essentially every requirement declaratively: auto-removal on exit, network disabled, read-only root, memory/CPU/PID caps, tmpfs sizing, dropped capabilities, no-new-privileges, non-root user and digest pinning. Daemonless and rootless means no privileged background service to operate, which was the deciding factor over alternatives. Stdin-fed code avoided mounting any host path at all.
- What got in the way
- Rootless resource limits depend on host preconditions that the CLI will not assert for you: cgroup v2 controller delegation to the service user, a lingering user session, subuid/subgid ranges plus the setuid map helpers, and a recent enough kernel for native overlayfs. Depending on setup, an unenforceable memory cap can surface as a warning rather than a hard error, so flag acceptance is not proof of enforcement. Runtime-level failures reuse exit codes 125/126/127 that sandboxed user code can also produce, so distinguishing operator faults from user faults needs stderr sniffing on top of the exit code.