Skip to main content

Error Taxonomy

10 modules, 31 categories, 154 error codes.

Risicare classifies agent errors using a hierarchical taxonomy designed for AI systems. The taxonomy covers both single-agent failures (perception, reasoning, tool use, memory, output) and multi-agent failures (coordination, communication, orchestration, consensus, resources).

What the SDK Assigns Today

The SDK gives an error span an error code (error.code), the same with content capture on and off. A cancel or an abort gets no code (see below). The taxonomy has 154 codes in 10 modules; the SDK can send 23 of them (the list below). The rules come in this order: a provider's 400 that names a context-length overflow or a content filter; the HTTP status of the error; a model stream that was cut; a validation error; a guardrail tripwire; a server error of the model host; keyword rules on the text. An error that no rule matches gets TOOL.EXECUTION.CRASHED on a tool span and ORCHESTRATION.LIFECYCLE.CRASHED on any other span. The error name and the error message always stay on the span, so they name the cause when the code is a general one.

The 23 codes (Python 0.16.1 and npm 0.19.1, the same in both SDKs): COMMUNICATION.DELIVERY.UNDELIVERABLE, CONSENSUS.AGREEMENT.QUORUM_FAILED, COORDINATION.WORKFLOW.DEADLOCK, MEMORY.CONTEXT_WINDOW.EXCEEDED, MEMORY.STATE.CORRUPTED, ORCHESTRATION.LIFECYCLE.CRASHED, OUTPUT.FORMAT.SCHEMA_VIOLATION, OUTPUT.FORMAT.TRUNCATED, OUTPUT.SAFETY.PII_LEAK, OUTPUT.SAFETY.POLICY_VIOLATION, PERCEPTION.INPUT.ENCODING, PERCEPTION.INPUT.INJECTION, PERCEPTION.INPUT.MALFORMED, PERCEPTION.PARSING.JSON_INVALID, REASONING.HALLUCINATION.FACTUAL, REASONING.LOGIC.CONTRADICTION, RESOURCES.QUOTA.EXCEEDED, TOOL.EXECUTION.CRASHED, TOOL.EXECUTION.DEPENDENCY_FAILED, TOOL.EXECUTION.RATE_LIMITED, TOOL.EXECUTION.TIMEOUT, TOOL.INVOCATION.INVALID_ARGS, TOOL.INVOCATION.PERMISSION_DENIED.

