The agent factory loop, stage by stage, from the ground up

A round green device seen from above with its lid off, eight small modules in a ring joined by a cable, three with a button, a dark display in the centre

An agent factory is the old development cycle closed into a loop, where every stage leaves a record and a person moves from doing the work to three decisions: approving the description, confirming the verification and agreeing to the release. Agents prepare everything in between. This post walks the loop stage by stage and, at each one, asks the question that usually gets skipped: what does the system the agents run on have to do at this point?

The first post in this series argued that factories will land on machines with no admin. The second asked who owns the ground under them. Now the loop itself.

The old cycle in one paragraph

The classic software development lifecycle (SDLC) is a relay of people. An analyst gathers requirements, a developer writes, another reviews, a tester clicks through, an administrator deploys, someone watches the monitoring. Between them are hand-offs: a document, a ticket, a chat by the coffee machine. The knowledge of why something was done one way and not another lives in people’s heads. The most expensive resource was developer time. In an agent factory, execution gets cheap and the most expensive resource becomes a person’s attention. That turns the whole cycle around.

The loop in eight stages

1. INTAKE → 2. TRIAGE → 3. DESCRIPTION → 4. EXECUTION → 5. REVIEW
                        [person                               │
                         approves]                            ▼
8. MONITORING ← 7. RELEASE ←───────────────── 6. VERIFICATION
      │          [person                       [person
      │           accepts]                      confirms]
      └──────────────► back to 1

A coordinator runs above the loop: an agent that takes the trigger, works out which stage the work is at and starts the right agent with the right model. From the system’s side, the coordinator does one more thing: it opens a fresh cell with a different declaration for every stage. The triage agent does not need the same permissions as the release agent. If they all run in one cell, the whole loop holds the permissions of its most privileged stage.

1. Intake: one door

What happens: a ticket, an alert or a request lands in one queue.

Why it matters: a factory with work coming through six doors does not know what is on the table. You cannot measure throughput or cost.

What breaks without it: half the agent work happens outside the loop, on someone’s laptop, with no trace.

What the system does: makes sure an agent outside the queue has nowhere to go. A cell with no declaration gets no files and no network.

2. Triage: the cheapest saving

What happens: an agent reads the ticket, tries to reproduce the problem and sorts it into one of three bins: ready to execute, unclear and needs a description, parked and needs a person.

Why it matters: sorting and first diagnosis eat hours of the most experienced people. Here they get tickets already sorted.

What breaks without it: the execution agent gets a vague task and produces a lot of work that solves the wrong problem.

What the system does: reproducing a bug means running something whose content came from outside. The triage agent does it in a read-only cell with no network, which is destroyed when the task ends.

3. Description: where the loop’s quality is decided

What happens: for unclear tasks, an agent writes a description of what the user will see and of how the change fits what already runs. A person reads, corrects and approves before a single line of the change exists.

Why it matters: fixing a sentence in a description takes a minute. Fixing the same decision in a finished change takes a day. In the old cycle a person reviewed finished code. Here they review intent.

What breaks without it: review turns into archaeology.

What the system does: the description also carries the cell declaration for execution. The person approves not only what the agent will do but what it will get access to.

4. Execution: the least interesting stage

What happens: an agent takes the approved description and prepares the change.

Why it matters: less than it seems. If intake, triage and description work, execution is the most predictable part of the loop. Everyone wants to start here, because this is where results show.

What breaks if you start only here: a fast agent writes changes for tickets nobody sorted. People reject instead of approve.

What the system does: execution happens in a KyberCell built from the description’s declaration. The system injects secrets at the destination, so the agent never holds a key.

5. Review: the stage that teaches itself

What happens: a reviewer agent goes over the change before a person sees it. It has the description in front of it, so it judges the change against intent, not only style. A second agent collects the comments people leave in reviews and now and then proposes an edit to the reviewer’s instructions, for a person to accept.

Why it matters: the team’s conventions build up in the instructions with every comment, instead of waiting for a document nobody reads.

What breaks without it: a person repeats the same five comments every week.

What the system does: the reviewer reads not just the change but the record of how it was made: commands, files, connections. That record is trustworthy only if the execution agent could not edit it. That is why the log belongs to the system, not the agent.

6. Verification: a person confirms instead of chasing

What happens: an agent runs the result and walks the user’s path from start to finish. It attaches a recording or screenshots and checks the result against the description.

Why it matters: tests check what someone foresaw. A live walk-through catches the rest. A person watches a two-minute recording and says yes or no.

