Frontier Foundry

Verification Loops & Backpressure

The Factory District · AI Coding & Software Factories

Tests, type checks, linters and judges that push back on agent output so it self-corrects.

Also called: verification loop, backpressure, test-driven, TDD, self-verification, feedback loop, test suite. In the glossary.

How it works, as a machineThe Gauge Room · patches

Follow one patch from a change order to a clean shadow run, in a gauge room with a shadow dock and a return chute.

  1. Write the failing test
  2. Cut the patch
  3. Gauge the build
  4. Run the suite
  5. Replay live traffic
Play Verification Loops & Backpressure

Verification Loops & Backpressure in plain words

A verification loop sends an agent's work through checks such as tests, type checkers, linters and reviewers, and sends failures back with the reason. The agent fixes and tries again until the checks pass. This pushback is what lets agents run unattended without piling up broken work.

An analogy

A driving school car with a second brake pedal. The learner steers, and each time the car drifts the instructor's foot stops it and says why. Round the block they go until a full lap needs no brake, and only then is the learner allowed out alone.

How Verification Loops & Backpressure connects

10 typed relations in the knowledge graph

Builds on

  • Coding Agents: The patch lathe is the agent that edits the code and the tests.
  • Evals: The test cage is a suite of cases; how well it covers decides what it can catch.
  • Software Factory: The shadow projector and the regression mould are gates and lessons of a verified line.

Built on by

  • AI Slop: The rule turnstile is one check in the loops that tell whether an agent's work is done.
  • Coding Agents: Checks that send work back with a finding are verification loops.
  • Formal Verification: The kernel names the failing step; the Rust migration used the same idea with a live system as the oracle.
  • Long-Horizon & Background Agents: The fresh-eyes bench is a verification loop: a second context tests the work until the outcome is met.
  • Software Factory: Back pressure: deterministic checks an agent must pass before its work moves on.
  • Spec-Driven Development: The scenario turnstile is a verification loop: run the build, read the failure, go round again.

Guards against

  • AI Slop: Work that must pass its checks before it moves on cannot pile up unreviewed.

See Verification Loops & Backpressure in the knowledge graph

Verification Loops & Backpressure in the news

from the daily digests

Who is behind Verification Loops & Backpressure

people, labs, products and models

People

  • Boris Cherny (champions): Claude-written production code gets a higher bar: lint rules, tests, Claude-driven end-to-end tests and fuzzers.
  • Lauren Tan (champions): Make agents prove their work: lint rules, runtime verification with feature maps, TLA+ and Lean.

Named in its facts

What the sources say

3 parts · 11 sources · updated 2026-11-27

A verification loop sends an agent's work through checks that push back: the build and type gauges, the tests, and for large changes a comparison with the old system on real traffic. A failure returns to the agent with a message it can act on, and the agent tries again. The sources agree that the check defines what the loop treats as progress, so tests the agent can edit or that cover too little let wrong work through, and the strongest checks cost time.

The bench: a red test, then a patch

A change starts as a test that fails, written before any fix exists, and an agent then cuts the patch that turns it green. The danger sits here: when the same agent edits the code and the tests, green stops meaning right. The sources that trust agent-written code lean on tests that predate the work and that the agent cannot touch.

  1. The red test bench takes the change order and writes the test that fails before any fix exists.
  2. The patch lathe cuts the patch that turns the test green, and may edit the old tests it touches.
more than 100
Weakened assertions Anthropic found when it audited the tests it had ported for its Python-to-Rust migration, as reported by Anthropic Anthropic
2,900 lines
Size of a "compiler" one agent wrote that memorized the visible test inputs in a coding-agent benchmark, as reported by an a16z essay Yoko Li
  • In red-green test-driven development the developer starts with a failing test, because the feature does not exist yet, and only then works to make it pass. Marlene Mhangami
  • With an agent, writing the failing test and the code that passes it are both fast, so the speaker would spend the saved time refactoring what the agent wrote. Marlene Mhangami
  • Tests an AI writes can be self-affirming: the suite is green and coverage passes while the behavior of the system is not checked. Marlene Mhangami

When it breaksTests that changed with the code. Anthropic ported its Messages API from Python to Rust. The integration tests ran the Python API inside the test process and mocked services in Python memory, so the tests had to change along with the code, and Claude helped with both. An audit of the ported tests found more than 100 weakened assertions, so a pass could mean the code was right or that the test had been changed to let wrong code through. Anthropic

The gauge room: build, types and tests

Before anyone reads a patch it goes through checks the agent can run for itself: the build, type and lint errors, then the test suite. A failure goes back to the agent with a message it can act on, so a lap takes seconds and costs nothing. The sources warn that the tests cover only the cases someone thought of.

  1. The build gauge compiles the patch and reads the type and lint errors; a failure goes back with its message.
  2. The test cage runs the suite; a failing test names the case and sends the patch back to the lathe.
