Skip to content

Verification

How to measure agent output quality, design evaluation suites, and use evals to drive development.

Measuring Quality

Behavioral Testing

Regression Testing

Eval-Driven Development

  • Eval-Driven Development: Write Evals Before Building Agent Features — Define correctness criteria before implementation so every agent change is validated against a stable, reusable test suite
  • Skill Evals — Treat each skill as an evaluable unit with a labeled dataset, paired with-skill vs baseline runs, and a benchmark that quantifies pass-rate, time, and token trade-offs
  • Emulated APIs for Agent Skill Evals — Run an API-calling skill's evals against a transparent emulator at the real URL so cost, live-data mutation, and shared-state non-determinism stay out of the score without rewriting the skill under test
  • Emulate Agent-Experience Changes Before Shipping — Stand up a proposed documentation, API, or MCP change in a local emulator and measure its effect on agent behavior against a baseline before shipping, because most AX changes fail
  • Agent-Driven Eval Flywheel: Prove a Fix Generalizes — Drive the eval-generation loop from your coding agent so each fix is graded against the whole accumulated case set, proving it generalizes instead of patching one case
  • Eval Difficulty as a Product Smell — Hard-to-write evals usually signal a product that was not designed for users to verify; redesign the artifact for checkability before scaling the scorer

Review Techniques

Rubric Design

Guardrails

  • Diff-Coverage Gating for Agent-Authored Pull Requests — Gate an agent's PR on the coverage of its changed lines, not the whole-repo percentage, because agents test under half of code-touching PRs and existing suites cover a minority of what they change
  • Deterministic Guardrails Around Probabilistic Agents — Wrap agent output in hard, deterministic checks — linting, schema validation, CI gates — that enforce correctness regardless of what the agent produces
  • Evidence-Gated Lifecycle Control for Coding Agents (Proof-or-Stop) — Advance an agent's lifecycle states (reviewed, tested, done, ready-to-merge) only when fresh, source-bound, mechanically verifiable evidence clears the gate — the agent's own assertion never advances the state
  • Non-Compensatory Readiness Gates Before Agent Release — Score release evidence on separate axes (evaluation, context, compliance, governance) and aggregate so a failure on one cannot be averaged away — the blocking rules do the work, not the composite score
  • Staged Evidence Gates for Agentic Program Repair — Order cheap evidence gates ahead of expensive ones in agentic repair loops — retrieval-grounded context, compile gate, target-test gate, then full regression — to filter invalid candidates before paying full-suite cost
  • Execution Budgeting in Agentic Program Repair — Cap test executions in generate-run-revise loops on frontier commercial agents; prohibiting execution drops resolve rate ~1.25 pp on SWE-bench Verified — applies only under specific preconditions on model strength, codebase familiarity, and execution cost
  • Bounded Repair-Loop Iterations — Cap generate-validate-repair loops near three to four rounds; most gains land early and later rounds mostly burn tokens — prefer stop-on-plateau, and watch strong-model late gains, thin-oracle overfitting, and self-critique loops
  • Profiler-Guided Optimization Loops for Coding Agents — Feed the agent a summarized profile and gate every iteration on a behavior-preserving test run; the profiler and the gate only pay off shipped together, and profiler evidence is itself fallible
  • Validity-Estimate Stopping for Noisy Verify-Repair Loops (VRR-Stop) — When the verifier is noisy, its acceptance rate rises while true validity falls as repair damages correct plans — estimate validity from repeated votes and stop on the sign of expected marginal gain, not on acceptance
  • Dual Executable Specifications for Long-Horizon Features — Compile a feature design into an architecture spec (do the required components exist and stay connected) and a behavior spec (does data flow through them correctly) that re-run after every edit — the gain appears only past roughly 3,000-word instructions or 200 agent turns
  • State-Bound Evidence and Typed Revision Contracts for Repair Loops — A repair loop can find a correct patch and then destroy it (0.847 ever-correct against 0.673 submitted); bind every test result to the code state that produced it, preserve the last verified candidate, and admit only typed revision actions
  • Dependency Gap Validation for AI-Generated Code — AI coding agents declare a fraction of the dependencies their code actually needs at runtime — validate in clean environments before trusting the manifest
  • Verify Observability in Agent-Generated Code — Agent-generated systems pass functional tests but expose fault signals for under 14% of failures despite having logging — verify runtime fault-signal coverage with fault injection, not the mere presence of logging
  • Phantom Symbol Detection for LLM API Migration — Verify symbols in LLM-generated migration code against a documentation-derived knowledge base — a deterministic check that catches fabricated imports, constructors, and methods that probabilistic judges miss
  • Generative Provenance Records for Tool-Using Agents — Emit a structured record (tool turn, evidence span, relation) alongside each output sentence so a mechanical verifier can check claim-level grounding before the answer leaves the loop
  • Per-Line Requirement Citations for Hallucination Detection — Cite a requirement ID on every generated line so a set-difference check flags any citation to a requirement absent from the spec as a hallucination — detection at a determinism cost
  • Typed Generation Contracts for Grounded Extraction — Split a wrong grounded answer by context sufficiency first, then make the extraction half checkable with typed fields, verbatim evidence spans, and a validator that runs
  • Defense-in-Depth Against Coding Agent Fabrication (Honesty Harness) — Four uncorrelated layers — instruction-level honesty rules, verify-before-write, real-time hooks that feed output back, and an external-tool fact-checker subagent — that reduce fabrication survival without claiming elimination
  • Layered Oracle Stack for Agent IaC Security Repair (TerraProbe) — Stack scanner-pass, full-scanner, validate, plan, and plan-diff oracles so LLM-generated infrastructure-as-code security fixes have to clear behavioral checks — first-pass agent repairs cleared the targeted Checkov finding 83.3 percent of the time but 71.4 percent of plan-compared repairs were deceptive fixes

Tooling