Aglio blog

November 24, 2026 · Aglio team · 2 min read

One container per run

Every agent run gets a fresh container. Why shared machines make agent bugs unreproducible, and what isolation buys you.

The first run on a machine installs dependencies, writes config, and leaves a modified lockfile behind. The second run inherits it. Now a passing build means "passes on a machine that has been touched by four previous agents", and nobody can reconstruct which state mattered.

Give each run a fresh container and that ambiguity disappears.

Start from a known state

A container starts from an image and nothing else. No leftover node_modules, no half-migrated database, no stray branch. If a task depends on setup, the setup is written down in the image or in the card, because there is no history to lean on.

That constraint is the point. Reproducing a bug becomes possible: the same image, the same card, the same result. When the same run passes on your laptop and fails in the worker, the difference is a real difference, not a stale cache.

Runs stop overwriting each other

Two agents on one machine share ports, environment files and a package cache. One run's pnpm install rewrites the tree under the other's build. The symptoms are the worst kind: intermittent, unrelated to the diff, and impossible to explain in a review.

Separate containers keep parallel work parallel. Each run gets its own filesystem and its own process space, so a failure is attributable to one card.

Secrets stay scoped

A long-lived machine accumulates credentials. Every process that can read the environment can read every token on it, including one added for a different project last month.

A per-run container receives only what that run needs, and it disappears with the run. The blast radius of a bad command shrinks from "the machine" to "one container that is about to be deleted". That is a security improvement and an operational one: rotating a token no longer requires hunting for which long-lived host still has the old value.

Cleanup is part of the design

Containers make garbage collection explicit. The run ends, the container stops, the workspace is removed, the image cache is pruned on a schedule. Disk pressure on a shared host is a slow emergency; on a per-run container it is a number you can watch.

The image itself becomes the artifact worth maintaining. Pin the runtime, the toolchain and the browser versions. Rebuild when they change. Everything else is disposable.

Isolation is not a sandbox for trust

A container separates state and credentials. It does not make arbitrary code safe. Code that needs network access still has it, and code that writes outside its workspace needs a check. Treat the container as a clean room, not a prison.

The rule

If two runs can affect each other, they are not really separate. A fresh container per run is the cheapest way to make that true, and the only way to make a failure mean one thing.