A Taxonomy of Production Agent Failures

RoadmapsAI Engineering

Overview

A systematic classification of how and why multi-agent systems fail, moving beyond generic `hallucination`.

To correctly diagnose an agent failure so you can apply the right fix (e.g., fixing a specification issue rather than arbitrarily tuning the prompt).

Where used: Debugging failing agents, Evaluating agent traces, System design interviews

Why learn this

Code walkthrough

def evaluate_agent_trace(trace_data):
    failures = {'specification': 0, 'misalignment': 0, 'verification': 0}
    
    for step in trace_data:
        if 'missing_context' in step.get('error_tags', []):
            failures['misalignment'] += 1
        elif 'schema_validation_failed' in step.get('error_tags', []):
            failures['verification'] += 1
        elif 'unclear_task_boundary' in step.get('error_tags', []):
            failures['specification'] += 1
            
    return failures

# Example usage:
# trace = [{'error_tags': ['schema_validation_failed']}]
# print(evaluate_agent_trace(trace))
# Output: {'specification': 0, 'misalignment': 0, 'verification': 1}

Focus: This function walks an agent's execution log and labels each step against MAST's three top-level categories instead of just returning a single pass/fail bit.

Common mistakes

Recall questions

Understanding checks

If an agent correctly identifies a task but the supervisor fails to check whether the claimed outcome actually happened, which `MAST` category does this fall under?

`Task verification failure`.

Task verification failures occur when there is a lack of proper validation of the agent's work, rather than an issue with the task definition (specification) or communication between agents (misalignment).

What happens if a developer only monitors the final output of an agent pipeline without tracing the intermediate steps?

They will miss hidden failures like `endless search loops` or redundant `subagent` spawning, leading to unexpectedly high API costs and latency.

Outcome-only evaluation cannot detect trajectory-level inefficiencies and coordination failures that resolve before the final output is produced.

Practice tasks

Implement a Trace Labeler

Write a Python function that iterates through an agent's execution log and labels each step with one of the three MAST failure categories, producing a histogram of failures.

Continue learning

Previous: Multi-agent orchestration patterns

Previous: Agent Evals: Trajectory vs Outcome Scoring

Return to AI Engineering Roadmap