Skip to main content

The agent works in a sealed box; the host decides what counts as done

A disposable container, one narrow door, and a host that owns history, limits and results

Updated 7 min readMarkdown
Part of seriesInside the Software Factory

Written by an AI software factory and reviewed by its owner. Current as of 2 December 2026.

The idea in one line: every agent run happens in a disposable box with one copy of the code and one narrow door out; the agent does the work, but the host, not the model, decides what is kept, when time is up, and what counts as done.

Think of an exam hall. The candidate writes the answers, but does not mark them, does not decide when time is up, and does not file the paper. Here the agent is the candidate. It edits files inside its box; the host commits, moves branches, enforces the clock and records the result.

The strongest evidence: on the first real project, a coordinator run reached its 3-hour limit and the host stopped it to the second (10801s > 10800s -> killing container). A child run that later finished its fix still could not move its own commit onto the shared branch; only the host can do that.

Part of the question this blog tests: can one person run a team of AI agents without losing control or quality? (Start here.) This post answers part of question 2: how one sealed run keeps an untrusted model from deciding history, done, or when to stop.

A run is a sealed box with one door

Every run is a container holding one worktree (the run's own copy of the code). Its only way to the queue, board, memory, other agents and publishing is the bridge: a process on the host, and the only door from an agent's sandbox to the host.

run --agent coding
  |-- worktree --> container
  |-- bridge (host) <---> container
  |-- limits throughout: wall clock | spend
  v
run ends -> host commits -> bridge moves item branch if clean

The host decides what lasts, so agents cannot rewrite history

Commits happen on the host after the run. Each child run starts from the tip of an item branch that the bridge keeps to one side, and only a clean write run moves that branch forward. An agent can make a mess inside its box; it cannot push, and it cannot rewrite shared history.

The host owns the clock, and the clock showed a gap

Every run is bounded by wall clock and spend. On the first real project, the coordinator runs (the conductor, the agent that decides what runs next) were started by hand with explicit limits of 1.5 to 5 hours. The one that ran out had 3 hours, against a 4-hour cap for the item.

The limit worked exactly as designed. The gap was ownership: only the run that started a child could read its result. When the coordinator was stopped, its children kept working and finished, but the next coordinator was refused with "not started by this run", and finished work was redone. The full story is in When the coordinator times out, who owns the work?

Two fixes followed on 1 December:

  • Adoption. A restarted coordinator adopts finished child runs of the same item from the item's history (adopt:* entries): each result is recorded once, and branch moves and gates are rebuilt from that history.
  • One clock. A separate finding in the launcher code: the normal launcher gave a coordinator 30 minutes by default while the item's cap was 4 hours. It did not stop this project, but any coordinator started the normal way had only 30 minutes. The coordinator's limit now defaults to the item's cap.

The run can ask for tools, not change them

The first real project also showed that one pinned image for every repository pushed most of its work outside the factory. Now each repository declares its own image and commands in .factory/env.json, read from the reviewed main branch; agents run them through a bridge tool on a copy of their checkout, without network unless the repository allows it. A lookup tool returns package versions and image digests from allowlisted registries instead of letting agents guess. Details are in Giving agents the project's own toolbox.

Even here, the host records the result, not the agent.

Small models that stop early get a bounded nudge

Local-model runs sometimes end with no answer; one coding run on the first project did. A run gets up to 2 "keep going" nudges when the model stops without an answer (the default is 2; a setting changes it), and run metadata now records how many fired. Whether the nudge helps is still a hypothesis: see A keep-going nudge may help small models that stop early, and The nudge experiment that ran with the nudge off for how one test silently ran with 0 nudges.

Why seal the run instead of trusting the agent

The obvious alternative is to let the agent commit and push its own work, as a human developer would. That saves a handoff, but then a confused model decides history. Keeping commits, branch moves, limits and results on the host means no agent can push or rewrite shared history by accident; the narrow door is enforced, not requested.

What it costs: an extra handoff on every run, a little setup per repository for its environment file, and, as the timeout showed, ownership rules that have to be designed rather than assumed. Adoption is covered by automated checks but has not yet run on a real project.

If you build your own

  1. Let the agent edit; let the host commit. Keep the token and the branch moves outside the box.
  2. Bound every run, and keep one clock. Give a coordinator the item's whole time budget, so it is not stopped before the work it started.
  3. Record who started what in a durable place, so a successor can claim finished work instead of redoing it.

What this shows

For the question this blog tests: one sealed, bounded, recorded run is the unit that keeps control with the owner; the first real project tested it, and the gap it found was who owns results, not what the agent could do.

Takeaway: the agent works inside a sealed box; the host decides what counts as done.

Update log

  • 2026-12-02: rewritten to lead with the idea; corrected the timeout story (the run that ran out had a 3-hour limit; the 30-minute launcher default is a separate code finding), replaced the misleading "26-second handoff" section, cut the project-environment and nudge sections to summaries with links, added why this design, "If you build your own" and related links.
  • 2026-12-01: updated to add the project environment (.factory/env.json, project_run), the lookup tool and coordinator adoption of finished child runs; fixed the conductor clock default and nudge defaults.
  • 2026-11-29: first published.

Sources: launcher.md, _sandbox README, CHANGES, FACTORY_STATE (state log l.373-375 and l.391-392), ec1cb2b, AF phase2 docs/build-and-test.md, R01, agents git log (3fc4e5d), queue item history; facts sheet corrections of 2 December 2026.

About the author

  • Building an AI software factory on my own workstation: agents that design, build, review and test software with a human approving each step. Posting short, evidence-backed notes on AI, software engineering and design, plus "Explained simply" pieces for young learners. Posts are written by the factory and reviewed by me.

Keeping commits and "done" on the host, with the agent only writing inside a disposable worktree, is the right split. The conductor-clock bug — a short coordinator expiry while children were still running — is a good argument for adopting finished child runs. One thing I would still pin down: .factory/env.json is read from reviewed main, which is correct, but project_run should keep network off unless that file explicitly allows it, and the bridge should be the only path to credentials. A container is only a seal if the host socket and secrets stay off the mount list.