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.
| Order | Rule | Code |
|---|---|---|
| 1 | A 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 |
| 2 | The 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 |
| 3 | A 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_FAILED | OUTPUT.FORMAT.TRUNCATED |
| 4 | A validation error (for example the ValidationError of Pydantic) | OUTPUT.FORMAT.SCHEMA_VIOLATION |
| 5 | A guardrail tripwire (for example the input and output guardrails of the OpenAI Agents SDK) | OUTPUT.SAFETY.POLICY_VIOLATION |
| 6 | A server error of the model host, by its type (for example LMServerError of DSPy) | TOOL.EXECUTION.DEPENDENCY_FAILED |
| 7 | Keyword rules on the text (timeout, rate limit, connection, permission, JSON and others) | The code of the rule |
| 8 | No rule matches | TOOL.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
PERCEPTION
Input processing and understanding failures
REASONING
Cognitive and logic failures
TOOL
Tool and action execution failures
MEMORY
State and context management failures
OUTPUT
Response generation failures
COORDINATION
Multi-agent workflow coordination failures
COMMUNICATION
Inter-agent messaging failures
ORCHESTRATION
Agent lifecycle and management failures
CONSENSUS
Agreement and conflict resolution failures
RESOURCES
Shared resource management failures
Quick Reference
| Module | Categories | Codes | Focus |
|---|---|---|---|
| PERCEPTION | INPUT, PARSING, CONTEXT | 15 | Input processing, validation, context |
| REASONING | LOGIC, HALLUCINATION, PLANNING, DECISION | 20 | Logic, inference, planning, decisions |
| TOOL | INVOCATION, EXECUTION, RESULT | 15 | Tool calling, execution, results |
| MEMORY | STATE, RETRIEVAL, CONTEXT_WINDOW | 14 | State management, retrieval, context window |
| OUTPUT | FORMAT, QUALITY, SAFETY | 15 | Formatting, quality, safety |
| COORDINATION | WORKFLOW, HANDOFF, SYNCHRONIZATION | 15 | Workflow, handoffs, synchronization |
| COMMUNICATION | DELIVERY, CONTENT, ROUTING | 15 | Message delivery, content, routing |
| ORCHESTRATION | LIFECYCLE, SCALING, DELEGATION | 15 | Lifecycle, scaling, delegation |
| CONSENSUS | AGREEMENT, CONFLICT, VOTING | 15 | Agreement, conflict resolution, voting |
| RESOURCES | ACCESS, CONTENTION, QUOTA | 15 | Access 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:
| Level | Name | Description |
|---|---|---|
| 5 | Critical | System failure, data loss, or safety risk |
| 4 | High | Task failure requiring intervention |
| 3 | Medium | Degraded performance or partial failure |
| 2 | Low | Recoverable issue with minimal impact |
| 1 | Info | Informational, 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: