Skip to main content

Verification at Agent Speed: How We Check Code Nobody Reads

Coding agents wrote all 671 changes that reached our main branch in two weeks, far more diffs than a person can read. This is how agents check that work instead: checkers that are never the author, specs with acceptance cases, end-to-end tests the agent can't grade, and a loop that turns every escaped bug into a new check.

671 diffs are too many for one person to read. Left: a stack of 671 changes waiting on one human reader, falling behind. Right: four nested rings labelled push, review, main and weekly, the agent loops that checked them.
CatalEx Engineering · Published November 30, 2026 · 09:00 UTC

In the two weeks from November 16, 671 changes landed on the main branch of our relay codebase. Coding agents wrote all of them: the code, the tests and the documentation. No person wrote any of it.

That is far more than a person can review line by line. The people on the team spent their time on decisions instead: which specs to accept, which releases to ship, which questions the agents had raised.

The short version:

  • The agent that wrote a change never decides whether it passes.
  • Every requirement in a spec gets an acceptance case, and each case names the tests that cover it or says what is missing.
  • End to end, the agent drives the real chat client and code decides the verdict.
  • Our strongest tests sweep the whole system, using a list derived from the source code.
  • Every escaped bug has to say which change caused it and why we missed it, and the most common answers become proposals for new checks.
  • People decide intent and the risky calls. Nothing routine waits for them.

Agents checked every one of those changes too, in loops the author of a change can't argue with.

Addy Osmani put the shift well in his recent essay, Agentic Verification: writing code has stopped being the bottleneck, and knowing it is correct has become one. We started building for it when the repository began, two months ago. This post is what we built, what it catches, and where we would start if we were doing it again.

Why "let the agent run the tests" isn't enough​

The obvious version of agentic verification is to let the agent run the tests and keep going until they pass. You need that, and for one agent on one task it works fine. At hundreds of changes a week it stops being enough.

The first problem is a shared blind spot. When the same agent writes the feature and the test that defines done, both carry the same reading of the requirement. The test passes because it agrees with the code, and nobody checks whether either agrees with what the user wanted.

The second is that agents follow the incentives of the loop. If rewording a failing scenario makes it pass, an agent will reword it. If deleting a slow test makes the build green, it will consider that, without any malice, because it is the shortest path to green.

The third is that a model is a poor judge of its own screenshot. Ask it whether the page it just changed looks right and you get a confident, plausible yes.

The last one is slower. Lessons written as prose decay. "Always check the account on every route" sits in an instructions file and gets followed for a while, until the agent that adds the next route misses it.

Four loops, from minutes to a week​

No single check can be both fast and thorough, so we run loops nested inside each other. Our harness spec counts three, with review and main as one middle loop. We draw four here because those two catch different things. The picture at the top of this post shows them.

The innermost loop runs on every push and takes minutes. It runs the tests the change can reach, requires 95% coverage of the changed lines, and runs the linters and repository rules. A failure refuses the push, so the agent hears about it before anyone else sees the change.

The second loop runs on every change before it merges. Reviewer agents read the change against each of our written rules, and a merge gate decides whether it can land. More on both in a moment.

The third loop runs on main. The full suite runs there, and a failure opens an issue that a scheduled agent picks up every day. It names the change that broke the build and merges a fix or a revert within a working day.

The outermost loop runs weekly and works on the other three loops. It decides which checks to add and which spec cases still need tests.

Two rules hold the loops together. A requirement that no check measures is a gap, so we write it down as one instead of assuming it holds. And a check whose failure nobody acts on is noise, so every check has to feed a loop that does something when it fails.

The checker is never the author​

Left panel, self-review: an agent writes code, the same agent grades it and says it looks good, repeating the same blind spot twice. Right panel: the author's commit goes to read-only reviewers, a separate verifier sends confirmed findings back to the author, and a gate merges only the same commit that was reviewed.

The most important rule we have separates the agent that writes a change from the agents that judge it, and makes that separation mechanical.

Our reviewers are subagents with read-only tools, and each one checks the change against one of our rule files. They can read, search and list files. They can't edit anything, so they can't fix a problem on the side and hide it. An author may not alter a review result, and the merge gate refuses a change whose review doesn't match its exact commit.

