Validation loop (agent backpressure)
Commands a coding agent runs after every change (tests, types, lint, build) and fixes against until they pass, so it checks itself before a person looks.
An agent without feedback writes plausible code; an agent with fast, precise feedback writes working code. The validation loop is that feedback: the agent edits, runs the checks, reads the errors and edits again. Practitioners call it backpressure, because failing checks push back on the agent the way a reviewer would. It is the last and most important section of a PRP, and hooks can run it automatically after each edit.
The quality of the loop sets the ceiling for the agent. Slow tests get skipped, vague errors get guessed at, and missing checks mean nobody notices the gap. An agent-ready codebase has one command that runs everything in seconds. Because the agent can also edit the tests, important checks should live where it cannot change them, see reward hacking and holdout scenarios.
Related terms
- PRP (Product Requirement Prompt): A PRD rewritten for a coding agent: the goal and why, plus the exact files, patterns to follow and commands that prove the work is done.
- Hooks: Scripts the harness runs automatically at fixed points, such as before a tool call or after an edit.
- Ralph loop (Ralph Wiggum technique): Running the same prompt against a coding agent again and again, each time with a fresh context, while progress lives in files and tests decide when it is done.
- Evaluator-optimizer (maker-checker): One model drafts, another checks the draft against stated criteria and returns feedback, in a loop until it passes or a round limit stops it.
- Agent-ready codebase: A repository a coding agent can work in reliably: one fast command to check everything, types, clear module borders, examples to copy and written rules.
- Reward hacking (coding agents): When an agent makes the check pass without solving the task: deleting or weakening tests, special-casing test inputs or faking results.
