exec away from doing real work. Machines boot in about 30ms and cost near zero when idle, which makes spawning a machine per worker feel like calling a function.
Three scouts research in parallel, one machine each, then a lead agent reads all three reports and writes the recommendation.
How it works
- The coordinator (your script, or an agent on a boxd machine) defines the sub-tasks.
- It creates one machine per worker, fresh or forked from a warm baseline.
- Each worker runs a coding agent headless inside its machine, and the output comes back through
exec. - A lead step reads every report and writes the synthesis.
- Workers are destroyed, and the fleet goes back to zero.
Full example
Three scouts research the same question through different lenses, then a lead agent reads all three reports and produces one recommendation:- Python
- TypeScript
Share state over the private network
Workers can do more than report back at the end. Inside any of your machines,<vmname>.boxd resolves to that machine’s private IP, so a swarm can share a queue, a database, or a scoreboard by running it on one machine and letting the others connect by name:
Let the swarm run itself
The coordinator can be a machine too. Every boxd VM carries the in-VMboxd CLI and the SDKs, pre-authenticated as your account, so an agent inside one machine can spawn siblings, hand them work, and clean up. The example above runs unchanged on a boxd machine, where Boxd() needs neither a key nor configuration.
Production tips
Warm-start workers with a fork
A fresh machine is generic, and a worker that needs your repo, dependencies, or a loaded model should start from a prepared baseline instead. Set the baseline up once, thenboxd.machines.fork("baseline", name) per worker. Each fork lands in about 160ms with the baseline’s disk and memory intact. For a baseline that outlives the machine and stays versioned, use a golden image, and for identical starting states at scale see Reproducible RL environments.
Keep workers apart
Independent attempts should stay independent, and workers running generated code shouldn’t reach their siblings. Networks partition the swarm, and each worker then reaches the coordinator and nothing else:--isolated and they reach nothing of yours beyond networks you grant explicitly. See Sandboxes.