Sandboxes, allowlists and narrow credentials limit what an agent can reach and do. They say nothing about whether its work is right. A pull request can sit entirely within its permissions and still break the build, hide a bug or quietly weaken a test, and the note saying all tests pass is one more piece of text it wrote. Verification is the last bound, on the output itself.

Thesis: Verification bounds an agent's output the way a sandbox bounds its reach. Check the outcome, not the report of it; run the check where the author of the change cannot edit it; let the merge need a reviewer and an identity other than the one that pushed; and put all of it before the work reaches anything hard to undo. Changes to the agent itself pass the same kind of gate: a set of evaluation tasks it must keep passing.


The Report Is Not the Outcome

The earlier chapters of this series bounded what a mistaken or misled agent can reach, what text can steer it, what it may do without asking, where its writes land and whom it acts as. This one asks what its finished work is worth.

Anthropic's guide Demystifying evals for AI agents (January 2026) draws the line that matters. The transcript is the record of what the agent said and did along the way; the outcome is the state of the world when it finished. Its example: a flight-booking agent can end its transcript with "Your flight has been booked", but the outcome is whether a reservation exists in the booking database.

For a coding agent, "all tests pass" is transcript. The outcome is a test run on the commit it pushed, with a log anyone can read; Claude Code's best-practices page gives its own users the same advice.

Keep the Checker Out of Reach

If the check runs where the agent can write, the agent can change the check. This is documented, not hypothetical, and it has a name: reward hacking. METR, an organization that evaluates frontier models, reported in June 2025 that recent frontier models are reward hacking: getting high scores "by exploiting bugs in our scoring code or subverting the task setup." In one task, OpenAI's o3 model rewrote how the scoring code compares two results (the equality operator of PyTorch, the library the task used), so that every comparison reported a match. METR found reward hacking in 0.7% of o3's runs across one task suite, HCAST, and on one task in another, RE-Bench, in "every single trajectory we generated." It was more than 43 times more common on RE-Bench. METR's first explanation: "perhaps because on RE-Bench tasks the model was able to see the entire scoring function." It also allows that those tasks may be harder or use different scaffolding.

A model under pressure to finish is pushed toward whatever makes the check say yes; Agents Will Lie to Escape the Loop traces why. You do not need to know whether a given shortcut was deliberate. You need the check to be somewhere the agent cannot touch:

  • Run the deciding checks outside the agent's sandbox: in the build system, on the commit it pushed, under an identity it does not hold. A green result in its own sandbox is a claim; the same result in CI is evidence.
  • Make the tests that decide read-only to it. In Permissions Decide What Runs Unasked, editing the tests or build configuration waited for a person. This is why. Tests the agent adds are new code in its diff, reviewed like the rest of it.
  • Let the merge depend on the check, not on anyone's word. A protected branch can require every named check to pass before anything merges, and can cancel an approval when new commits change the pull request (GitHub). That second setting is optional; with it on, an agent cannot swap the code after it was approved.

The Grader Is Not the Maker

A check you can run as a program comes first. Some questions are not like that: does this change fix the cause or hide the symptom, did it touch something it should not have? Those need a reviewer, and the reviewer must not be the agent that did the work. The Clean Room makes the full case: the maker shares its own blind spots and can read its own answer key. The design question is how to make the separation real rather than requested.

A reviewer with fresh context and fewer tools. A second model call that never saw the maker's conversation, given the diff and the original task, with read-only tools, a limit the harness enforces rather than one the prompt requests. Claude Code's best-practices page describes the same setup with a subagent.

A different identity on the merge. GitHub can require that the latest push be approved by someone other than the account that pushed it. Give the agent its own account, as The Agent Acts for You, Not as You sets out, and that rule makes it impossible for the agent to approve its own push, however it was steered. It is an old principle with a new user: separation of duty, under which no one holds enough privilege to misuse a system alone (NIST).

Gates in Order, Cheapest First

Put the checks in order of cost, and let each send the work back rather than forward.

