Reflection / Self-Correction
Reflection (or self-correction) is when an agent evaluates its own output or action against the goal and revises it, instead of treating its first attempt as final.
A model's first attempt at something — a piece of code, a plan, a written answer — isn't always its best one. Reflection is the practice of having the agent (or a separate pass of the same agent) look back at what it just produced or did, judge whether it actually satisfies the goal or meets some quality bar, and revise it if not, before moving on or presenting the result.
This can be as simple as asking a model to critique its own draft against the original request, or as involved as running the actual output through a real check — like running a test suite against generated code — and feeding the failure back in as something to fix. The second kind, grounded in an actual signal like a test result or error message, tends to be more reliable than asking a model to judge its own work purely by re-reading it, since a model re-reading its own output can miss the same mistakes it made the first time.
Reflection adds cost — an extra evaluation pass, sometimes an extra full generation — so it's usually applied selectively: for outputs where getting it right matters more than getting it fast, or after a signal (like a failed test or an error message) makes it clear something needs fixing, rather than after every single action an agent takes.
How it works
The loop in the diagram — Act, Evaluate, Revise — repeats until the output passes evaluation or a retry limit is hit: the agent takes an action or produces an output, evaluates it against some criteria (which might be another model call, a test suite, or a validation rule), and if it falls short, revises and tries again. This is a specialized addition to the general agent-loop — it's essentially an extra check inserted between acting and moving on to the next step.
Example
A coding agent asked to implement a function might write an initial version, run the existing test suite against it (the evaluate step), see two tests fail, and revise the implementation to handle the cases those tests cover — repeating until the tests pass or it decides it needs to ask for help rather than keep guessing.
How it differs
Reflection is related to but distinct from human-in-the-loop: reflection is the agent evaluating and correcting its own work using some signal (a test, a model critique, an error message), while human-in-the-loop specifically involves a person doing the evaluating — an agent can use both, reflecting on its own work first and still checking in with a human before a high-stakes action.
Common misconceptions
FAQ
What does 'reflection' mean for an AI agent?
Is self-correction reliable, or does the agent just miss its own mistakes?
How is reflection different from human-in-the-loop?
Last checked: 2026-08-28