Skip to content

Verification, testing and evaluation: building trust at scale

Trust is built from evidence with independent origins, not from a convincing explanation.

⏱ 8 minChapter 7 / 18

7.1Two things to evaluate

The software — and the process that made it

One run can produce a correct change after many attempts and hours of supervision: the result is valid, the process has a problem. Another can be fast, elegant and wrong. Software tests and evaluations of the agent system complement each other. [F20]

01

The software produced

Meets the requirements and preserves important properties.

Evaluated with

Tests, contracts, measurements, observation in production.

02

The agent-based process

Solves tasks consistently, with acceptable cost and intervention.

Evaluated with

Evals: tasks, trials, trajectories and final states — over multiple runs.

7.2The correctness oracle

Where does your criterion of “correct” come from?

An oracle decides whether a result is correct: a rule, a contract, a data constraint, a reference behavior or structured human evaluation. If implementation and tests come from the same incomplete interpretation, both agree — and both fail the real requirement.

Situation

An export endpoint must only include data from the authenticated customer. The agent wrote the endpoint and asks which test to add.

Which test gives the strongest evidence?

← Try it

What relevant error would go unnoticed if this test were the only quality signal?

7.3Choosing the form of evidence

Match the evidence to the risk

Each kind of evidence catches some errors and is blind to others. The strengths below are this course’s applied synthesis of the report’s decision table — adapt them to your domain.

Pick a risk. The evidence that can actually catch it rises to the top.

Exercise the real database with barriers; mocks can’t show locking behavior. A deliberately racy version proves the test detects the defect.

Integration & contract tests

Strong signal

Depend on representative environments and versions.

End-to-end tests

Partial

Expensive to run and prone to flakiness.

Property-based tests

Partial

The chosen property must represent the correct rule.

Mutation testing

Partial

Cost and interpretation require careful selection.

Load measurement & profiling

Partial

The scenario must represent the relevant load.

Observation in gradual rollout

Partial

Detects after some exposure; requires containment.

Types & static analysis

Unlikely

Doesn’t show product intent or every runtime property.

Unit tests

Unlikely

Can miss relationships between components.

Differential tests

Unlikely

The reference may have bugs or different semantics.

7.4The economics of tests

Writing tests got cheap. Running and trusting them didn’t.

You still pay for execution, flaky failures and environments. Expand evidence where it reduces risk or human work — more contract tests, adversarial cases and critical journeys — while keeping feedback fast and interpretable.

7.5Human review changes its distribution

Automate — or keep human judgment?

To reduce manual review sustainably, know which defects your mechanisms catch, track what slips through and keep recovery capability. Sort these review activities.

Human review changes its distribution

1 / 6 · Score 0

Code style and formatting conventions.

7.6Evaluating your AI workflow

A small eval suite beats a big benchmark

Start with representative real tasks: a localized fix, a cross-module change, an investigation, an interface change, a migration and an ambiguous requirement.

Eval loop

Step 1 / 6

Select real tasks

Pick representative tasks, including ones that failed before. Hold some out so you don’t tune the process to them.

A single favorable demonstration is a starting point for investigation — not a conclusion.

Key takeaways

  1. 1

    Evaluate both the software and the agent process that produced it.

  2. 2

    Know where your oracle comes from; the strongest independence is evidence with different origins.

  3. 3

    Choose evidence by risk: integration with real databases for races, two-customer scenarios for authorization, load for latency.

  4. 4

    Move human review to requirements, trust boundaries and weak-evidence changes; automate the mechanical.

Check your understanding

Question 1 of 3

Implementation and tests were both generated from the same ambiguous ticket. What is the risk?

Read the full section of the original reportThe complete, unabridged text — with every source and nuance.

7.1. Two different things need to be evaluated

The software produced needs to meet requirements and preserve important properties. The agent-based process needs to solve tasks consistently, with acceptable cost and intervention.

One run might produce a correct change after many attempts and hours of supervision. That validates the result but leaves a problem in the process. Another run might be fast and elegant and produce a wrong change. That is why software tests and evaluations of the agent system complement each other.

Anthropic's guide to evals distinguishes task, trial, trajectory, and final state, and recommends evaluating the combination of model and harness. It also stresses the need for multiple runs and for calibrating model-based graders. F20

