Getting Your First Agent Live

Verify Before You Trust: Building Execution Validation Layers for Production Agents

Matt Doughty Matt Doughty CEO & Co-Founder, Prefactor
6 min read
Abstract illustration: Verify Before You Trust: Building Execution Validation Layers for Production Agents

What you will build and why it matters

This guide gives you an architecture for independently verifying that your agents’ actions actually executed, not just that the agent said they did. You will leave with patterns for three verification layers: pre-execution guardrails, real-time tool response validation, and post-execution outcome checks. Each layer targets a different failure class. Together they close the gap between an agent’s reported success and what actually happened in your systems.

The gap is real and measurable. Research published in 2025 found that 43 percent of identifier values are fabricated by models across 72 tool invocations with unconstrained parameters, and hallucinated query parameters silently return wrong data instead of triggering any error the agent would surface. Your tests probably passed. The agent probably reported success. The data was still wrong.

High test scores do not protect you here. Binary metrics miss between 65 and 93 percent of safety issues in production agents, because pass/fail evaluation checks whether output looks right, not whether the underlying action ran. This is the failure mode that sends engineering teams back to the drawing board after launch.

If you are still deciding whether agentic AI is the right model for your workflows, that comparison is worth reading first. This guide assumes you have committed to agents and need them to be reliable in production.


Why agents report success when nothing happened

An agent calling a tool receives a response. If the response looks syntactically correct, the agent’s default behaviour is to treat it as confirmation of success and continue. Nothing in the base model checks whether the CRM record was written, the payment was posted, or the database row exists. The agent infers completion from the shape of the response, not from the state of the downstream system.

This is not a model quality problem you can prompt-engineer away. It is a structural gap between the agent’s information and ground truth. Closing it requires an external process that checks ground truth directly.


The three-layer verification architecture

flowchart TD
    A[Agent plans tool call] --> B{Pre-execution guardrail}
    B -- Parameters valid --> C[Tool call executes]
    B -- Parameters invalid --> D[Block and re-plan]
    C --> E{Response validator}
    E -- Schema and status pass --> F[Agent continues workflow]
    E -- Validation fails --> G[Retry or escalate]
    F --> H{Outcome verifier}
    H -- State matches expected --> I[Step confirmed complete]
    H -- State mismatch --> J[Rollback or alert]

Layer 1: Pre-execution guardrails

Before a tool call fires, a guardrail checks that the parameters are well-formed, within permitted ranges, and targeted at a resource the agent is allowed to touch. This is not the same as the agent checking its own plan. The guardrail runs outside the agent loop, against a schema registry and an access control list.

What to validate at this layer: required field presence, data type conformance, identifier format (UUID structure, account number length, date ranges), and permission scope. If a customer ID field contains a free-text string that looks like a hallucinated value, the guardrail catches it before the API call leaves your system.

Step-level intervention with tool-call validation reduces harmful tool invocations by 65 percent on average while improving task completion under adversarial conditions. You get fewer bad actions and no meaningful drop in successful ones.

For teams using MCP to expose tools to agents, the guardrail belongs between the MCP client and the server, not inside either. This keeps it framework-agnostic and consistently enforced regardless of which agent calls the tool.

Layer 2: Real-time tool response validation

After the tool call returns, the response validator checks three things: HTTP or RPC status code, response schema conformance, and semantic plausibility of the returned values. A 200 status with an empty body is not success. A response containing a record ID that does not match the format your system issues is not success either.

flowchart TD
    A[Tool response received] --> B{Status code check}
    B -- 2xx --> C{Schema validation}
    B -- Error code --> D[Log failure, trigger retry policy]
    C -- Conforms --> E{Semantic plausibility check}
    C -- Mismatch --> F[Flag as hallucinated response]
    E -- Plausible --> G[Pass to agent]
    E -- Implausible --> H[Hold for human review]

