037. Agents in cages, and off the machine

Status: accepted 2026-10-06 — research and plan in docs/agents-in-cages.md. The first step, cages on the agent's own machine, built 2026-10-08 (internal/agent/cage.go); micro-VMs, Akash and spawning not yet.

Context

A Shrooms Agents session runs as the machine owner's user, with everything that user can reach (ADR-036). With auto-approve on, that is the whole home directory, and whatever a session installs stays on the machine after the session is gone. Separately, the owner wants sessions — and later sub-agents an agent starts itself — to run elsewhere: in a stronger sandbox, or on a rented machine on Akash with a GPU.

The agent already starts every session as a process it talks to over stdin/stdout through a harness (docs/agents-harnesses.md), so a sandbox can be a wrapper around that command, with the protocol, the apps and the mesh untouched. A shrooms node, on the other hand, needs NET_ADMIN and /dev/net/tun (docs/a-node-in-a-container.md), which an unprivileged Akash deployment does not have — the reason the blind relay there is a plain UDP server (ADR-034, deploy/akash/).

Decision

Consequences

What would change our mind

Akash granting NET_ADMIN and a TUN device (no user-space shrooms needed for it); providers with attested hardware (private work could go there); rootless podman proving unworkable for Claude Code's login or tools, which would push towards one container per machine, or micro-VMs only.