field note / 2026 / ai-agents + sandboxing A sandboxed agent operations desk with a terminal trace, VM checkpoint diagram, credential-injection note, isolated shell monitor, and rollback timeline spread across a dark lab bench.

field dossier

Fly Sprites Make Agent Sandboxes Stateful

Fly.io's new agent-sandbox writing lands the missing operational shape for autonomous coding: keep the agent loop durable, run generated commands in a separate machine, checkpoint before risk, and make recovery a primitive instead of a prayer.

Fly.io’s new Sprites writeup gives coding agents the thing they have been missing since everyone shoved a shell into a chat loop: a body plan. The agent brain gets a durable home. The command runner gets a padded room. State can survive when it should, disappear when it must, and roll back when the model does something terminally stupid like deleting its own toolchain.

This is a revisit of the agent-infrastructure thread I covered in Cloudflare Made Agent Sandboxing an Edge Runtime Problem, WebMCP Makes the Browser an Agent Contract, and GitHub Actions Grew a Process Model. Those pieces tracked isolates, browser tool declarations, and CI supervision. The new development is Fly’s July 5 post, Building Agents that Don’t Break Themselves, which drags the discussion down to the messier layer where agents run bash -c, hold history, install packages, lose files, leak tokens, and need undo buttons.

That split sounds obvious until you inspect most agent products. They keep building cathedral prompts around a single process and then paper over the danger with approval modals. The model asks to run a command. The user approves. The command runs in whatever workspace happens to be mounted. The toolchain, secrets, repo, package cache, and agent runtime all sit inside the same blast radius, trusting a stochastic command string because a human got tired of clicking yes.

Approval fatigue is fake security with a user-hostile skin. A sandbox boundary is real security if the boundary survives boredom.

Fly’s language is better than the usual vendor sludge because it names the physiology. The brain is the long-lived agent loop: memory, instructions, history, task state, client session. The hands are the execution environment: shell commands, package installs, tests, migrations, generated snippets, and all the filesystem vandalism a model can hallucinate. The brain should be comfortable. The hands should live somewhere you can burn down without mourning.

The SpriteDoc case study in Fly’s post shows the multi-user version. A troubleshooting agent runs multiple users on one server, but spins up a fresh Sprite when a session needs a filesystem or shell. The key detail is the token handling. flyctl can run as the user, while the token is injected only for one command and never stored on disk. If the Sprite is snapshotted or compromised later, there is no resting credential waiting like a mint-condition idiot prize.

That is the credential lesson agent stacks keep refusing to learn. The model should get capability-shaped moments, not ambient authority. A token that appears only for one command is a different object from a token sitting in $HOME/.config because some setup wizard wanted convenience. Convenience is how your secrets become archaeology.

The Hermes case study is closer to the daily reality of autonomous coding. Hermes keeps one Sprite per task so package installs, cloned repos, compiled artifacts, and intermediate state survive across commands. That persistence matters. Purely disposable sandboxes are clean, but they can make every command feel like waking up in a fresh motel room with no socks. A serious coding agent needs continuity. It also needs the ability to throw continuity away when it poisons itself.

Fly’s answer is checkpointing. Before a risky operation, snapshot the execution environment. If the model runs a bad cleanup and deletes /root/app, python3, and git, restore the checkpoint. The post says restores take roughly nine seconds. Nine seconds is short enough to become muscle memory. That changes failure from catastrophe into control flow.

This is why the SlopCodeBench result belongs in the same conversation. The arXiv paper reports a benchmark of 36 problems and 196 checkpoints where agents repeatedly extend their own code. No evaluated agent solved any problem end-to-end. Structural erosion rose in 77 percent of trajectories and verbosity rose in 75.5 percent. The paper’s numbers are not a dunk on one model family. They describe a systems failure: agents accumulate weird local decisions, then keep editing inside the weirdness they created.

A sandbox will not make bad architecture good. It gives the operator a way to isolate, inspect, rewind, and compare the damage. That distinction matters. The opposite of slop is not a magic prompt. The opposite of slop is a maintenance loop with boundaries: state diffs, test runs, rollback points, file ownership, scoped credentials, and review gates.

The follow-up cleanliness paper, Does Code Cleanliness Affect Coding Agents?, points in the same direction from another angle. Cleaner code barely changed pass rate, but it reduced input tokens by 7.1 percent, output tokens by 8.5 percent, reasoning characters by 11.1 percent, and file revisits by 33.8 percent. Agents consume code by navigating it. Runtime architecture has to assume the agent will get lost, loop, over-read, patch the wrong hotspot, and need a way back.

The sharp contrast with Cloudflare is workload shape. Dynamic Workers are excellent for small generated programs, API composition, and fast isolate execution where startup time and density dominate. Sprites target the ugly Linux workbench: repos, package managers, compilers, migrations, test suites, arbitrary binaries, and tools that expect a real machine. The industry keeps trying to pick one sandbox story because product pages hate nuance. The actual answer is a menu. Isolate for tiny code. MicroVM for hostile shells. Browser contract for web actions. CI supervisor for build graphs. The dumb architecture is pretending one substrate should eat all of that.

Peek-cli, a small HN-discovered artifact, shows another edge of the same problem. Its repository lets coding agents see browser tabs through screenshots streamed by an extension and WebSocket server, while claiming the agent cannot inject scripts or perform actions. That is intentionally narrow, and narrow is the point. A browser tab is a dangerous sensory organ. Giving an agent pixels without click authority is a different capability from giving it full browser automation. Crude? Sure. Safer than another omnipotent extension asking everyone to trust the vibes? Absolutely.

The same principle keeps recurring: split capability by consequence. Seeing a browser, calling a declared WebMCP tool, running a generated TypeScript function, launching a background service in CI, and executing rm -rf in a repo are different acts. They deserve different envelopes. Agent platforms that flatten them into one universal tool pipe are building roulette wheels with syntax highlighting.

Fly’s most useful contribution is cultural, not novel in the academic sense. VMs, checkpoints, copy-on-write filesystems, injected secrets, and process isolation are old tools. Good. Old tools have scars. The agent boom needs fewer metaphors about digital coworkers and more boring inheritance from operating systems. Processes crash. Filesystems corrupt. Secrets leak. Users get tired. Workloads need supervisors. Dangerous actions need blast shields. State needs rollback.

The checkpoint is the philosophical move. It admits that agents will hurt themselves. That sounds pessimistic only if you have never operated computers. Software has always needed undo, transactions, snapshots, journaling, backups, tests, staging, and disaster recovery. Agents simply make the old lesson noisy because they can generate the disaster faster than a junior engineer can paste from Stack Overflow.

The next good agent runtime will look disappointingly like ops. It will have state directories, permissions, rollback, budget controls, network policy, trace logs, command provenance, and boring recovery primitives. It will stop asking users to bless every dangerous command and start making dangerous commands survivable by construction.

That is the real promise in Fly’s Sprites pitch. Agents do not need a bigger permission modal. They need an operating model where the brain can persist, the hands can fail, and the machine can recover before the user has to play priest over another bash -c confession.