OrderRuleCode
1A provider's 400 that names a context-length overflow, or a content filter (only for a provider error: status 400, or a provider error type; a plain error with the same words does not match)MEMORY.CONTEXT_WINDOW.EXCEEDED, or OUTPUT.SAFETY.POLICY_VIOLATION
2The HTTP status of the error, from the error object, else from its text: 429; 401 and 403; 400, 404 and 422; 408 and 504; another 5xx (a model host and a tool's own HTTP service alike)TOOL.EXECUTION.RATE_LIMITED; TOOL.INVOCATION.PERMISSION_DENIED; TOOL.INVOCATION.INVALID_ARGS; TOOL.EXECUTION.TIMEOUT; TOOL.EXECUTION.DEPENDENCY_FAILED
3A model stream that was cut. Python with openai 3.x: a cut stream arrives as a connection error, so rule 2 or 7 gives TOOL.EXECUTION.DEPENDENCY_FAILEDOUTPUT.FORMAT.TRUNCATED
4A validation error (for example the ValidationError of Pydantic)OUTPUT.FORMAT.SCHEMA_VIOLATION
5A guardrail tripwire (for example the input and output guardrails of the OpenAI Agents SDK)OUTPUT.SAFETY.POLICY_VIOLATION
6A server error of the model host, by its type (for example LMServerError of DSPy)TOOL.EXECUTION.DEPENDENCY_FAILED
7Keyword rules on the text (timeout, rate limit, connection, permission, JSON and others)The code of the rule
8No rule matchesTOOL.EXECUTION.CRASHED on a tool span; ORCHESTRATION.LIFECYCLE.CRASHED on any other span

A close and a cancel are not errors and get no code for the spans that the SDK names: in Python, the decorators and with risicare.trace(...) (GeneratorExit, asyncio.CancelledError, KeyboardInterrupt, SystemExit); in JavaScript, agent(), the phase wrappers, session() and withSession() (AbortError). Three other spans keep the error status and get no code: a JavaScript span of startSpan() that an AbortError ended, a JavaScript span of a provider patch that an AbortError ended, and a Python report_error() of a cancel. An abort of an OpenAI or Anthropic client call in JavaScript (APIUserAbortError) is not an AbortError: its span still reads as a failed call, with a timeout code. Through Python 0.16.0 and npm 0.19.0, every error that no rule matched got TOOL.EXECUTION.CRASHED, also an LLM HTTP 500, a cut model stream, a validation error in your code and a guardrail tripwire. So codes move in filters and alerts that use error.code: for example, error.code:TOOL.EXECUTION.CRASHED now finds tool crashes only. The two SDKs give the same code for the same error (checked on a shared set of error inputs). The other codes are for the diagnosis pipeline, which is held for the beta.

Taxonomy Structure

Module (10)
└── Category (31)
    └── Error Code (154)
        └── Format: MODULE.CATEGORY.CODE

Modules Overview

Agent Error Taxonomy showing 10 modules organized by Cognitive, Execution, Social, and Infrastructure categories

Quick Reference

ModuleCategoriesCodesFocus
PERCEPTIONINPUT, PARSING, CONTEXT15Input processing, validation, context
REASONINGLOGIC, HALLUCINATION, PLANNING, DECISION20Logic, inference, planning, decisions
TOOLINVOCATION, EXECUTION, RESULT15Tool calling, execution, results
MEMORYSTATE, RETRIEVAL, CONTEXT_WINDOW14State management, retrieval, context window
OUTPUTFORMAT, QUALITY, SAFETY15Formatting, quality, safety
COORDINATIONWORKFLOW, HANDOFF, SYNCHRONIZATION15Workflow, handoffs, synchronization
COMMUNICATIONDELIVERY, CONTENT, ROUTING15Message delivery, content, routing
ORCHESTRATIONLIFECYCLE, SCALING, DELEGATION15Lifecycle, scaling, delegation
CONSENSUSAGREEMENT, CONFLICT, VOTING15Agreement, conflict resolution, voting
RESOURCESACCESS, CONTENTION, QUOTA15Access control, contention, quotas

Error Code Format

TOOL.EXECUTION.TIMEOUT
  │      │        │
  │      │        └── Code (specific error)
  │      └── Category (error type)
  └── Module (system area)

Severity Levels

Each error code has a severity from 1 to 5:

LevelNameDescription
5CriticalSystem failure, data loss, or safety risk
4HighTask failure requiring intervention
3MediumDegraded performance or partial failure
2LowRecoverable issue with minimal impact
1InfoInformational, no action needed

Using Error Codes

In the API

The REST API has no route that queries traces or diagnoses by taxonomy code. Use the filter bar on the Traces page, as described under In Dashboards. The MCP server filters traces by code with a Secret key: give list_traces the filter error_code:TOOL.EXECUTION.TIMEOUT.

In Dashboards

The filter bar on the Traces page accepts error_code:<CODE>. It matches the typed error code of a span:

error_code:TOOL.EXECUTION.TIMEOUT

A code uses letters, digits and the characters _ . : / -, with at most 128 characters, and it is either dotted or has no lower-case letter. A value that is not shaped like a code, for example timeout or rate limit, is read as error_message: with the same text, and it matches the status message of a failed span.

Combine the term with others, for example error_code:TOOL.EXECUTION.TIMEOUT env:production. When you type error_code:, the bar suggests up to 10 error codes with their counts. See Filtering and Search for the full filter language.

The search box in the top bar matches the root span name and the start of a trace ID only. It does not match error codes.

In Alerts

An alert rule names one metric, an operator, a threshold and a window. A rule can also carry a filter in the same language as the trace list. A filter such as error_code:TOOL.EXECUTION.TIMEOUT limits the rule to the traces that match it, so a rule on the metric Trace volume with that filter counts only those traces. The rule form shows how many traces the filter matches.

The metrics are Error rate, Latency p50, Latency p95, Latency p99, Tool error rate, LLM error rate, Trace volume, Cost, Total tokens, Behaviour drift, Score mean and Run verdict. See Cost Alerts for the fields of a rule. The metric Error rate counts all errors together.

In Fixes

Each fix targets exactly one error code, in the singular field target_error_code:

{
  "fix_type": "retry",
  "target_error_code": "TOOL.EXECUTION.TIMEOUT",
  "config": { "max_retries": 3, "initial_delay_ms": 1000, "exponential_base": 2.0 }
}

Next Steps

Select a module to see all its error codes: