AI Agents

Verify the Output Before You Ship the Agent

Every agent I have shipped needed the same unglamorous layer: a checker that can say no.

2 min readPublished August 13, 2026
Share on X

Every agent I have shipped needed the same unglamorous layer: something that can say no. Not a test suite — a checker that runs after the agent says it is done, and has the authority to send it back.

This is not an optimisation. It is the difference between a demo and something you can point a colleague at.

An agent will confidently finish a broken task

The failure is rarely the code. It is the report. An agent that changed three files and could not apply the third will say the change is complete, because from its side the turn ended normally.

So the verifier's first job is not correctness. It is checking that the claimed outcome happened.

What to verify, in order of value

  • The build passes. Cheap, and it catches the majority of real failures.
  • The specific behaviour the task claimed changed, actually changed — assert on it.
  • Nothing outside the stated scope was touched. Agents widen silently.
  • Tests that existed before still pass. This is the one people skip and regret.

Scope drift deserves its own check

An agent asked to fix one thing will sometimes 'improve' something adjacent, and it will describe this as part of the fix. So compare the diff against the task, not just against the tests.

verify(task, diff):
  1. build passes?                  -> else retry
  2. task assertion holds?         -> else retry
  3. every changed file in scope?   -> else flag, do not retry blindly
  4. pre-existing tests pass?       -> else retry

Give it real authority

A verifier that cannot fail the run is a comment. The whole value is in the loop back: the checker rejects, the agent sees why, and it tries again with information. Remove the authority and you have written a very expensive log file.

  • AI
  • Testing
  • Reliability
KI

Kadirul IslamVerified author

Founder, A.K Solution

Follow on X

Founder of A.K Solution. Full-stack engineer building AI agent tools like KiCode, JSON form engines like ki-forms, and high-scale SEO systems. Obsessed with shipping fast, zero-bloat software that lasts.

More from Kadirul Islam

A Context Window Is Not Memory

Re-reading the same tokens on every turn is not the same as remembering them, and the difference is your bill.

2 min readAI

Your Agent Needs a Router, Not a Single Model

One model call per turn is simple until it is slow, rate-limited, or expensive. Routing is the fix and it is not hard.

2 min readAI