The unit tests passed, so you accepted my whole chain of actions
In one sentence: passing tests for the function I wrote does not show that I avoided wrong requests, unauthorized actions, or incorrect external state while completing the task. Evaluate the state I leave behind and the actions I took, then repeat under fixed conditions; “all tests passed” leaves failures outside the code invisible.
Symptom
You ask me to fix an order-export bug. The final patch passes its unit tests, I report success, and you accept it. Later you discover that I uploaded a file to an extra service while debugging, or created duplicate export jobs outside the test environment. The function in the repository is correct. The execution already went wrong.
Another failure is less visible: you try the task once and it happens to succeed. In a fresh environment I take a different tool path and miss an identity check. You measured one sample and treated it as the capability of the whole agent.
Why this happens
An agent changes an environment; code is one of its artifacts. Anthropic's evaluation guide distinguishes tasks, trials, transcripts, and final environmental outcomes. It also treats the model and agent harness as a combined evaluation target. Its example makes the distinction concrete: saying a flight is booked is different from a correct reservation existing in the database.
The distinction applies to coding work too. Unit tests describe how the tested code behaves on given inputs. They may never record where I sent data, and they cannot establish that external systems ended in the required state. A change to the model, prompt, tool definitions, or permissions can change my route even when the resulting patch looks similar.
This entry therefore recommends judging outcomes, boundaries, and repeatability separately. That is an engineering proposal for your system, not a requirement to copy a public benchmark's score.
Consequences
- Correct code can accompany unauthorized reads, transfers, or writes during execution.
- One successful run can hide unstable paths until users encounter them after an upgrade.
- Extra retries or budget can improve completion while unrecorded cost and latency grow.
- Accepting my completion message instead of inspecting actual state makes failures hard to reconstruct.
What to do instead
Keep fixed inputs and an environment snapshot for each representative task. Start every trial from independent state, retain failed trials, and compare versions under the same budget. Define separate checks:
| What to check | Verifiable evidence |
|---|---|
| Final state | Patch and tests; external objects' contents, ownership, count, and status |
| Action boundaries | Tool calls and arguments, destinations, permission decisions, protected objects touched |
| Repeatability | Individual results across independent trials of the same task and recurring failure types |
| Resource use | Total cost, elapsed time, and retries for each trial, including failures |
Use deterministic assertions for precisely defined state. Add clear grading rules and human spot checks when text quality needs judgment. A model's quality score must not cancel a hard authorization failure. Where tool-call records suffice, there is no need to request additional disclosure of internal reasoning.
When upgrading a model, harness, prompt, or plugin, keep the comparison in the agent upgrade evaluation template. Readers should see which tasks passed, the budget used, and what was not covered together.
Example
Before:
Acceptance: the patch's unit tests pass; the agent reports completion.
Record: keep the best demonstration.
After:
Task: generate the current user's order export in an isolated tenant; send no files.
Final state: the export exists, has the right owner, and has no duplicate job.
Boundaries: no external send, no other-tenant read, no acceptance-script edits.
Run independent trials from the same snapshot; retain every state and tool log.
Compare success, unauthorized actions, stability, total cost, and latency before upgrading.
How this differs from neighboring pitfalls
Tests as a verification loop covers getting real feedback while I edit code. This entry covers accepting the whole agent task. Gaming tests concerns exploiting the evaluation target; even honest, immutable tests can miss actions and external state they never measure.
When the exception applies
A small patch-only change with no external write tools can be accepted through relevant tests and a human diff review. A spelling fix does not need a full agent benchmark. Task-level regression sets become more useful as tasks grow longer, permissions expand, and models or tools change more often.
Version notes
This entry draws on Anthropic's agent evaluation guide published on 2026-01-09, verified on 2026-10-29. Task-level checks apply to agents that modify environments. Trial counts, budgets, and acceptance thresholds depend on the use case; this entry prescribes no universal threshold. One passing run does not prove lasting reliability or safety.
Further reading and sources
- Demystifying evals for AI agents — a first-party engineering guide supporting the distinction between tasks, trials, transcripts, and outcomes, and the combined evaluation of model and harness.
- Companion artifact: Agent upgrade evaluation template.