PTENES
Skip to content
MODULE 2.2

🔬 The verifier is the bottleneck

The loop pursues what the verifier approves — nothing more. Stop writing prompts, start writing verifiers: they set the quality ceiling for everything the loop produces, and this module shows you how to build a verifier that can handle the load.

6
Topics
40
Minutes
Intermediate
Level
Practical
Type
Progress in this module
0%0 of 6
1

🎯 Accept that the verifier is the limit

In topic 5 of the previous module, you saw the step verify of the loop: discover/plan/act/verify/stop. This entire module is about this single step, because it defines what the loop pursues. The loop doesn't stop when it reaches what you wanted—it stops when the verifier approves. If the verifier accepts anything, the loop delivers anything.

🆕 New here? Two words before you continue

  • Verifier: anything that checks whether a result is good — it could be code (a test), another AI model, or a person.
  • Quality cap: the best possible result that system can produce. No loop can exceed the criterion that approves it.
verifier approved the funnel only delivers what the bottleneck lets through

What to look at: six attempts on top, a narrow slice below. It doesn't matter how many times the act loop runs — what comes out is determined by the bottleneck's width, not by the number of attempts. A wide verifier (accepts almost anything) lets junk through; a verifier that's too narrow stalls the loop forever.

✓ A combination that works

  • ✓Average prompt + great verifier — the loop gropes its way forward, but the bottleneck blocks the bad output
  • ✓Criterion written before running the first iteration
  • ✓A verifier that knows how to say “no” often

✗ A combination that fails

  • ✗Great prompt + weak verifier — converges on something that only seems good
  • ✗Criterion of “make it good,” decided on the fly
  • ✗A verifier that approves almost everything that comes in

Key concepts

Bottleneck

Defines what comes out, not what goes in

Cap, not floor

Nothing beats the verifier

The discipline

Write verifiers, not prompts

False positive

Looks good ≠ is good

2

🪜 Stack the verifier ladder

There isn't just one verifier. There's a ladder: compile → lint → automated test → another model judging → human. Each step costs more and catches a different type of error— compiling catches syntax errors, tests catch logic errors, humans catch judgment errors no machine can see.

🆕 New here? Three words before you continue

  • Lint: a tool that checks style and common code errors without running the program — faster than a test.
  • Deterministic: same input, same output, always. An automated test is deterministic.
  • LLM-as-judge (model judging): use a second AI model to evaluate the first model’s result — probabilistic, and it can vary between runs.
compiles $ lint $ automated test $$ model judging $$$ human $$$$$ cost rises; each step catches a different error

What to look at: the climb from left to right. Compile and lint are nearly free and deterministic—run them on every loop iteration. Model judgments and human reviews are expensive and slower; reserve them for cases that have already passed the cheaper steps. Deterministic > probabilistic whenever there’s an option—only move up the ladder when the step below can’t detect the error you’re looking for.

📊 Where each step catches the error

  • Compile — broken syntax, missing imports
  • Lint — coding convention, unused variable, bug smell
  • Automated test — incorrect logic in a known case
  • Model judging — tone, consistency, adherence to a style
  • Human — business judgment, context none of the above has

Key concepts

Ladder

Not one checker, but several

Cheapest first

Run the cheap one every round

Expensive at the end

Only after the cheap option has failed

Prefer determinism

Test > model, when possible

3

🚫 Don’t let it rubber-stamp its own work

Same agent, same conversation, writes and then “reviews” its own work? It almost always approves it. It’s not laziness or malice—the entire reasoning that produced that result is still right there, in the same context window, nudging the judgment toward “this is good.” A real review requires clean context.

🆕 New here? One word before you continue

  • Clean context: the judge sees only the final result and the approval criteria — not the draft, not the reasoning, not the attempts that came before.
DIRTY CONTEXT draft + reasoning + result, all together "reviews" itself almost always approves CLEAN CONTEXT result + criterion reviewer separate reviewer, sees only this

What to look at: the dashed divider in the middle. On the left, everything lives in the same box and the arrow loops back to itself—there’s no real separation between who produced the result and who judges it. On the right, only the result and the criteria cross the boundary; the reviewer never sees the draft or the reasoning. That separation—clean context, separate reviewer—is exactly what a graph delivers for free (each node with its own context) is what a single loop has trouble doing on its own. Track 3 gives the full comparison; here we'll just cover the reason.

⚠️ Warning: “let me check my own work” doesn’t come for free

This applies to us too — you've probably reread something you wrote in the same sitting and missed an error that a colleague spotted in five seconds. The effect with an AI model is the same or worse: it has literal access to its own reasoning, so the “review” becomes just a second pass along the same line of thought.

Key concepts

Self-review

Approves almost always

Clean context

Only result + criteria

Separate reviewer

Doesn’t see the process

Bridge to the graph

Concrete reason to exist separately

4

📐 Choose the reference

Every verifier compares the result with something. That something is the reference: a passing test, a previously approved example, a written rule, a target number. Without a concrete reference, verification becomes opinion—and opinions change from one loop iteration to the next.

1

Concrete reference: a passing test