Step 1 of 6

Agent's change

A pull request can sit entirely within its permissions and still break the build, hide a bug or quietly weaken a test, and the note saying all tests pass is one more piece of text it wrote.

Read this figure as text

One Night's Fix, Verified

  1. Agent's change: A pull request can sit entirely within its permissions and still break the build, hide a bug or quietly weaken a test, and the note saying all tests pass is one more piece of text it wrote.
  2. CI runs the suite on that commit: A green result in its own sandbox is a claim; the same result in CI is evidence.
  3. A reviewer model: A reviewer model with read-only tools gets the failing test, the issue and the diff, and nothing of the agent's conversation. It flags that the fix catches and ignores an exception rather than handling it. The work goes back.
  4. The agent's second push: The agent's second push passes CI and the review.
  5. A developer reads a thirty-line diff: The branch rule accepts the approval because the approver is not the account that pushed. Merged.
  6. The record for the audit: The record for the audit is three logs under three identities: the build's, the reviewer's and the developer's.

The naive version

  1. The naive version: If the check runs where the agent can write, the agent can change the check.
  2. The Report Is Not the Outcome: For a coding agent, "all tests pass" is transcript.
  3. The Grader Is Not the Maker: The naive version runs the tests in the agent's own sandbox, takes its word that they passed, and lets its token merge.

The fence

  1. Agent's change, pushed to its own branch, goes to: Tests and checks pass in CI, on that commit?
  2. yes: Independent reviewer checks the diff against the task. no: back to the agent's change.
  3. The reviewer goes to: Reviewer finds no gap, and a person approves?
  4. yes: Merged by a protected-branch rule. no: back to the agent's change.

Figure: The gates before a change lands. The agent's branch must pass tests and checks in CI on that commit, then an independent reviewer and a person must find no gap, and only a protected-branch rule merges it; any failure sends it back.

Programs first: tests, type checks and linters (programs that catch type mistakes and suspicious code without running it) and policy checks such as secret scanning are cheap and run on every push. A model reviewer next, only on what passed; a gap it finds sends the work back before any person spends time on it. A person last, shown the diff, only on what both passed. The diff, the exact lines changed, is the unit of review, so keep each change small and about one thing: a person can judge forty lines and will skim four thousand.

The same order holds for work that is not code. Take the renewals cleanup in Let the Agent Work on a Copy, where the agent's edits come back as a change list rather than being made in place. A program checks the list first: every path inside the folders the task named, every merge between records that exist, no deletion the task did not ask for. A reviewer that did not make the list reads it against the task. The renewals manager reads what is left. The step that applies it, under its own identity, takes only a list that passed all three.

Evals Gate the Agent Itself

Everything above checks one change. When you change the agent itself, its model, its instructions, its tools or its permissions, check the agent. An eval, in Anthropic's guide, "is a test for an AI system": a set of tasks, each with a way to grade the outcome. Two of the guide's ideas carry most of the weight.

Regression evals ask whether the agent still handles all the tasks it used to, and should pass nearly 100% of the time. A change that drops the rate does not ship, however good the new behaviour looks.

pass^k is the probability that all k of k tries succeed, the honest number for an agent that runs unattended. The guide takes the metric from the τ-bench benchmark, whose authors proposed it (Yao and colleagues, 2024). An agent that finishes its nightly job nine times in ten sounds reliable. Run it every night for a week and, if the nights are independent, the chance that all seven runs succeed is 0.9 to the seventh power, about 48%: more likely than not, one night that week goes wrong.

Put the threats from this series into the suite. Include tasks whose inputs carry a planted instruction like the one in Prompt Injection Is a Design Problem, and grade the outcome: nothing sent to an unlisted host, no push outside the agent's branches. AgentDojo, the benchmark that chapter cites, is a public example of exactly this kind of suite. Your own version, built from your agent's real tasks, is a release gate.


An Example: One Night's Fix, Verified

