Definition

Agent reflection is a pattern in which a model explicitly evaluates an agent’s earlier output, actions, or approach before the agent continues. It may use a draft, tool result, error, test failure, or record of attempted actions as evidence. The model is asked to identify problems and may propose a revised plan or next step. Simply reading a tool result and choosing the next action is not reflection.

Reflection usually adds a model evaluation step to the agent loop. It does not give the model a separate source of truth.

Simple example

A coding agent changes a parser and runs the relevant tests. Two tests fail. Before editing again, the application sends the patch, failure messages, and original requirement to a reflection step. The model notices that the patch handles missing values but not whitespace-only input, then proposes a narrower correction.

The application still validates the new edit and reruns the tests rather than accepting the reflection as proof.

Why it matters

Reflection can help an agent use feedback instead of repeating its first approach. At that checkpoint, the system can compare the result with the goal, revisit assumptions, and decide whether more work is useful.

It is most useful when the loop has meaningful evidence to inspect, such as deterministic test output or a reviewed rubric. Another self-review pass can improve a result without new evidence, but the benefit is less reliable while latency and cost rise.

One important nuance

Reflection does not guarantee self-correction. The same model can preserve an incorrect assumption, invent a diagnosis, or make a good result worse. Ground the reflection in observable outcomes, limit the number of cycles, and define independent stop conditions. For consequential work, external validation or human review remains stronger evidence than the model agreeing with its own revision.