Add observability for LLM failure modes (hallucinations, refusals, tool errors)
Problem
There is currently limited visibility into failure modes of model responses.
Suggested Features
- hallucination detection hooks
- refusal rate tracking
- malformed output detection
- tool invocation failures (for agent workflows)
Why this matters
Understanding failure patterns is critical for deploying AI systems in production environments.
Proposed Direction
Introduce structured logging + tagging of responses with failure categories.
Strong requirements list. We operate 221 agents in production at KinthAI and had to build exactly this observability layer. Some implementation patterns:
Structured failure taxonomy:
We classify every agent output into one of:
success— output is valid and groundedhallucination— output contains ungrounded claims (your hallucination detection)refusal— model declined to act (safety filter, unclear instruction)malformed— output doesn't match expected schema (JSON parse failure, missing fields)tool_error— tool call failed (timeout, auth error, rate limit)loop— agent is repeating actions without progress (detected by action-sequence similarity)
Each category gets its own alert threshold and escalation path.
The critical metric nobody tracks: failure correlation
Individual failure rates per agent are useful, but the high-value insight is correlated failures. When 3 agents simultaneously start hallucinating more, it's usually not 3 independent problems — it's a shared dependency (a vector store went stale, an API changed its response format, a model update shifted behavior). We emit structured trace events at each agent boundary and run correlation analysis on failure spikes.
Refusal rate is underrated:
Most teams focus on hallucination detection. But rising refusal rates are a leading indicator of prompt drift or safety filter changes. When our refusal rate jumped from 2% to 15% overnight, it was because a model update tightened safety filters on financial topics — and 6 of our agents handle payment-related tasks. Without refusal tracking, we would have seen 'agents not doing their jobs' without understanding why.
Writeup on multi-agent observability patterns: 221 Agents: Multi-Agent Coordination Lessons
Thanks for the suggestion. We're adding this to our long-term roadmap along with our existing evaluations feature , though probably not one of our higher priorities right now.
Relatedly I will say that we have an evals tool here: https://github.com/thunderbird/thunderbolt/blob/3d42be4a0069487a324dca6608e37b20b37d7fff/src/ai/eval/README.md#L4
This is probably something that should be part of evals generally.