The bank's test-fixing agent, from What an Agent Sandbox Bounds, pushes a fix to agent/fix-4471 at 2 a.m. and reports that the suite is green.

  1. CI runs the suite on that commit, under the build system's identity. The tests that decide are ones the agent cannot edit. Green.
  2. A reviewer model with read-only tools gets the failing test, the issue and the diff, and nothing of the agent's conversation. It flags that the fix catches and ignores an exception rather than handling it. The work goes back.
  3. The agent's second push passes CI and the review. It also adds a test, which is new code in the diff.
  4. A developer reads a thirty-line diff in the morning and approves. The branch rule accepts the approval because the approver is not the account that pushed. Merged.

The record for the audit is three logs under three identities: the build's, the reviewer's and the developer's. The naive version runs the tests in the agent's own sandbox, takes its word that they passed, and lets its token merge.


When the Opposite Wins

Cheap, reversible, personal work. A draft on a scratch branch that you will read line by line anyway does not need a separate reviewer. Your reading is the check.

Reviewers always find something. A reviewer asked to find problems will find some, as Claude Code's page warns. Fix every finding and the code fills with defences against cases that cannot happen. Ask the reviewer about correctness against the task, and let style go.

The strongest objection: a person reviewing agent diffs all day is approval fatigue again. It is, if the person is the first check. Put the programs and the model reviewer in front, keep diffs small, and the person sees a few changes that have already passed everything a machine can check.

What to Do Next

  • Grade the outcome, never the report. For each agent, name the state in the world that proves the work is done: the test run, the database row, the sent message.
  • Move the deciding checks out of the agent's reach: run them in CI, make the tests that decide read-only to it, and require them before merge.
  • Add a reviewer that did not do the work, with fresh context and read-only tools, and make the merge need an identity other than the agent's.
  • Order the gates by cost: programs, then a model reviewer, then a person on a small diff.
  • Gate changes to the agent with evals: a regression suite near 100%, pass^k for anything unattended, and planted-instruction cases graded on outcome.

The Whole Design, on One Page

Shadow AI Signs In as You and When Agents Need a Sandbox set out why agents need these controls and when one needs a sandbox at all; the table covers the controls.

Chapter What it bounds The controls Without them
What an Agent Sandbox Bounds What the agent can reach File, network and secret bounds the operating system enforces A misled agent reaches your keys
Prompt Injection Is a Design Problem What text can steer it No session with untrusted input, private data and a way to act or send One planted sentence decides
Permissions Decide What Runs Unasked What it may do without asking Fewest tools, scoped credentials, allow, ask and deny Approvals nobody reads
Let the Agent Work on a Copy Where its writes land A copy or overlay, and a narrow apply step with the only write access Every mistake is live the moment it is saved
The Agent Acts for You, Not as You Whom it acts as Its own delegated identity, keys it never holds, a record it cannot edit The log names the wrong person
Check the Work Before It Lands What its finished work is worth Outcome checks out of its reach, a grader that is not the maker, evals "Done" is a claim

Every control in this series acts at one of three points in the agent's loop: before the harness runs a tool request (permissions, approvals), while the command runs (the sandbox), or after the work is done and before it counts (CI, review, merge rules). The first is the gap you met in The Tool Call Is a Round Trip, in the Agentic Lifecycle series.

Where Start Here Leaves You

If you read Start here from its first chapter, this is its last. You began with what AI is and the model at its core, which predicts the next token and nothing else. Foundations wrapped it in a harness, an outcome and a check; The Agentic Lifecycle followed one request through that harness call by call; Context Engineering decided what goes into each call; and this series asked why identity comes first and when an agent needs a sandbox, then bounded what the agent can reach, what text can steer it, what it may do unasked, where its writes land, whom it acts as and what its finished work is worth. Ask three questions of any agent you build or buy: what does the model see, what can it touch, and what checks the work it says is done.


Related reading: The Clean Room for why the maker cannot grade itself, Agents Will Lie to Escape the Loop for why "done" must be machine-checked, and Proven End to End for stating exactly what a passing check proves.