Plan-Execute-Verify
The agent produces an explicit plan, executes one step at a time, and verifies each step's output against stated criteria before proceeding. The loop refuses to terminate until final verification passes or budget is exhausted.
When to use
Any multi-step task where false success is expensive: bug fixes, migrations, deployments, document generation.
Steps
| Step | What happens | Verification |
|---|---|---|
| Plan | Decompose the goal into ordered steps, each with an observable success criterion written before execution. | Plan reviewed against the goal: does completing every step imply the goal is met? |
| Execute | Perform exactly one step using the tools it requires. | Step output captured (command output, diff, file state), not summarized from memory. |
| Verify | Check the captured output against the step's criterion. On failure, diagnose before retrying. | Criterion evaluated on evidence; a step never passes on the agent's assertion alone. |
| Repeat or finish | Advance to the next step, or run final whole-task verification when steps are exhausted. | Final check exercises the actual deliverable (tests run, app opened, file parsed). |
Specification
| Verification method | Per-step criteria defined at plan time, evaluated on captured tool output; final end-to-end check on the real deliverable. |
|---|---|
| Recovery behavior | retry-with-diagnosis |
| Observability | Plan, per-step evidence, and deviations logged; the transcript is the audit trail. |
| Inputs | Task goal, Success criteria, Tool access, Step budget |
| Outputs | Completed task, Verification evidence trail, Plan-vs-actual record |
| Risk level / maturity | low / established |
Failure modes
- Plan too coarse: steps unverifiable
- Verification theater: criteria written to pass
- Budget exhaustion without escalation path
Assessment
The reference loop. Scores highest on verification quality and boundedness; its cost is latency, which is why one-shot prompting persists despite worse completion rates.
Skills that implement this
A complete landing pipeline: detect and merge base branch, run tests, review the diff, bump version, update changelog, commit, push, and…
Requires a failing test before implementation code for any feature or bugfix. The loop is red, green, refactor, with the agent forbidden…
Benchmarks that test this
- One-shot prompting vs plan-execute-verify on bug-fix tasks (pre-registered)
- Pilot: one-shot vs plan-execute-verify on seeded-bug tasks (results published (pilot))