7.2. Defining the correctness oracle

An oracle is the criterion used to decide whether a result is correct. It can be a mathematical rule, a contract, a data constraint, a reference behavior, or a structured human evaluation.

The engineer should identify where that criterion comes from. If implementation and tests are derived from the same incomplete interpretation, both can agree and still fail the real requirement. Asking another agent for a second opinion helps with exploration, but the strongest independence comes from evidence with different origins.

Example: an export endpoint should only include data from the authenticated customer. A test that checks “returned a CSV” covers a very small property. A scenario with two customers, similar data, and attempts to cross identifiers tests the authorization boundary that really matters.

Operational question: what relevant error would go unnoticed if this test were the only quality signal?

7.3. Choosing the form of evidence

The table below is a decision proposal, to be adapted to the risk and the domain.

EvidenceEspecially useful forLimitation to acknowledge
Types and static analysisStructural contracts, invalid usage, and certain classes of errorThey do not demonstrate product intent or all runtime properties.
Unit testsLocal rules, calculations, and edge casesThey can miss relationships between components.
Integration and contract testsReal database, queues, APIs, and service boundariesThey depend on representative environments and versions.
End-to-end testsEssential journeys and observable behaviorThey can be expensive to run and prone to flakiness.
Property-based testsInvariants over many inputs and sequencesThe chosen property must represent the correct rule.
Differential testsComparison with a reference implementationThe reference may have bugs or different semantics.
Mutation testingChecking whether incorrect changes are detectedCost and interpretation require careful selection.
Load measurement and profilingLatency, memory, contention, and capacityThe scenario must represent the relevant load.
Observation during gradual rolloutEffect under real conditionsDetects problems after some exposure; requires containment.

Properties and metamorphic relations can be particularly useful. In a lossless transformation, transforming and then reversing should preserve the data. In a search, adding a conjunctive filter to the same set, before pagination, should not enlarge the result set. The value comes from the relation tested and its conditions of validity.

7.4. The economics of testing need to be reconsidered

The manifesto observes that the lower cost of writing and maintaining tests may change earlier decisions about coverage. The competent application is to reassess the total cost of each strategy.

If generating tests has become cheap, you still have to pay for running them, investigating flaky failures, and maintaining environments. The team should expand evidence where that reduces risk or human work, while preserving fast feedback. It may be worth producing many more contract tests, adversarial cases, and critical journeys, as long as the result remains interpretable.

In the compiler experiment with parallel agents, Nicholas Carlini reports that his work concentrated on the environment, the verifiers, and the feedback; external references helped isolate problems for independent execution. It is a capability experiment, with limitations acknowledged by the author, and it illustrates the value of good verification conditions. F22

7.5. Human review changes its distribution

There is room to automate style checks, repetitive policies, local consistency, and many routine reviews. Human investment should migrate toward requirements, trust boundaries, changes without good evidence, and decisions with greater consequences.

This makes it possible to set policies by class of change. Updating documentation or performing a mechanically verifiable refactoring may warrant a different flow than modifying authorization or deleting data. Approval should correspond to the risk and to the quality of the controls available.

To reduce manual review sustainably, the team needs to know which defects its mechanisms detect, track the failures that slip through, and have recovery capability. The practical goal is to eliminate the need for repetitive inspection in well-controlled classes and concentrate judgment on the exceptions.

7.6. Building a small evaluation suite for the AI workflow

An initial proposal is to select representative real tasks: a localized fix, a change that crosses modules, an investigation, an interface change, a migration, and a case with an ambiguous requirement. There is no need to start with a large benchmark.

For each task, record: initial state, expected result, evaluation criteria, code version, agent configuration, time, cost, and interventions. Each attempt should start from a known, restored state, to avoid contamination by data, caches, or effects of a previous run. Include tasks that failed previously. Hold out some cases to evaluate changes without tuning the process directly to them.

Compare configurations under sufficiently similar conditions and repeat runs when variability could change the decision. Measure correct outcomes, cost, human time, regressions, and out-of-scope actions. A single favorable demonstration is a starting point for investigation.

The success narrated by the agent should be confirmed in the relevant artifact or state: file, tests, database, application, or deployment. The final record needs to distinguish checks that were run, checks that were impossible, and hypotheses still open.