Why AI agents need persistent computers
Agents that do real work build up state: repos, packages, caches, sessions. Throwing that away after every run is slow, expensive, and fragile.
Dock team · · 5 min read
The first wave of agent infrastructure was built for one job: run a snippet of code safely and return the output. A fresh sandbox per call is perfect for that. It is a poor fit for the work agents do now.
A coding agent fixing a bug clones the repository, installs dependencies, starts a database, builds the app, runs the tests, and opens a browser to check the result. By the time it writes the fix, it has built up a small world around the task.
Rebuilding the world on every run
If the machine disappears when the run ends, the next run starts from zero. Every follow-up, every review comment, every retry pays for the same clone, the same install, and the same build again.
That cost is not only time. Cold starts are where flaky failures live: a registry times out, a package version moves, a cache misses. Each rebuild is another chance for the environment, not the code, to break.
Keep the machine, not just the files
A persistent computer keeps everything the agent set up. When the task pauses, you archive the machine: its disk is saved as a snapshot and compute billing stops. When work resumes, the same machine comes back with the same ID and the same files.
This is the model Dock is built on. A dock is a full Ubuntu machine with root, Docker, SSH, and a browser. Archive it when the agent is idle, resume it when the next task arrives, and pay only for the time it actually runs.
State makes work inspectable
Persistence also makes agent work easier to review. If the machine is still there, a person can open it, look at the files, rerun a command, or take over the browser. Combined with a timeline of every command and connection, you can see how a result was produced instead of guessing.
When a disposable sandbox is still right
Short, stateless jobs, such as evaluating a code snippet or running a single test file, do not need a persistent machine. Use the lightest tool that fits. Once an agent works across many steps, sessions, or people, a computer it can come back to stops being a luxury.