about 700
Integration tests Anthropic already had for its Messages API, the first check it used on the Rust port, as reported by Anthropic Anthropic
over a million combinations
Combinations of 20 binary options, about 12 days of tests at a second each for one model, so the suite tests a subset; reported by Anthropic Anthropic
under a second
Time for the local input check to compare the two versions in the agent sandbox, since it never called the model; reported by Anthropic Anthropic
about 98% vs a quarter
Share of its own tests the Rust API passed in April against the share of production inputs that matched, as reported by Anthropic Anthropic
13% of PRs
Share of pull requests on one code-review platform that had at least one required CI failure, as reported by its engineer Gautam Korlam
about 10 minutes to under 1
CI time before and after caching and sharding, for incremental steps once warm, as reported by one team Gautam Korlam
about half
Share of pull requests that passed a coding benchmark grader and that maintainers judged good enough to merge in one study, as reported in a talk Laurie Voss
44% fewer
AI-derived production outages reported by users of multilayered verification compared with others; a vendor claim, not independently checked Tariq Shaukat
  • Inside one agent turn, verification means checks the agent runs for itself: whether the build works, lint errors, type errors, runtime errors in the preview, and a headless browser to explore the app. Fabian Hedin
  • A second, outer loop runs between turns, when the agent hands back to the user: how visitors behave, what users report, automatic A/B tests and business metrics such as conversions. Fabian Hedin
  • Factory's CTO defines agent readiness as how many deterministic validation loops a code base has, such as linters, type checkers, security scans and end-to-end tests; with many of them agents work longer on harder tasks without a person. Eno Reyes

When it breaksGreen at 98%, wrong on three of four inputs. The Rust version of Anthropic's Messages API passed about 98% of its tests in April, yet only about a quarter of inputs matched on production traffic. One cause: Python escapes some characters in JSON tool calls as text codes and Rust wrote them as they were, so prompts differed by a few bytes. In a suite each case counts once; in live traffic one common bug shows up in every request that triggers it. Anthropic

The shadow dock: old and new on the same traffic

The strongest check in the sources runs the old system and the new one on the same live requests and compares every step, so "correct" is whatever the old one did. It is slow, hours or days a lap, so it sits after the fast checks, and what it catches becomes a permanent test. A person still decides whether a matching fix is a good one.

  1. The shadow dock replays the same live requests through old and new code and compares every step.
  2. The live chute sends the matched patch to production while shadowed traffic watches for the fingerprint.
  3. The regression mould turns each caught miss into a test that fails if the versions drift again.
hours or days
How long one lap of the production loop takes, shadowed live traffic, against local checks that take under a second; reported by Anthropic Anthropic
hours or days
Feedback time in the first design, when every hypothesis needed a review and a deployment before the agent saw a signal; reported by Anthropic Anthropic
about $5 a PR
What one team says it costs to run all the checks it wants on each pull request, security scans among them, and judges worth paying for Greg Pstrucha
741% more code, 30% more shipped
Developers who turned on autonomous agents wrote far more code and shipped only a little more software in one study, as cited in a talk Laurie Voss
20 days
Time to merge changes one at a time and keep the main branch green in one very large monorepo before a merge queue was built, as reported by an engineer Gautam Korlam
99.8%
Share of the existing test suite that passed for a million-line Zig-to-Rust port of Bun, the gate for that change, as cited in a talk Laurie Voss
13,044 vs about 74
Unsafe blocks in the ported Rust against a comparable human-written code base of that size, which a suite never designed to look for them cannot certify; as cited in a talk Laurie Voss
  • Common shadowing tools assume a request can safely run twice and that the service is deterministic; neither held, so Anthropic ran the model once and replayed its output to the Rust version. Anthropic
  • Checkpointing compared both versions at every step, accept or reject, resolve settings, build the prompt, and the first step that differed showed roughly where the migration code diverged from production. Anthropic
  • A fingerprint, where a difference began in the prompt and the length gap, told one bug from another, because one bug leaves the same fingerprint on every request it touches; mismatches were grouped by fingerprint to triage. Anthropic

When it breaksThe shortcut that matched. The production API fetched the web search tool's description from an internal service, and the Rust version did not call it yet, so the description was missing from its prompts. An agent copied the text into files Rust could read; the prompts matched and the fix passed the local verifier. An engineer turned it down: Rust would need to call the service before launch, and the workaround would be thrown out. The agent saved a note to memory explaining the decision. Anthropic

Open questionCan a loop's own checks stand in for a person reading the code?

  • A person has to read what comes out: looping slop together does not stop slop, so someone must check the result is not slop. Dex Horthy
  • Stop reviewing pull requests one by one, which is the wrong level of abstraction: put human judgment into a review harness of context, rules and evals that the agents run against. Laurie Voss

Sources

11 in all

More in AI Coding & Software Factories

The Factory District: the whole area
  • Coding AgentsAgents that read, write, run and test code in a repo (Claude Code, Codex, Cursor agents).
  • Software FactoryRunning many coding agents as a production line: specs in, verified software out, humans as supervisors.
  • Vibe CodingBuilding software by prompting and accepting AI output without reading the code closely.
  • Spec-Driven DevelopmentWriting precise specs (and tests) first so agents can implement and verify against them.
  • AI Code ReviewModels reviewing pull requests and catching bugs before merge.
  • Parallel AgentsRunning many agent sessions at once (worktrees, cloud sandboxes) on separate tasks.
  • Ralph LoopRunning the same agent prompt in a loop until the spec is done.
  • AI SlopLow-quality AI output that looks plausible and costs others time to clean up.