What breaks without it: the last stage before release depends on whether someone had time.

What the system does: verification only means something on the same image the change will ship on. If the test machine and the production machine differ by three manual fixes, the recording proves something other than you think. An immutable image removes that gap.

7. Release: the decision stays with a person

What happens: a person accepts the change and lets it out.

Why it matters: this is where risk passes from the team to customers. Someone has to sign for it. The agent prepares, checks and proposes. A person decides and answers for it.

What the system does: the release is atomic. The new version goes in whole or not at all, and if it fails its health check, the previous one comes back. That is how KyberLinux’s atomic updates work: a second slot, a switch on restart, one step back.

8. Monitoring: the loop closes

What happens: an agent watches the running product, catches failures and opens a ticket that goes back to stage one.

Why it matters: without this stage the factory is an assembly line. With it, it is a loop in which the product reports what needs fixing.

What the system does: gives the monitoring agent a record to read, not permission to repair. Monitoring opens a ticket. The fix goes through the same loop as any other change.

The second loop: a factory that improves the factory

A second loop runs above the product loop. An observer agent scores every run: what it cost, how many times a person had to correct something, whether the change came back as a bug. From that it proposes changes to the factory itself: a different model for triage, a sharper description instruction, a narrower cell declaration.

For that to be safe, the factory definition has to be code: versioned, testable on a share of tasks, and reversible. It is the same pattern an image-based operating system stands on. A new version of the factory is a new image in the second slot. If results are worse after a week, you go back in one step. A change to the factory goes the same way as a change to the product: proposal, review, a person’s approval. A factory that changes its own instructions and permissions without a person’s consent is, after a quarter, doing things nobody understands.

The old cycle and the factory

DimensionOld cycleAgent factory
Shapea relay of hand-offs between peoplea loop fed by monitoring
Where a person looksat finished codeat the description before work and the recording after verification
Most expensive resourcedeveloper timea person’s attention at decision points
Team knowledgein heads and a stale wikiin agent instructions, versioned
Permissionsthe account of whoever is workinga cell with a declaration for each stage
Trace of the workversion history and people’s memorya record of every step the agent cannot change
Releasea deployment, sometimes by handatomic, with rollback
Who answers for a releasea personstill a person

Where the factory does harm

Tasks that only look simple. “Bump the library version” sounds like an agent’s job until the new version changes how the invoicing module rounds. Start with tasks where a mistake is cheap and shows up at once.

One wide cell for the whole loop. Convenient, because nothing stops to ask. But then the triage agent, which reads content from the internet, holds the same permissions as the release agent.

Self-improvement without a brake. A change to the factory without a person’s approval is drift, not progress.

A factory without people. A team told that the factory will replace them will leave before the factory runs.

How you know the factory works

Vanity metricOutcome metric
number of changes prepared by agentshow many times a person touched one change between ticket and release
tokens usedthe cost of one closed change, and its trend
number of running cellshow many cells hold a wider declaration than their stage needs
“agents do most of the work”lead time for changes, deployment frequency, change failure rate and time to restore service (the four DORA measures)

The system bears directly on the last two measures. An atomic release with rollback shortens time to restore service to a single restart.

Where to start: the order of building

Each step gives you a working system. You can stop after any of them.

  1. The ground. Before the first agent runs: one cell with a narrow declaration and a record the agent cannot change. Without that, every later step leaves a trace only in people’s memory.
  2. Triage. An agent sorts tickets into three bins, in a read-only cell.
  3. Descriptions. For unclear tasks, an agent writes the description and the cell declaration, and a person approves both.
  4. Review with a learning loop. The reviewer reads the change together with the record of how it was made.
  5. Verification on the same image. An agent walks the user’s path on the image that will ship.
  6. Wiring and measurement. The coordinator connects the stages, monitoring feeds intake, the observer scores runs. Only now does the second loop start.

KyberLinux is pre-launch: cells, the record and atomic images are a design we are building, not something you can install today. You can start designing the loop now, on any system, with the question we asked at every stage. There is more about the system itself on the home page.

On Monday, take your last twenty tickets and note, next to each, what permissions an agent handling it would run with. If for most of them the answer is “the same as my team”, the first step is not an agent. It is a cell.

That leaves a decision. You can give the team a fast agent on one person’s account and watch the review queue grow, along with the list of things nobody can reconstruct. Or you can build the loop on ground where every stage has its own cell, its own record and its own way back, and people approve what genuinely needs their judgement.