"This function should return 42 for this input." Yes or no, no in-between.

The loop knows exactly when to stop. There’s no ambiguity left for judgment.

2

Example reference: a previously approved case

"It should sound like this email the team already approved." Less rigid, still grounded in something real.

Works well when “correct” is more about style than an exact number.

3

Without a reference: “make it good”

No number, no example, no rule—just a feeling.

The verifier becomes a coin toss: it approves today what it would reject tomorrow. The loop converges on luck, not quality.

💡 Practical tip

Before writing the verifier, write a sentence in this format: “the result is correct if ___.” If you can’t complete the sentence with something you can check (a number, test, example, rule), you don’t have a verifier yet — you have a hope.

Key concepts

Reference

The “something” you're comparing against

Test

The strictest reference

Approved example

Style reference

Vague = luck

“Make it good” doesn’t verify anything

5

👁️ Watch the watcher

The verifier decays over time, even if no one touches it. Tests stop covering what has changed in the code. Example data gets stale. The definition of a metric changes under the hood in another system, and no one told the verifier. Verification slips from checking reality just to compare paper with paper — and the dashboard stays green the whole time.

🎯 The classic symptom

Green dashboard, bad real-world outcome.

If the checker slips from your attention after it’s written—it becomes “legacy code nobody touches”—it will keep approving by the old criteria while the world changes around it. It’s the same mechanism as topic 5 of the previous module: metrics become targets, and the target, without maintenance, stops representing what truly matters.

⚠️ Warning: an ownerless verifier doesn’t update itself

Someone needs to revisit the verifier when the process changes — a new business rule, a new data format, a new use case. Treat the verifier like production code: it has an owner, a changelog, and periodic reviews. A neglected verifier is worse than no verifier because it gives you false confidence.

✓ Live verifier

  • ✓Reviewed when the real process changes
  • ✓Fails from time to time (a sign that it's still active)
  • ✓Has a named owner

✗ A decayed verifier

  • ✗Written once, never reviewed
  • ✗Always green, never fails
  • ✗No one remembers why the rule exists

Key concepts

Decays

Ages even when idle

Role with role

Stops checking reality

Green dashboard

False visual confidence

Owner

Someone reviews it periodically

6

✍️ Write the verifier before the prompt

Same idea as writing the test before the code. Write the agent prompt verifier first, and test it against a bad result on purpose. A verifier that never rejects anything isn't verifying—it's just rubber-stamping. That verifier later becomes a at the of your graph—Trail 4 shows how.

✓ Right order

  • ✓1. Write the verifier
  • ✓2. Test against a known bad case — it must fail
  • ✓3. Only then write the agent prompt

✗ The wrong order

  • ✗Write the prompt first, see what comes out, check it “by eye”
  • ✗Write the verifier just to confirm what already came out well
  • ✗Never tests the verifier against a bad case

🧪 Practical example: prompt ready for Claude Code

Objective: ask Claude Code to write the verifier BEFORE writing the prompt for the agent it will verify — and require a bad test case too.

Antes de escrever qualquer prompt de agente, escreva o VERIFICADOR para a tarefa
<descreva a tarefa, ex: "resumir um artigo em ate 5 bullets">.

O verificador deve:
1. Ser um script/funcao deterministica sempre que possivel (nao outro modelo).
2. Definir a referencia por escrito: o que torna o resultado aprovado
   (ex: "tem no maximo 5 bullets", "cada bullet tem menos de 30 palavras",
   "nenhum bullet repete a frase de outro").
3. Retornar aprovado/reprovado + o motivo.

Depois, crie um CASO RUIM DE PROPOSITO: um resultado que claramente viola
a referencia (ex: 12 bullets, ou bullets repetidos). Rode o verificador
contra esse caso ruim.

So depois disso, escreva o prompt do agente que vai gerar o resultado de verdade.

How to verify: run the verifier against the deliberately bad case. If it approve in the bad case, the verifier is broken — go back and rewrite the reference before continuing. Only move on to the agent prompt after the verifier correctly rejects the bad case e approve a known-good case.

Now swap it for yours: replace <descreva a tarefa> based on your actual task and the list of criteria according to your acceptance criteria. Keep the bad case — it becomes a regression test for the checker forever.

Quick check (nothing is blocked): You deliberately tested your checker against a bad case, and it approved the bad case. What does that mean?

Key concepts

Verifier first

Before the agent prompt

Bad case

Needs to truly fail

Never rejects = broken

It's not checking

Turns into the graph node

Bridge to Track 4

📌 Module Summary

✓
The verifier is the ceiling — the loop pursues what it approves; it never goes beyond that criterion.
✓
Verifier ladder — compile, lint, test, model review, human review. Cheap every iteration, expensive only afterward.
✓
Never review yourself — a real review requires clean context and a separate reviewer.
✓
Concrete reference — a test, example, or written rule. “Make it good” doesn't verify anything.
✓
Watch the watcher — verifier rots on its own; it needs an owner and periodic review.
✓
Verifier before the prompt — test it against a deliberately bad case before trusting it.

Next Module:

2.3 — Where the loop breaks: structural failures that no good verifier can solve alone.