Closing the loop for agent improvement
Customer-support agents can create value across retail, airline, telecom, and other domains by answering policy questions, retrieving account context, updating records, routing requests, and executing customer-facing workflows. But reliability is still the deployment bottleneck: failures can update the wrong record, skip a required confirmation, violate policy, or promise an action that never executes.
Agent builders can edit prompts, add guardrails, collect data, or fine-tune the model. Those interventions can help, but they are often ad hoc when they start only from the fact that an agent failed, not from a diagnosis of why it failed or which part of the system should change.
Closing the loop makes improvement systematic. We run the agent on realistic tasks, identify failures, improve the agent based on those failures, and re-run the same eval to check whether the failure moved.

Two things make the loop hard. First, most graders return only pass or fail, but not a repair signal. Second, even with a diagnosis, it is not obvious which system change should follow. Our previous blog post used failure analysis to generate targeted data and train a better model; here, we focus on a more cost-effective way of improving agent performance by improving the harness around a fixed model.
We address both challenges with an evaluator that identifies the first unrecovered mistake, failure type, trajectory evidence, and expected behavior, then use those diagnoses to update prompt memory and reviewer checks.

The evaluator: where, why, proof
The evaluator takes a failed trajectory and returns a structured diagnosis. It answers three questions a customer or agent builder actually needs:
- Where did the agent first fail?
- Why did that failure happen?
- What proof in the trajectory supports the diagnosis?
That moves evaluation from reporting to repair. The evaluator output becomes an engineering artifact that can drive the next harness change.

The evaluator uses 51 grounded checks, split into two types. Deterministic checks handle what a program can verify: final state, required actions, tool arguments, legal transitions, and spending limits. LLM-judge checks are reserved for semantic questions, such as whether the customer clearly confirmed an action or whether the agent's explanation matched the tool output.
The LLM diagnosis then maps the failure into a maintained taxonomy, separating agent failures such as comprehension, planning, and tool execution from task or system gaps. This lets us aggregate failures across runs instead of treating every failed trajectory as a one-off example.
The final output records the following components:
- Expected behavior: describes what the agent should have done in that specific situation.
- Actual behavior: summarizes what the agent actually did, which led to the failure.
- Supporting evidence: provides specific details or excerpts from the trajectory that substantiate the diagnosis.
- Confidence: indicates the level of certainty the evaluator has in its diagnosis.
This is the repair signal that tells us what kind of fix the system should consider.
A concrete failure example: misreading tool output
Here is one failure in the shortest useful form. The customer asked the agent to count the available T-shirt options before changing two pending T-shirt orders. The agent had the product data, but counted the available variants incorrectly.

Evaluator benchmark result
We benchmarked the evaluator on the 29 public AgentRx tau-bench failed trajectories. Our evaluator is competitive on failure type and stronger on critical-step localization.

From diagnosis to reflection
The evaluator gives us the raw repair signal. To make that signal reusable, we convert evaluator analyses into reflections: short lessons that describe the failure pattern, the trigger, and the expected handling. A reflection is not just "the agent failed." It is a compact instruction such as: when counting product variants, filter by the availability field before answering.
We use those reflections in two harness methods. The first method checks risky writes at runtime. The second method puts lessons into the agent prompt before the task starts.

Method 1: Pre-Write Reviewer

The reviewer is a runtime guard for state-changing actions. A basic reviewer checks the proposed write with the task context and a generic review prompt. A reflection-guided reviewer also injects lessons from prior evaluator analyses into the reviewer prompt, so it can catch recurring failure patterns before the tool executes.
On GPT-5.4 mini, the basic reviewer improves airline pass3 from 11.3% to 30.0%. The reflection-guided reviewer improves all three domains: retail from 26.9% to 29.4%, airline from 11.3% to 23.7%, and telecom from 5.0% to 14.4%.

Method 2: Prompt Memory
Prompt Memory uses the same reflection source, but applies it before the task starts. Instead of checking one write call at a time, we distill evaluator analyses into lessons and place those lessons in the agent's system prompt. This is useful when the failure is a recurring behavior, such as misreading a tool field, skipping a confirmation, or applying the wrong policy branch.
On Qwen3.5-9B retail, Prompt Memory was the stronger harness fix. Reviewer-style gating did not transfer as well, but carrying lessons in the agent prompt lifted pass3 from 65.0% to 69.2%.

The evaluator also tells us what changed underneath the score. In the Qwen3.5-9B retail comparison, comprehension failures dropped sharply after Prompt Memory, while the remaining failures concentrated more in planning. That is still useful: the next loop now has a clearer target.

The same task after harness improvement
The same T-shirt task now succeeds after Prompt Memory adds the reflection to the agent prompt. The reflection tells the agent to filter the raw tool output by the requested field before counting; based on that lesson, the agent reports the exact count, asks for confirmation, and completes both pending order updates.

What this means for customers
The business value is not just a higher benchmark number. It is a faster path from a production failure to a targeted fix.
- Support teams get root cause instead of a mystery score. They can see the exact turn, evidence, and expected behavior.
- Engineering teams can improve without immediate retraining. Prompt Memory and Pre-Write Reviewer are harness changes that can be deployed around a fixed model.
- Risky actions get special treatment. State-changing writes can be reviewed before they touch a database or payment workflow.
- The next iteration is measurable. After the fix, the same evaluator shows whether the score and the failure distribution moved.
Closing the loop
The principle is the same as the previous training work: assess first, then fix. The difference is where the fix lands. Training uses failure diagnoses to change the model. Harness improvement uses the same diagnoses to change the system around the model.
The takeaway is to find where the agent actually fails first. Turn that failure into a diagnosis. Use the diagnosis to make a targeted harness change. Then re-run the same eval and check whether the gap moved.
If you are putting agents into production, that is the loop worth running: every failed trajectory becomes a repair signal, every repair is re-tested against ground truth, and the next failure mode becomes clearer.
If you want to know where your agents are quietly failing and which harness change would close the gap, let's talk.
Reinforce Labs