DEV Community

The BookMaster
The BookMaster

Posted on

The Agent Verification Problem: How to Know Your AI Actually Did What You Asked

The Problem Nobody Talks About

You sent an agent to handle a task. You got back a result. But do you actually know what it did, how it decided, and whether the output is trustworthy?

For most AI agent deployments, the answer is: not really.

This is the agent verification problem — and it is structurally different from the alignment or safety problems that get most of the attention. Verification is not about whether the agent intends to do the right thing. It is about whether you, the operator, can confirm what it actually did.

The reason this matters right now: agents are moving into production. They are making decisions, triggering actions, writing code, sending messages, spending money. And most of them leave no traceable record of their reasoning.

What Verification Actually Requires

Three things must be true for an agent's output to be verifiable:

  1. Traceable decision path — You can reconstruct why the agent made the choices it did
  2. Falsifiable outputs — The agent's claims can be checked against ground truth
  3. Consistent identity — The agent behaves consistently enough across runs that comparisons are meaningful

Most agents fail at all three. They optimize for completing the task, not for leaving a verifiable record.

A Simple Accountability Pattern

Here is the basic structure of a verifiable agent loop:

interface AgentTask {
  id: string;
  prompt: string;
  constraints: string[];
  expected_outcome: string;
}

interface AgentReceipt {
  task_id: string;
  agent_id: string;
  decisions: Decision[];
  outputs: Output[];
  confidence_score: number;
  verification_hash: string; // hash of all decisions + outputs
}

async function run_verified_agent(task: AgentTask): Promise<AgentReceipt> {
  const decisions: Decision[] = [];
  const outputs: Output[] = [];

  // Step 1: Record the constraint set before execution
  decisions.push({
    type: 'constraint_snapshot',
    content: task.constraints,
    timestamp: Date.now()
  });

  // Step 2: Run agent with decision logging
  for (const step of await agent_execute(task)) {
    decisions.push({
      type: 'reasoning_step',
      content: step.reasoning,
      tool_calls: step.tools_used,
      timestamp: Date.now()
    });
    outputs.push(step.output);
  }

  // Step 3: Generate verification receipt
  const receipt: AgentReceipt = {
    task_id: task.id,
    agent_id: AGENT_ID,
    decisions,
    outputs,
    confidence_score: calculate_confidence(decisions, outputs),
    verification_hash: hash(JSON.stringify({ decisions, outputs }))
  };

  // Step 4: Store receipt immutably
  await store_receipt(receipt);

  return receipt;
}
Enter fullscreen mode Exit fullscreen mode

The key insight: the verification hash makes the receipt tamper-evident. Any post-hoc modification of decisions or outputs changes the hash, which you can detect by recomputing it.

Why This Is Harder Than It Looks

The above pattern works for single agents with short task horizons. The problems compound when:

  • Agents delegate to other agents: Now you need cross-agent receipts that chain together
  • Tasks span days or weeks: Long-horizon tasks accumulate drift that makes verification increasingly expensive
  • Agents learn or update mid-task: A model weight change mid-execution invalidates the assumption that the same "agent" produced all the decisions

These are not hypothetical — they are the actual failure modes operators are hitting right now.

What Most "Agent Frameworks" Get Wrong

Most frameworks treat observability as an afterthought — something you bolt on with logging. But logging is not verification. Logs are:- Easy to alter after the fact

  • Not structured for cross-reference
  • Not tied to outputs in a falsifiable way

Real verification requires the agent to be constructed around the receipt concept — where generating a verifiable record is part of completing the task, not a side effect of it.

The Practical Minimum

If you are running agents in production today and not generating receipts, here is the minimum viable verification setup:

  1. Assign each task a deterministic ID tied to the input hash
  2. Log each tool call with its input, output, and timestamp
  3. Store receipts in an append-only structure (a simple option: write them to a file that is only ever appended to)
  4. Verify by recomputing the hash from the stored log and comparing to the receipt

This does not solve the full verification problem. But it gives you something to work with when something goes wrong — and in production agent systems, something will go wrong.


The full catalog of my AI agent tools — including verification, drift detection, and accountability tooling — is at Bolt Marketplace.

If you are building with agents and hitting these problems, the tools there were built specifically for the gaps I described. Feedback and feature requests welcome.

Top comments (0)