The author also doesn't get to argue its case. It can't grade its own compliance or hand the reviewer a paragraph about why the code is fine. The reviewer judges the diff against the rule on its own reading.

Every finding then goes to a verifier, a separate agent that re-reads the code and answers confirmed, refuted with a reason, or undecided. Only a verifier can dismiss a finding. A finding nobody verified stays open, and a confirmed one blocks the merge whatever its severity, unless the owner records an exception.

Two smaller rules close the cheapest shortcuts. A later commit that only touches tests gets its own review, where a weakened assertion, a skipped test or a deleted test is a violation. And the merge gate checks the exact commit that merges. If the author pushes again after review and changes the code, the old review doesn't cover it.

The spec is the check before the check​

A person approves an intent such as "another account never sees my chats". The spec turns it into a numbered case. An acceptance file names the tests for each case and marks it covered, partial, uncovered or contradicted. Every Monday an agent re-checks the cases against the code. Totals: 2,089 cases, 1,491 covered by a named test, 56 places where the code contradicts the spec.

"Write the check before the code" is good advice, and for us the check comes from the spec.

Every product spec opens with an intent that the owner wrote or approved. Each requirement under it gets a numbered acceptance case. Next to each spec sits an acceptance file that lists every case, its status, and the tests that cover it. The status is one of covered, partial, uncovered or contradicted, and anything short of covered has to say what is missing.

Some of this is checked by code. A small tool refuses an acceptance file whose cases don't match its spec, a status without its gap, or a test name that no longer exists. The rest is checked by judgment: on every change, a reviewer asks whether the change makes a requirement false, and whether a new test checks the case's outcome or only borrows its name. Then every Monday a scheduled agent re-reads the oldest acceptance files against the code and merges the corrections.

Today our acceptance files cover 95 specs and 2,089 cases. 1,491 of them are covered by a named test, and 56 are marked contradicted, meaning the code and the spec disagree. Each of those 56 is written down as a gap, and the 113 uncovered cases are a known list of work rather than something nobody has counted.

A common objection to agentic verification is that an agent writing both the feature and its test will carry one misunderstanding into both. The risk is real, and three things limit it here. A person accepted the case before the agent started, the test has to check that case, and a different agent with nothing riding on the change decides whether it does.

End to end: the agent is the hands, the harness is the eyes​

Left panel: an agent looks at a screenshot of its own change and says "looks right to me", which is an opinion rather than a check. Right panel: the agent types and clicks in the real Slack or WhatsApp client, a harness reads the provider's recorded state, and the harness stamps the result PASS. The scenario is read-only.

Unit tests tell you the parts work. Someone using our product cares about the journey: they message an agent on Slack or WhatsApp, the answer arrives in the right thread, and an approval shows up where it should. So the last check on a messaging flow is an agent using the real provider client against a running system, the way a person would.

The design goal is easy to state. The agent does the clicking. It never decides whether the step passed.

Each scenario is written in plain Gherkin, in Markdown, with a stable ID and Given, When and Then steps. Under every step sits a small mockup of what the client should show, rendered to an image, so a scenario reads like an illustrated journey. The mockups help reviewers. They never affect a verdict.

The agent performs the Given and When steps in the real client: it types the message, opens the thread, presses the button. The harness takes a screenshot of every action. Each Then step is bound to a deterministic check that reads the provider's recorded state or the page, and polls until the condition holds or times out. There are no fixed sleeps, no model judgment, and no reads from the system under test, because that would let the product grade itself. Runs against a simulated agent and runs against a real Claude Code or Codex agent are reported separately, so simulated evidence is never passed off as live.

When scenarios fail, an agent runs a fix loop with rules designed to stop it cheating:

  1. It runs every scenario first, lists each gap with a one-line cause and a proposed fix, and asks for the whole list to be approved in one step. Whether that approver must be a person is still an open question in our spec.
  2. Scenarios, mockups and fixtures are read-only for the whole loop. If the agent decides a scenario is wrong, it stops and reports a scenario defect. It never edits the scenario to make it pass.
  3. A failure is fixed in the product. A step the harness can't check yet gets a new deterministic check, disclosed as a harness change. A blocker only a person can clear, such as an expired sign-in, stops the loop and says what the person needs to do.
  4. Readiness comes from one clean run on the final commit with freshly started processes, and the harness decides it, not the agent.

