Never Trust an Agent's 'Done': Why AI Agents Need a Verification Layer

One of the first lessons you learn building AI agents for production is that "done" doesn't mean done.

An agent will tell you the email is ready, the file is updated, the task is complete. It sounds confident. The output looks right. Then you check, and the link is broken, or the update went to the wrong place, or the agent misread what "done" actually required.

This isn't a problem you train away. It's structural. And it taught me that every production agent system needs a verification layer, a step between "the agent says it's done" and "the output reaches the real world."

Agents confuse intent with outcome

Here's what happens. An agent receives a task: update a document, send an email, mark a ticket resolved. It generates the right steps, executes them, and declares success. From the agent's perspective, it did what it intended to do.

But intent and outcome are different things.

The agent intended to update the file. Did the file actually change? The agent intended to send the email. Did it arrive? The agent marked the ticket closed. Is the ticket actually closed in the system, or did the API call fail silently?

Most agent frameworks are built to reason about what to do, not to verify that it happened. So they optimize for planning and execution, and treat verification as an afterthought. The agent outputs a confident "Done!" and moves on.

In a demo, that's fine. In production, it's a liability.

The structure of the problem

The deeper issue is that agents operate in two layers at once: the reasoning layer, where they plan and decide, and the execution layer, where actions touch the real world. The reasoning layer is where the agent's strength is. The execution layer is full of things that can go wrong in ways the reasoning layer doesn't see.

A file write can fail partway through. An API can return 200 but not actually commit the change. A network call can time out. A permission can be missing. The output can be syntactically correct but semantically wrong.

None of these are reasoning failures. They're execution realities. And because the agent's internal model of the world updates based on its intent, it often doesn't notice when execution and intent diverge. It believes the task succeeded because it planned for success.

This is worse in multi-agent systems, where one agent's declared success becomes another agent's assumption. Agent A says "file updated," Agent B reads that state and acts on it, and by the time a human sees the result, the incorrect assumption has propagated through three downstream decisions.

What verification actually means

Verification isn't asking the agent to double-check itself. It's an independent step that treats the agent's output as untrusted until proven otherwise.

Here's what that looks like in practice:

For data changes: read the data back and compare it to the requirement. If the agent was supposed to update a field to "active," query the field and confirm it says "active." If it doesn't match, the task isn't done.

For file operations: open the file, parse it, and verify the expected content is present and well formed. Check file size, timestamps, and permissions if those matter.

For API calls: don't trust the response code alone. Fetch the resource state afterward and confirm the change took effect. If the agent created a record, retrieve that record by ID and verify its fields.

For output quality: run format checks, schema validation, or a secondary model review. If the agent generated JSON, parse it. If it wrote text for a user, check that required elements are present and links resolve.

For external actions: if the agent sent an email, check the sent folder. If it posted something, load the page and verify it appears. If it modified a ticket, query the ticket system's API for current status.

The verification step should be done by something other than the agent that did the work. Ideally it's a separate process, or the same model with a different, skeptical instruction that treats the agent's claim as a hypothesis to test.

When verification catches what reasoning missed

I've seen verification catch:

  • An agent that "updated" a configuration file but wrote it to /tmp instead of the actual config path.
  • An agent that sent an email to the right address but with a malformed link that would have bounced users.
  • An agent that marked a database record as processed, but the transaction rolled back due to a constraint violation the agent never checked.
  • An agent that generated valid JSON with all required keys, but one value was subtly wrong in a way that would break downstream parsing.
  • An agent that closed a ticket in one system but didn't update the linked ticket in another, leaving state inconsistent.

None of these were hallucinations. The agent's reasoning was fine. The execution layer just didn't go the way the agent assumed it would.

Verification is cheaper than cleanup

The natural objection is that verification adds latency and cost. Every task now requires a second check. That's true. But compare the cost of verification to the cost of propagating bad output.

A wrong file that gets deployed breaks production. A malformed email that reaches a customer costs trust. An incomplete update that another agent treats as complete creates cascading errors that take hours to untangle. A bad decision made on stale data can't be undone cleanly.

Verification is expensive. Cleaning up after unverified output is more expensive, and it scales badly. One verification step prevents many downstream failures.

The other benefit is observability. When verification fails, you know exactly where and why. The task didn't complete, here's what was expected, here's what actually happened. That signal is invaluable for debugging and for improving the system. Without verification, you only find out something went wrong when a human notices, often much later.

Where verification belongs in the architecture

Verification should be a required gate between agent output and any action that affects the real world or another agent's input.

In practice, that means:

After execution, before commit. The agent does the work, verification checks it, and only if verification passes does the system mark the task complete and allow downstream agents or processes to proceed.

As part of handoffs. When one agent hands work to another, verification confirms what was actually accomplished, not just what the sending agent claimed.

Before user-facing output. Anything a user will see, anything that leaves the system, anything hard to undo: verification is mandatory.

In the feedback loop. When verification fails, the system should not silently retry. It should log the failure, provide the agent with the verification results, and either allow a retry with more information or escalate to a human.

Some systems implement this as a QA agent, a separate model whose only job is to verify. Others use rule-based checks, or a hybrid. The implementation matters less than the principle: the agent that did the work does not get to declare itself done.

What I'd build into an agent framework

If I were designing an agent framework for production work, verification would be a first-class concept, not an add-on.

Every task would have an associated verification function. The function receives the agent's output and the task requirements, checks the real-world state, and returns pass or fail with evidence.

The agent executes, then the framework automatically runs verification. If verification passes, the task is marked complete. If it fails, the framework decides whether to retry (with the failure details added to context), escalate to a human, or abort.

The framework would also track verification pass rates per agent and per task type, so you know where the reasoning-execution gap is widest.

This is extra work up front. But it's the difference between agents that feel impressive in a demo and agents you can trust in production.

The broader lesson

The need for verification in AI agents points to something more general. As AI systems move from generating text to taking actions, the gap between "the model said to do X" and "X actually happened" becomes the critical risk.

Verification is how you close that gap. It's how you make sure the reasoning layer and the execution layer stay synchronized. And it's how you prevent confident mistakes from becoming expensive failures.

In my own work, I came to think of verification as the layer that keeps the agent honest. The agent wants to believe its plan worked. Verification checks whether the world agrees.

More notes