AgentRx: Diagnosing AI Agent Failures from Execution Trajectories

Shraddha Barke, Arnav Goyal, Alind Khare, Avaljot Singh, Suman Nath, Chetan BansalarXiv 2026

TL;DR

As LLM-based agents are increasingly deployed in autonomous, high-stakes environments, debugging them has become a major bottleneck. This paper introduces AGENTRX, an automated, domain-agnostic framework that pinpoints the exact "critical failure step"—the point of no return—in a failed agent trajectory. By synthesizing execution constraints and utilizing an LLM-based judge, AGENTRX improves failure step localization by an average of 75% over prior methods while providing clear root-cause categorization.

What Problem Does This Paper Address?

AI agents often operate over long horizons, interact with noisy tools, and execute probabilistic plans. When an agent fails, finding where and why it went wrong is incredibly difficult. An early mistake might cascade through system side-effects, only becoming visible many steps later.

Currently, diagnosing these failures requires human experts to painstakingly review long execution logs—a process that took the authors over 62 total human hours for just 170 trajectories. Existing evaluation benchmarks typically only look at terminal success or failure, failing to identify the first unrecoverable error. To safely deploy autonomous agents, developers need an automated way to say, "The agent failed at Step X because it misinterpreted the output of Tool Y."

Methods

AGENTRX approaches agent debugging similarly to how software engineers use contracts and assertions to catch bugs. The framework operates in four main stages:

  1. Log Normalization: It converts diverse, heterogeneous multi-agent logs into a unified Intermediate Representation (IR).
  2. Constraint Synthesis: It generates executable constraints in two flavors: Global constraints (derived once from tool schemas and domain policies) and Dynamic constraints (generated step-by-step based on the task instruction and the trajectory history).
  3. Constraint Checking: A checker evaluates these constraints either programmatically (e.g., schema validity) or semantically using an LLM to produce a step-indexed Validation Log filled with concrete violation evidence.
  4. Root-Cause Attribution: An LLM-as-a-judge reviews the validation log alongside a structured Taxonomy Checklist to output the exact critical failure step and its root-cause category.
Figure 1: Given a failed trajectory, domain policy, and tool schema, AGENTRX outputs the critical failure step, a root- cause category, and an auditable constraint violation.

Datasets

The authors introduce the AGENTRX Benchmark, a newly annotated dataset consisting of 170 failed trajectories across 11 diverse task settings. The trajectories are sampled from four distinct agent frameworks:

  • $\tau$-bench: A single-agent retail tool-calling environment.
  • Flash: A multi-agent workflow automation system for cloud incident management.
  • Magentic-One: A generalist multi-agent system handling open-ended web and file tasks.
  • RelWork: A collection of long-horizon tasks spanning software development and mathematical reasoning.

Each trajectory is manually annotated with all failure points, the definitive critical failure step, and a root-cause category.

Key Insights and Ideas

  • The "Critical Failure" Focus: Instead of flagging every minor deviation, AGENTRX specifically targets the first unrecoverable failure. This distinguishes between harmless errors an agent recovers from and the fatal mistake that dooms the run.
  • Step-by-Step vs. One-Shot Generation: For long-horizon tasks, generating constraints step-by-step significantly outperforms generating them all at once ("one-shot"). Looking at the entire trajectory at once introduces context dilution, making the framework less accurate at localizing errors.
  • Complementary Signals: The validation log (concrete evidence) and the taxonomy checklist (semantic definitions) work hand-in-hand. The checklist prevents the judge from using generic catch-all categories, while the validation log grounds the judge's decisions in hard trace evidence.

Key Results

AGENTRX was evaluated against a modified version of the Who&When (W&W) benchmark prompt.

  • Step Localization: AGENTRX achieved massive gains in finding the exact failure step, outperforming the baseline across all datasets—notably boosting accuracy from 18.8% to 42.7% on $\tau$-bench and from 32.6% to 61.5% on RelWork.
  • Root-Cause Categorization: By providing the judge with the validation log and checklist, category attribution accuracy improved by up to 30% compared to judge-only baselines.
Table 3: Failure attribution accuracy across datasets. We compare W&W modified (W&W∗) and AGENTRX on failed- agent and critical-step accuracy. Mean ± std over 3 runs.

Limitations and Future Work

While highly effective, AGENTRX has a few limitations:

  • Symptom Misdirection: Sometimes downstream violations (symptoms) are so loud that they misdirect the LLM judge away from the true upstream root cause.
  • Taxonomy Coverage: Although the 9-category taxonomy generalizes well across the tested domains, highly specialized agent applications might require custom extensions.
  • Cost Overhead: Step-by-step constraint generation requires frequent LLM queries, making it roughly 3.6× more expensive than a simple judge baseline. The authors suggest using one-shot generation for large-scale monitoring and reserving step-by-step analysis for deep debugging.

Summary updated

BibTeX
@misc{barke2026agentrx,
  author = {Shraddha Barke and Arnav Goyal and Alind Khare and Avaljot Singh and Suman Nath and Chetan Bansal},
  title = {{AgentRx: Diagnosing AI Agent Failures from Execution Trajectories}},
  year = {2026},
  eprint = {2602.02475},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2602.02475},
}
Figure