Primers · AI agents

Loops and Graphs: Approve Only the Last Step

On August 23, 2026, AI researcher Hanako published a post on X with an unfashionable claim: the reason you still review every step your agents take is not the model. It is the shape of the system around it. Her fix comes in two layers, and almost everyone builds only one of them.

A loop makes one unit of work correct without you in the room. A graph decides which units exist and what runs in parallel. Build both, and the human stops being the slowest node and approves exactly one thing: the merge.

X shows the post at roughly ten million views. This primer teaches the public framework and checks its arithmetic.

Researched October 2026  ·  AIEngineering
Ink diagram: a node containing a circular loop fans out to four parallel nodes, passes through a small gate with a red flag, and reaches a final node where a hand stamps an approval check

The brief

Most agent setups fail in the chair, not in the model: a person writes a prompt, reads the output, writes the next prompt, and becomes the loop personally.

The loop, inside each unit, is produce, check, correct, repeat until green; the check must be something a program can evaluate, written before the work starts. The graph, between units, is nodes (bounded jobs, one input, one output) and edges (real dependencies, nothing else).

A loop makes a unit of work correct without you; a graph decides which units exist at all.

How it works

Four mechanisms, in the order they bite: the loop, the graph, the way back, and the gate.

A loop is a check that can fail, and the gate opens on blast radius, not confidence.

Figure 1: one unit, start to green

One slice goes through the loop; watch how little of the other three its failure touches.

The worked example: the handlers slice from Hanako's porting job, going through the loop. Step through it.

The handlers slice, through the loop

Tap the card, swipe, or use the arrows.

Figure 2: audit the arrows

A codebase audit: a splitter hands four areas to four workers, a code node merges and dedupes their findings, a gate checks the result. Each worker needs ten minutes. As first typed, though, the workers were chained one after another out of habit, and the dashed red arrows below are that habit.

Apply her test to each one: does the next audit read the previous audit's output? Tap an arrow to cut or restore it, and watch the wall clock.

Four auditors, three arrows that should not exist
45 min
wall clock, as drawn
45 min
total work, same however wired
1.0x
faster than the fully chained version

The running time is its longest true-dependency path, the critical path, not the sum of its nodes. Node kinds: splitter, worker, code node, gate. Describe a step without the words judge, decide, assess, or summarize, and it is a code node; a model there only adds cost and variance.

Every arrow you cannot justify with a named variable is wall clock you are donating.

The math of the way back

Why does returning the unit instead of the batch matter so much? Because probabilities multiply. A batch has n units; each unit, on any attempt, passes its check with probability p, independently.

If one failure sends the whole batch back, the batch survives a round only when every unit passes at once. If failures return individually, each unit repeats on its own. (Independence is the friendly assumption; a fault in the shared plan breaks it.) The expected totals:

$$E_{unit} = \frac{n}{p} \qquad\qquad E_{batch} = \frac{n}{p^{n}}$$
Eunit expected total runs, unit returnEbatch expected total runs, batch returnn units in the batchp chance one unit passes on one attemptpn chance all n pass in one round

Plug in the article's port: n = 4 slices, a decent worker at p = 0.75. Then p4 = 0.316, so all four pass together only about 32 percent of rounds.

Unit return: 4 / 0.75 = 5.33 runs expected to get everything green. Batch return: 4 / 0.316 = 12.64 runs, about 2.4 times the work, spent re-running slices that were already correct.

Batch return costs about 2.4 times the work, spent re-running slices that were already correct.

The attempt cap comes from the same multiplication: a unit that fails three honest attempts is not unlucky, it is evidence against the plan that produced it, and the loop inside the node cannot see the plan. The cap routes that evidence upward.

Timeline

Four years of assembly: the loop inside one agent, the graph as a framework, then Hanako fusing the stack.

Tap the card, swipe, or use the arrows.

Key voices

Hanako's synthesis, and Anthropic's production evidence for fan-out.

Where leaders think this goes

The human belongs at the highest-consequence step.

Positions as of October 2026, each attributed.

Where they agree

Where they split

Takeaways

Return the unit, not the batch: at four units passing 75 percent of attempts, batch return costs about 12.6 runs to unit return’s 5.3.

The babysitting was never a model problem. It was a shape problem: work with no check that can fail, chained in an order nobody chose. Loops make one unit trustworthy, graphs make the set of units sane, and the human moves to the single approval that carries real consequence.

Keep exploring

Sources

    Honesty notes. Hanako's framework is one practitioner's system, and a product: the Five Layers course behind it is paywalled; its lessons were not audited here. Anthropic's 90.2 percent and 15x figures come from Anthropic's own internal evaluation. Walden Yan's 2026 follow-up was not read firsthand; its position is summarized from secondary accounts. The return formulas assume independent attempts; real units share a plan, so failures correlate, which strengthens the case for the attempt cap.