Agent Failure Modes and Evaluation
Reflection is what gives an agent a real chance of succeeding; running steps alone does not guarantee that the task is done correctly.
A Trip That Booked Without Crashing
Imagine an agent that has been asked to book a multi-leg trip. It builds a plan, carries out each step, and reports success at the end. Nothing crashed, so from the outside the run looks healthy. Yet the agent may have booked a connection that arrives after the hotel check-in window closes, because nothing in its process ever asked whether the plan made sense.
This is the gap that reflection is meant to close. An agent can keep operating without examining its own work, but it is far less likely to actually accomplish what it was asked to do. The rest of this article explains what reflection is, where it fits in a task, how the parts of a reflective system cooperate to find and fix errors, and what it costs to build in.
Running Steps Versus Reflecting on Them
Running steps and succeeding at a task are not the same thing. An agent that only executes steps moves forward no matter what each result looks like. If a step produces a wrong result, the next step simply builds on it, and the run ends with a report of completion. Reflection adds a pause after the result arrives, asking whether the outcome is actually right before the agent commits to its next direction.
Four Points to Pause and Evaluate
Reflection is not a single event that happens at the end of a run. It can be placed at several points along the way, and each placement answers a different question about the work so far. There are four such points in a task: after the request arrives, after the initial plan is made, after each execution step, and after the whole plan has run. The question changes as the agent moves further into the task.
Read left to right, the diagram shows the agent's path through a task. The first checkpoint sits right after the request arrives, before any work begins. The second follows the initial plan, asking whether that plan makes sense before it is carried out. The third follows each execution step, so a bad result can be caught while it is still one step old rather than after the whole run. The fourth comes after the whole plan has run, judging whether the task as a whole was accomplished. The trip agent in the opening example would have been caught by the second checkpoint, because a connection arriving after check-in closes is a plan that does not make sense.
- Checkpoint 1: after the request arrives, before planning
- Checkpoint 2: after the initial plan is made, before execution
- Checkpoint 3: after each execution step, or after a set number of steps
- Checkpoint 4: after the whole plan has run, judging the final outcome
Who Does the Judging
Reflection needs a judge, and the judge can be arranged in more than one way. The simplest arrangement uses the same agent. It is prompted with self-critique questions that ask it to look back over its own output. A second arrangement hands the judging to a separate component, such as a specialized scorer, which is a model that assigns a concrete score to each outcome.
Separating the judge from the actor is useful because the agent that produced an answer is often poorly placed to notice that answer's flaws. The same separation can be extended across multiple agents. One agent plans and acts, while another agent evaluates the result after each step or after a set number of steps.
How an Evaluator and Self-Reflection Find an Error
Reflexion, proposed by Shinn and colleagues in 2023, makes the path from a finished step to a corrected direction explicit by splitting reflection into two modules. The first is an evaluator that judges the outcome. The second is a self-reflection module that analyzes what went wrong. After both have run, the agent proposes a new trajectory, which is the authors' term for a plan. Each step therefore passes through evaluation and self-reflection before the agent commits to its next direction.
In the diagram, the evaluator comes first. It receives the outcome of the executed step and judges it. If the judgment is that the task has not been accomplished, that failure is passed to self-reflection, which looks for why the attempt went wrong. The evaluator tells the system that something is wrong; self-reflection tells it where the problem started. Only after both have run does the agent propose a new trajectory, and only then does it move on to the next step.
Tracing a Flawed Plan Into a Revised One
When the evaluator judges that the task has not been accomplished, the actor is prompted to think about why the attempt failed and how the approach could be improved. That improvement becomes the basis for a new plan. The diagram below follows one flawed plan through that process, from its original form to its replacement. Each arrow is labeled with the event that triggers the move to the next state.
Revising the Trip Plan After an Error Is Found
An agent builds a plan to book a flight that lands after the hotel check-in window closes. It carries out the booking, and the evaluator judges that the task has not been accomplished. Trace how the plan is revised.
- 1Start with the flawed plan
The plan booked a connection that arrives too late. The plan itself was never checked against the hotel's check-in window.
- 2Execute the step
The booking is made. The step ran without error, so nothing crashed, but the outcome is wrong.
- 3Evaluator judges the outcome
The evaluator judges that the task, arriving at the hotel in time, has not been accomplished. This judgment flags that something is wrong.
- 4Self-reflection locates the cause
Self-reflection looks back at why the attempt failed and finds the timing conflict: the connection and the check-in window were never compared.
- 5Propose the revised plan
The improvement becomes the basis for a new plan. The new plan checks each connection's arrival time against the check-in window before any booking is made.
The flawed plan has been replaced by a revised plan. The agent commits to the new plan as its next direction, and the failure became the input for the improvement rather than a silent error carried to the end of the run.
Mistakes Developers Make With Reflection
Common mistake Treating a run with no crash as a successful run
What it looks likeThe trip agent reports success because every step completed without an exception.
Why it failsNothing in a plain run asks whether the plan made sense, so a clean run can still fail to accomplish the task.
Do this insteadAdd a checkpoint that judges the outcome, not just whether execution finished.
Common mistake Adding reflection but no correction step
What it looks likeThe self-reflection module notes that a connection is too late, but the agent continues on the original plan.
Why it failsReflection produces the insight; error correction is the step that acts on it. Reflection by itself changes nothing.
Do this insteadRoute the diagnosis into proposing a new trajectory, and only then continue to the next step.
Common mistake Assuming the agent that wrote an answer will spot its own flaws
What it looks likeA single agent is asked only to review its own output and approves a plan it just wrote.
Why it failsThe agent that produced an answer is often poorly placed to notice that answer's flaws.
Do this insteadConsider a separate judge, such as a specialized scorer or a second evaluating agent.
Common mistake Placing every checkpoint at the end of the run, which catches a bad step only after all later steps have already built on it
Paying for Reflection
Reflection is relatively easy to add to an agent compared with improving how it generates plans in the first place, and it can produce a surprisingly large gain in performance. The price is paid in latency and cost. Thoughts, observations, and sometimes actions all consume tokens, and that consumption grows with the number of intermediate steps. Users feel the extra delay, and the bill rises accordingly. Reflection also adds context pressure, because the extra thoughts and observations take up room in what the agent is working with.
| Checkpoint | Question it answers | Extra work it adds to the run |
|---|---|---|
| After the request arrives | Is the request understood before planning begins? | One evaluation before any work starts |
| After the initial plan | Does the plan make sense before it is carried out? | One evaluation of the whole plan before execution |
| After each execution step | Did this step produce a right result before the next builds on it? | One evaluation per step, which grows with the number of steps |
| After the whole plan has run | Was the task accomplished? | One final evaluation of the complete outcome |
Each checkpoint answers a different question and adds its own share of cost. Placement is a design decision.
Placing Checkpoints on a Task
An agent is asked to read a long report, write a one-page summary, and email it to a colleague. Its initial plan leaves out the email step entirely. At which of the four pause points would the agent most directly catch this flaw, and why?
Hints
- Think about which checkpoint comes right after the plan is made but before any step is carried out.
- The question at that checkpoint is whether the plan makes sense, which is different from whether a single step succeeded.
Key Takeaways
- Reflection is what gives an agent a real chance of succeeding; running steps alone does not guarantee that the task is done correctly.
- Reflection can be placed at four points: after the request arrives, after the initial plan, after each execution step, and after the whole plan has run.
- An evaluator judges the outcome, self-reflection finds the cause, and an error correction step proposes a revised plan. Reflection alone changes nothing.
- Reflection improves outcomes but adds latency, token cost, and context pressure, so checkpoint placement is a design decision.