Beyond the messaging scenarios, a product verification catalog lists every user-facing flow of the app, and agents run it end to end against the development app or a published release, recording each verdict with screenshots and command output. That catalog is still kept up by hand rather than tracked mechanically, a gap our harness spec lists. Behaviour that no assertion can see, such as whether a reply sounds like a person wrote it, gets live evals with their own graders instead.

Sweep the whole system, not a sample​

Left panel: a hand-written list of routes to test, missing the newest route, complete the day it was written and wrong a week later. Right panel: routes derived from the source code fill a grid, a second account B calls every one, and a deliberately planted leaking route is caught.

Property-based testing states a rule once and throws many inputs at it. Our strongest tests do something similar at the level of the whole system. They take the list of things to check from the production source code, so a new route or table is covered the day it is added.

The clearest example is account isolation. Every route of our hosted service checks the caller's account on its own, and until recently nothing failed if a new route forgot. Now one test does this:

  1. Start the whole service and give account A an owner, a computer, an agent and a chat, each containing distinctive words.
  2. Build the route list by scanning the production source for every route pattern. The few routes built from parts can't be found that way, so they sit in a short hand-kept list, and the test fails when that list misses a route or names one that no longer exists.
  3. Call every route as account B, once with a client credential and once with a computer credential, using A's IDs in every path.
  4. Fail if any response contains one of A's words, then confirm A's data is still intact.

It runs in about ten seconds. To prove it worked, the agent that wrote it added a temporary route that listed every computer's name. The test failed on both credentials, and the agent removed the route.

The same idea now covers deleting data. A test lists every database table and requires each one to be classified: deleted with a chat, kept by design, not chat content, or a known gap that erasure doesn't reach yet and that has a debt entry. A new table without a classification fails the build, so whoever adds a table has to make that decision on the spot.

A check that has never failed hasn't been shown to work, which is why the agent planted that route before the sweep merged.

Every escaped bug names its cause​

A bug ships and someone finds it. The fix states which change introduced it and why it was missed, for example no_test. A weekly agent groups those answers into classes, and proposes a check for each of the two biggest classes, not a reminder, so the next bug of that kind would fail the build. Escapes found by a person were 45% in the first run and 33% in the second.

Bugs still get through, and each one is a chance to learn. Every fix pull request carries two required lines: Introduced by, naming the change that caused the bug, and Missed because, with one value from a short fixed list such as no_test, fake_diverged, e2e_only or nondeterministic. The merge gate refuses a fix without them.

Once a week an agent reads every fix, groups the answers into classes, and proposes one prevention for each of the two biggest. The prevention has to be a check. A line in a guide reminding agents to be careful doesn't count.

The second run covered November 16 to 22 and found 116 fixes among 357 merged pull requests. Of those fixes, 91% added or changed a test, and the median age of the change that caused each bug was five days. The share of escaped bugs found by a person, rather than by our own checks, was 33%, against 45% in the first run. The two aren't a clean comparison: the first run covered half a month, and it came before fixes had to carry the two lines, so an agent inferred why each bug was missed. Its two proposals, one for lifecycle bugs and one for tooling, are recorded as debt and haven't been built yet.

Every pass comes with evidence​

"Tests pass" in a pull request description is a claim. We ask for the things that would convince someone who doubts it.

A pull request lists the checks that actually ran, with their results and the coverage of the changed lines. Anything a person will see, whether an app screen, a message in Slack or WhatsApp, or a command's output, gets before and after screenshots taken with the same viewport, theme and data. The screenshots live on a separate branch that is never merged and are linked by commit, so nobody can swap them after review. Evidence from a simulated provider is labelled as simulated.

The test we apply is whether a reviewer could reject the change from the evidence alone, without running anything.

Lessons last when they become checks​

