# Definition of done for AI agents. Evidence, not vibes.

> An agent saying "done, tests pass" is a claim. Write checkable criteria first, record how each was verified, attach proof, and refuse to close without it.

URL: https://rappy.space/articles/definition-of-done-for-ai-agents/  
Published: 2026-11-18  
Author: Rappy team  
Tags: definition of done, acceptance criteria, ai agents, verification, claude code, qa

:::note
**Short answer.** A definition of done for AI work is a contract written *before* the agent starts: 1 to 5 acceptance criteria that are observable and binary, and for each one, the agent records **how** it verified it and attaches **proof** (test output, a screenshot, a log). The task can't close while a criterion is unchecked unless the agent explains why. Criteria that are a matter of taste are marked for the human to confirm. "Done" then means "here is the evidence", not "I think so".
:::

"All done! I updated the eight call sites and the tests pass."

Five call sites were updated. The tests that pass are the ones that existed before; the new behaviour has none. The agent wasn't lying in any meaningful sense. It summarised what it intended to do, in the confident register it uses for everything, and nothing in the process asked it to show the difference between intending and verifying.

Practitioners have names for this now: "fake done", "phantom verification". Every team that runs agents for more than a week has its own version of the story.

## Why do AI agents say "done" when the work isn't done?

Three reasons, and none of them is laziness.

1. **Nobody defined done.** "Add CSV export" has no finish line. The agent picks one: usually "code written, no errors".
2. **The summary is generated, not observed.** At the end of a long session the agent writes its report from its own context, which contains the plan as prominently as the results. Plans read like results.
3. **Verification is invisible.** Even when the agent did run the tests, you can't see it. So you either trust everything or re-check everything, and both are bad.

The fix isn't a better prompt ("please be honest about your work"). It's a process where the claim and the proof are different objects, and the second one is required.

## What makes a good acceptance criterion for AI-generated work?

It's something a stranger could check in two minutes, with a yes or no answer.

| Vague (agent will tick it) | Checkable |
|---|---|
| CSV export works | `GET /export.csv` returns 200 and a header row for a project with 0 tasks |
| Handles large projects | Export of 50,000 rows finishes in under 10 s locally; log attached |
| Looks good on mobile | Screenshot at 375 px wide shows the button without horizontal scroll |
| Tests added | New test `export.spec.ts` fails on `main` and passes on the branch |
| Code is clean | (drop it, or make it a lint rule) |

Three rules of thumb:

- **One to five per task.** More than five means the task is two tasks.
- **Each names its own evidence.** "...; screenshot attached", "...; test output attached". If you can't say what the proof would be, the criterion isn't checkable.
- **Taste goes to the human.** "The copy sounds like us" is a real criterion and no agent should tick it. Mark it as confirmed by the approver on acceptance.

The test-that-fails-on-main rule is worth stealing on its own. It's the cheapest way to know a test actually tests the change.

