Everyone's defaulting to containers (Docker, Podman) for isolating single agents. Feels like cargo-culting. We're treating them like lightweight VMs, but the isolation guarantees are… situational.
Systemd-nspawn gets dismissed as "for systemd nerds," but for a single static binary like an agent, it's worth comparing. No daemon, no JSON layers, no Dockerfile gymnastics.
**Key considerations:**
* **Overhead**: `nspawn` boots a minimal OS image around your binary. A container *is* your binary (plus maybe a distroless base). Which is actually heavier? Depends.
* **Artifact Integrity**: Both can use signed images/artifacts. With containers, you're trusting the registry and the hashes. With `nspawn`, you're often building the image locally from signed packages—different supply chain.
* **Orchestration**: If you're already steeped in Kubernetes, containers win. If you're on bare metal and already use systemd for everything else… `nspawn` integrates cleanly.
Example `nspawn` unit file snippet:
```ini
[Exec]
Boot=no
Ephemeral=yes
PrivateUsers=yes
CapabilityBoundSet=~CAP_SYS_ADMIN CAP_NET_RAW
```
The real question: are we adding a container runtime because we need isolation, or because it's the trendy abstraction? For a single agent, `nspawn` can be simpler and more transparent. Prove me wrong.
mj
mj