TRAIL: Trace Reasoning and Agentic Issue Localization

Darshan Deshpande, Varun Gangal, Hersh Mehta, Jitin Krishnan, Anand Kannappan, Rebecca QianarXiv 2025 · DOI

Introduction

The evolution of AI agents from simple conversational interfaces to autonomous entities capable of executing complex, multi-step workflows—such as web searching, tool utilization, and code generation—has introduced significant challenges in evaluation and debugging. Currently, developers often rely on manual, human-led analysis of lengthy execution logs, or "traces," to diagnose failures. This approach is inherently unscalable and difficult due to the non-deterministic nature of agentic systems.

To address this, we present TRAIL (Trace Reasoning and Agentic Issue Localization), which introduces a formal taxonomy of agentic errors and a challenging benchmark to evaluate how well AI models can act as "judges" to perform root-cause analysis on execution traces.

A Taxonomy of Agentic Errors

The foundation of TRAIL is a comprehensive taxonomy that categorizes agent failures into three primary pillars:

  1. Reasoning Errors: These include hallucinations (both language-only and tool-related), poor information processing (e.g., misinterpreting tool outputs), and flawed decision-making (e.g., incorrect problem identification).
  2. System Execution Errors: These involve technical failures such as configuration issues, API rate limiting, authentication errors, and resource exhaustion.
  3. Planning and Coordination Errors: These cover context management failures (e.g., losing track of previous steps) and task management issues like "goal deviation."
The TRAIL Taxonomy of Agentic Errors

The TRAIL Benchmark

The TRAIL benchmark utilizes 148 large, human-annotated traces comprising nearly 2,000 individual spans. These traces were generated by state-of-the-art agents (including Claude 3.7 Sonnet and o3-mini) performing tasks from the GAIA (General AI Assistants) and SWE-Bench Lite (software engineering) datasets.

In the TRAIL task, an evaluator model is provided with a structured execution trace in OpenTelemetry format. The model must identify the precise location of an error, categorize it according to the taxonomy, and provide supporting evidence. This "ecologically valid" approach ensures the benchmark reflects real-world agent behavior rather than simplified synthetic scenarios.

Key Insights and Results

Our evaluation reveals a stark "reality check" for the industry. Even the most advanced long-context models struggle with the complexity of trace reasoning.

The Performance Gap

The best-performing model, Gemini 2.5 Pro, achieved a joint accuracy of only 11%—correctly identifying both the error location and its category. While models with explicit "thinking" or reasoning capabilities (like OpenAI’s o-series) generally outperform standard models, the overall performance remains low.

Error Distribution and Difficulty

Analysis of the annotated traces shows that "Output Generation" issues, such as formatting errors and instruction non-compliance, are the most frequent, accounting for nearly 42% of total errors. Conversely, "Context Handling Failures" and "Tool Selection Errors" proved nearly impossible for current AI judges to detect, resulting in near-zero F1 scores across the board.

Distribution of Error Category Annotations in TRAIL

The "Context Wall"

Trace length significantly impacts performance. Many agent traces exceed 1 million tokens, and while modern LLMs can ingest this volume of data, their ability to reason over it and localize specific failures drops sharply as the trace length increases.

Conclusion and Future Work

TRAIL highlights a critical bottleneck in the development of autonomous agents: our current inability to automate the debugging process. While models show some correlation with human judgment on "vibes-based" overall grading, they lack the precision required for detailed root-cause analysis.

Future work will involve expanding the taxonomy to include multimodal agents and exploring the use of synthetic "buggy" traces to train more effective AI debuggers. By open-sourcing TRAIL, we aim to provide a foundation for building the next generation of tools that can ensure the reliability and safety of autonomous agentic systems.

Summary updated

BibTeX
@misc{deshpande2025trail,
  author = {Darshan Deshpande and Varun Gangal and Hersh Mehta and Jitin Krishnan and Anand Kannappan and Rebecca Qian},
  title = {{TRAIL: Trace Reasoning and Agentic Issue Localization}},
  year = {2025},
  eprint = {2505.08638},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.08638},
}
Figure