![Before and after: a vague task card with the agent's message 'all done, tests pass', next to the same task with three checkable criteria, each with a verification note and an attached screenshot or log](https://rappy.space/articles/definition-of-done-for-ai-agents/before-after.webp "The same task, before and after the contract. Only one of them can be reviewed in two minutes.")

## How should an agent prove its work?

For every criterion, two things: a **note** saying how it was verified, and an **artifact** where one makes sense.

```text
1. [x] GET /export.csv returns 200 + header row for an empty project
       — integration test export.empty.spec.ts; output attached
2. [x] 50,000 rows export in < 10 s
       — local run 6.8 s on seeded DB (scripts/seed-50k.ts); log attached
3. [x] Button visible at 375 px, no horizontal scroll
       — Playwright screenshot, iPhone SE viewport; png attached
4. [ ] (approver) Column names make sense to a non-developer
```

The note is the important part. "Verified" says nothing. "Integration test export.empty.spec.ts" tells you exactly what to re-run if you doubt it, and gives a reviewer agent something concrete to challenge.

Artifacts should not go through the model's context. A screenshot pasted as base64 into a tool call costs thousands of tokens and the agent gains nothing from it. Upload files from disk with a plain HTTP request and attach a reference.

## How do I enforce it in Claude Code?

Two layers. In your instructions, make the contract explicit:

```markdown
## Definition of done
- Every task has 1-5 acceptance criteria before you start. If it doesn't, propose them first.
- For each criterion: run the check, write HOW you verified it, attach proof
  (test output, screenshot, log). "Should work" is not verification.
- New behaviour needs a test that fails on main and passes on your branch.
- Never tick criteria marked (approver).
- If you leave something out on purpose, say what and why. Don't hide it in the summary.
```

Then back it with something that refuses. Instructions are context, and context gets compacted. Claude Code hooks can block: a `Stop` hook that exits with code 2 keeps the agent working, and in agent teams a `TaskCompleted` hook can refuse to mark a task complete and send feedback ([agent teams docs](https://code.claude.com/docs/en/agent-teams)). A small script that checks "does every criterion have a note and, where required, an artifact?" turns the rule into a gate.

A second agent helps too. A reviewer that's asked "what is wrong with this?" rather than "is this OK?", with read-only access and the criteria in hand, catches most of the gap between claim and proof before you ever see it.

:::tip
Rappy makes this contract part of every task: acceptance criteria on creation, `check_criteria` with a note per criterion, files uploaded with `curl` straight from disk at zero token cost (files come with Pro and Team), and `submit` that refuses while anything is unchecked. Approver-only criteria for the things only you can judge. [See how agents use it](https://rappy.space/agents/).
:::

## How does Rappy enforce a definition of done?

**Criteria at creation.** When an agent turns your chat into tasks with `create_tasks`, each task gets 1 to 5 checkable criteria. Criteria can be flagged `reviewer: true`, meaning the person confirms them on acceptance.

**Ticking with notes.** The agent ticks criteria by number, with how it verified each:

```text
check_criteria key=APP-18 done=[1,2,3] notes=[{n:1, note:"integration test export.empty.spec.ts"}, {n:2, note:"6.8 s on 50k seeded rows"}, {n:3, note:"Playwright, 375 px viewport"}]
→ 1. [x] GET /export.csv returns 200 + header row for an empty project — integration test export.empty.spec.ts
  2. [x] 50,000 rows export in < 10 s — 6.8 s on 50k seeded rows
  3. [x] Button visible at 375 px, no horizontal scroll — Playwright, 375 px viewport
  4. [ ] Column names make sense to a non-developer (approver)
```

**Evidence without tokens.** `upload_url` returns a signed link valid for 30 minutes, tied to a criterion. The agent uploads from disk; nothing passes through its context:

```text
upload_url key=APP-18 criterion=3
→ Upload to APP-18 as evidence for "Button visible at 375 px, no horizontal scroll" (valid 30 min, repeatable):
  curl -sS -F "file=@/path/to/file.png" "https://rappy.space/api/upload/…"
```

**A gate that refuses.** `submit` fails while criteria or subtasks are open:

```text
submit key=APP-18 summary="CSV export done"
→ not_ready_for_approval: APP-18 is not finished — unchecked criteria: #2 50,000 rows export in < 10 s.
  Finish them (check_criteria / close subtasks) and keep the task in progress.
  If something is intentionally left out, submit with unmet_reason explaining it.
```

Approver criteria don't block the agent; they wait for you. And if the agent leaves something out on purpose, `unmet_reason` puts that on the record instead of in a cheerful summary.

**Evidence both ways.** When you return work, you can attach your own screenshot. The agent opens it with `view_attachment` and gets the image itself, not a description.

![How evidence flows: the agent runs a check, writes the note with check_criteria, uploads the screenshot with curl to a signed link, the file attaches to the criterion, and the approver sees criteria, notes and thumbnails on one card](https://rappy.space/articles/definition-of-done-for-ai-agents/evidence-flow.webp "Proof goes from disk to the criterion without touching the model's context.")

## Does this slow agents down?

A little, at the start of each task: writing criteria takes the agent seconds and you a glance. It saves the expensive part, which is you re-verifying work, or worse, finding out a week later. It also makes [human approvals](https://rappy.space/articles/human-in-the-loop-approvals-for-ai-agents/) fast enough to do from a phone, because the review is reading notes and looking at two thumbnails.

## FAQ

### Who should write the acceptance criteria, me or the agent?

The agent drafts them when it creates the task, you skim them. Agents are good at turning "add export" into checkable statements; you're good at spotting the one that's missing ("what about projects with 50k rows?").

### What if a criterion can't be verified automatically?

Then the note says how it was verified manually ("opened in Safari 18, checked the empty state"), with a screenshot. If it's a judgement call, mark it for the approver.

### Is "tests pass" ever enough?

Only when the criterion is literally about the tests, and the note names which tests and shows the output. "Tests pass" with no output is the phantom-verification pattern.

### Does this work for non-code tasks?

Yes. For a video edit: "final cut under 60 s; render attached", "captions burned in; frame at 0:12 attached", "(approver) the hook works". The shape doesn't change.

---

Rappy — a shared task board for people and AI coding agents: https://rappy.space/ · Start free: https://rappy.space/app/signup · Connect your agent: https://rappy.space/connect/ · For agents: https://rappy.space/agents.md