Writing lessons into instruction files helps for a while and then fades, so whenever code can decide a rule, code decides it. A rule that a pattern can detect moves out of the reviewer's prompt and into Semgrep, a linter or a test. Seven Semgrep rule files now enforce things that would otherwise be review comments, such as keeping messaging provider names out of Local Relay. The coverage gate is one too: changed lines must be at least 95% covered. What remains in prose for reviewers is the judgment that no pattern can make, such as whether a change makes a spec requirement false.

People own the intent and the risky calls​

People still decide the things that need judgment. They decide what to build, by writing and accepting specs. They accept any spec change that alters behaviour, security, data handling or spend. They take the high-stakes actions: production releases, infrastructure changes, destructive migrations, credentials, billing and messages to customers. Agents do everything else without waiting, including reviews, merges, reverts and new checks.

Two details make this work in practice. When an agent hits a question only a person can answer, it writes the question into the spec's open questions, builds what the spec does say, and moves on to other work. And the line can move: a high-stakes action passes to agents once its measured reliability meets a stated target.

Scheduled agents keep the loops running without anyone remembering to start them. One fixes broken builds on main daily, a weekly one classifies escaped bugs, and another re-checks spec coverage. Each ends in a pull request that goes through the same merge gate as any other change.

One change, start to finish​

Here is a single change followed through every loop. An agent is asked to add a route that returns the attachments of a saved chat message.

It starts in the spec. The new case goes into the spec and its acceptance file as uncovered, with a note on what is missing, and a person accepts it. The agent then writes the route and a test that checks the case's outcome.

When it pushes, the reachable tests, the coverage gate and the repository rules run, and the isolation sweep finds the new route in the source and calls it as account B. If the agent forgot the account check, this is where the change fails. On the pull request, reviewer agents read it against each rule and a verifier confirms what they find. A test that borrows the case's name without checking its outcome gets caught here.

An agent then fetches an attachment through the real chat client, and the harness checks that the file arrived. The gate merges the reviewed commit and nothing else, and the full suite on main catches any clash with other changes merged since the last full run. If a person still finds a bug later, the fix names this change and why it slipped through, and that answer feeds the weekly classification.

Nobody had to step in except to accept the case at the start and, later, to ship the release that contains it.

What it costs, and what it doesn't fix​

Running this isn't free. A reviewer per rule section plus a verifier per finding adds up to many agent calls per pull request. Strict gates sometimes refuse correct changes, and each refusal is real repair work.

Every check is code that someone maintains, and a check with false positives teaches agents to route around it, so those get fixed fast. The owner's attention doesn't disappear either. Accepting specs and their cases is careful work. It's just far less of it than reading 671 diffs.

It also has limits. A wrong spec gets verified perfectly, because every loop checks the code against the intent, and nothing checks the intent itself. People still find a third of our escaped bugs, which means our checks miss them. Simulated providers behave like their documentation rather than like the real service on a bad day, which is why live and simulated evidence stay apart. And some calls stay judgment calls, such as whether a test truly checks its case.

The numbers in this post come from our own repository, which is private. The change count is the first-parent commits on main from November 16 to 29. The spec figures are from the generated acceptance summary, and the bug figures are from the escapes notes of November 15 and 22.

Where to start​

If we were starting again, we would build it in this order:

  1. A fast, deterministic test run before every push, with a changed-line coverage gate that only moves up.
  2. Read-only reviewer agents, a separate verifier, and a merge gate that checks the exact commit.
  3. Two required lines on every fix: what introduced the bug, and why it was missed.
  4. One sweep, derived from your source code, for the invariant that would hurt your customers most.
  5. End-to-end scenarios the agent drives in the real client, with every verdict decided by code.
  6. Acceptance cases next to your specs, re-checked every week.
  7. A weekly pass that turns the two biggest classes of escaped bug into checks.

One thing to try this week: take your last ten bug fixes and write down, for each, the change that caused it and the check that should have caught it. The most common answer is the first check to build.

Agents write code faster than anyone can read it, so we let agents check it too, against intent a person wrote down.


Written by CatalEx Engineering. CatalEx is a communication gateway for AI agents: it puts the Claude Code or Codex agent you already have on WhatsApp, Slack and Google Chat. More at catalex.co.