Sendbird’s execution verification layer, built for production customer service agents, independently validates tool success and failure instead of relying on the agent’s self-report. It catches over 90 percent of execution hallucinations in milliseconds. The key design choice was that the validator queries the tool’s response envelope directly, never the agent’s interpretation of it.

Keep this layer synchronous. Adding single-digit milliseconds per call to catch a category of failure that would otherwise reach customers is the right trade.

Layer 3: Post-execution outcome verification

After a step or a sequence of steps completes, the outcome verifier queries the downstream system and confirms the expected state exists. The agent said the record was written: check the database. The agent said the email was sent: check the send log. The agent said the order was cancelled: query the order status endpoint.

This layer is where you catch the failures that layers one and two miss: race conditions, partial writes, third-party API inconsistencies, and cases where the tool returned success but the downstream system did not commit.

Eve Legal’s contract review agent validates each legal conclusion against source documents and internal policies before proposing a settlement. That is outcome verification applied to a reasoning step rather than a write operation, and the principle is the same: do not let the agent’s conclusion stand without checking it against the authoritative source.

For multi-agent systems, post-execution outcome checks become a coordination primitive. Agent A’s confirmed output is the verified input that Agent B receives, not Agent A’s claimed output. This prevents error propagation across agent boundaries, which is one of the harder failure modes to debug in production.


Connecting verification to governance

Verification layers produce structured logs: what was checked, what the system state was, whether it matched, and what action was taken. Those logs are the foundation of agent observability and the evidence your AI governance framework needs to demonstrate control.

JPMorgan Chase has deployed over 450 AI use cases in production with a human-AI collaboration framework governing autonomous decisions, reaching zero major regulatory incidents at that scale. Their planning for long-running agents targeting one-to-two hour task horizons in 2026 includes enhanced governance guardrails as a precondition, not an afterthought. The verification architecture described here is what those guardrails look like at the implementation level.

Tools like Prefactor sit in this category, providing pre-execution and post-execution validation as infrastructure rather than requiring each team to build it from scratch.

If you want to understand how verification fits into a broader agent evaluation programme, or how to frame it for a runtime governance versus pre-deployment review decision, those resources extend what this guide covers.


Where to start

Map one production agent workflow and identify every tool call it makes. For each call, note what a silent failure would look like and what downstream state you could query to detect it. That inventory is the input to your first verification layer design. Take the agent readiness assessment to benchmark where your current agent infrastructure stands against the patterns in this guide.

Matt Doughty Matt Doughty CEO & Co-Founder, Prefactor

Founder of Prefactor, writing on the operational reality of getting AI agents into production — identity, governance, evaluation, and the plumbing assistants never needed.

Frequently asked questions

What is an execution validation layer?

An execution validation layer is an independent system that confirms whether a tool call or action actually completed successfully, separate from the agent's own report. It queries the downstream system directly, checks return values against expected schemas, and flags discrepancies before the agent moves to the next step.

How is execution validation different from standard agent evaluation?

Standard evaluation typically checks whether an agent's output looks correct, using binary pass/fail metrics. Execution validation checks whether the underlying action actually happened. Research shows binary metrics miss between 65 and 93 percent of safety issues in production agents, because they cannot detect silent failures at the tool-call level.

At what point in a workflow should validation fire?

Validation should fire at three points: before a high-stakes tool call runs (pre-execution guardrails), immediately after a tool call returns (response validation), and after a multi-step sequence completes (outcome verification). Each layer catches a different failure class, and skipping any one of them leaves a gap the others cannot close.

Does adding verification layers slow agents down?

Lightweight schema and status-code checks add single-digit milliseconds per tool call. Post-execution outcome checks add more latency depending on what they query, but you can run them asynchronously for non-blocking workflows. The cost of a missed execution failure in production almost always exceeds the latency added by verification.

Stay ahead of the curve

No spam. Unsubscribe anytime. A resource by Prefactor.

Almost there — check your inbox to confirm your subscription.