AI agents fail in 5 ways: hallucination, environment, rate-limit, ambiguous task, and infinite loop. Recovery is different for each: retry-with-jitter for environment and rate-limit; CLAUDE.md update for hallucination and ambiguous; loop-detector kill for infinite loop. Always-on guardrails: per-task cost cap, per-month budget, loop detector, sandbox isolation, egress allowlist, auto-stop on idle, read-only-by-default. Adopt the partial-success mindset — 96% completion on a fan-out of 100 is a win, not a failure.
Why failure handling matters more than the model
Most operators new to AI workforces obsess over picking the right model. Claude Sonnet vs Opus. GPT-5 vs GPT-5-reasoning. Gemini vs Llama. The model debate is loud and visible. The boring truth is that failure handling determines production outcomes more than the model does.
An agent on the wrong model fails predictably — quality is lower, you switch. An agent without proper failure handling fails unpredictably — silent loops, runaway costs, half-finished work, customer-affecting incidents that surface days later. Predictable failures are tolerable; unpredictable failures cause headlines.
The companies winning at AI workforce management in 2026 share a pattern:
- They expect failure — they don't treat each failure as a crisis but as a signal
- They contain blast radius from day one — guardrails before scale, not after
- They distinguish failure types — different categories get different responses
- They route failures to humans efficiently — the failure budget gets you signal-not-noise
- They learn from clusters — one failure is information; five is a pattern; the pattern goes into CLAUDE.md or tooling
This guide is the playbook for each of those. Read it before you scale a fleet, not after the first incident. The cost of doing it right at the start is one operator-week. The cost of doing it wrong at scale is months of remediation, customer-affecting incidents, and audit findings.
The 5-category failure taxonomy
Every failure you'll see falls into one of five buckets. Recovery is different for each. Misdiagnosing the bucket is the most common mistake — operators treat hallucinations like environment failures (retry instead of fix the prompt) and lose hours.
| Category | What it looks like | Right response |
|---|---|---|
| Hallucination | Agent confidently outputs something wrong — wrong case citation, made-up vendor address, nonexistent SKU, fabricated API endpoint, invented Stripe customer ID. | Don't retry. Update CLAUDE.md with the constraint, add a verification tool, or switch the model. |
| Environment | Portal UI changed, CAPTCHA appeared, session expired, file format changed, downstream API returns 503, vendor's site is down. | Retry with exponential backoff. After N retries, screenshot-on-failure and escalate. |
| Rate limit | Model API returns 429, downstream system throttles, vendor portal locks the account temporarily, Slack rate-limits a channel. | Backoff with jitter. Spread fan-out work over time. Add provider failover for model APIs. |
| Ambiguous task | Agent stops and asks for clarification — or worse, makes a confident guess. Common in week 1 of onboarding. Often the agent's CLAUDE.md doesn't cover the edge case. | The agent did the right thing if it asked. Update CLAUDE.md to remove the ambiguity for next time. If the agent guessed, the gate to add: "if X is unclear, escalate." |
| Infinite loop | Agent keeps making the same tool call over and over — same failed click, same failed shell command, same failed API request. Cost rises rapidly without progress. | Loop detector kills the run. Add a constraint (max-attempts) to CLAUDE.md. Don't retry — fix the underlying. |
How to diagnose which category you're in
The audit log usually tells you, but here are the tells if you're triaging quickly:
- Hallucination signal: the agent posted a "success" message but downstream rejected (PO not found, citation not in database, customer doesn't exist). The agent thought it succeeded.
- Environment signal: explicit error message — HTTP 503, "element not found," "session expired," "request timeout." The agent knows it failed.
- Rate-limit signal: HTTP 429, "Too Many Requests," "Quota exceeded," "Account temporarily locked." Upstream told us to slow down.
- Ambiguous-task signal: the agent's reasoning trace shows it stopped, asked, or hedged. "I'm not sure whether..." "This could be A or B..."
- Infinite-loop signal: the same tool call repeated 5+ times in the audit log. Cost rising; no progress on the task.
What failures look like by role
| Role | Most common failure | What it looks like |
|---|---|---|
| AP clerk | Environment (vendor portal changed) | "Click failed: element not found." Often a redesign or A/B test on the portal side. |
| Paralegal | Hallucination (citation invented) | Memo cites a case that doesn't exist; verifier tool catches it; downstream review flags it. |
| Research analyst | Environment (CAPTCHA, anti-bot) | Site detected automated traffic; agent gets a CAPTCHA; can't proceed. |
| Code reviewer | Ambiguous task (unfamiliar pattern) | PR uses a library the agent's CLAUDE.md doesn't mention; reviewer suggests changes that don't fit. |
| Customer support tier-1 | Ambiguous task (unusual customer phrasing) | Customer asks something that doesn't match KB; agent escalates. |
| Practice manager | Environment (payer portal MFA) | Payer added MFA; agent stops, message #ap-help. |
| QA tester | Environment (UI flake) | Element appears but isn't clickable yet; retry usually works. |
| Always-on monitoring | Rate limit (data-source quota) | API quota exhausted mid-day; agent backs off, reports degraded mode. |
| Coding agent | Hallucination (made-up API) | Agent calls a method that doesn't exist on the library; CI catches it. |
The seven guardrails: containing blast radius before failure happens
Recovery is reactive. Containment is proactive. Set these up at the agent's profile in the dashboard before the first run. None of them is sufficient alone; together they make most failure modes survivable.
1. Sandbox isolation
Every agent runs in its own sandbox, with its own filesystem, its own credentials, its own network. A hallucinated rm -rf / destroys one agent's workspace, not your prod database. A leaked session cookie is scoped to one sandbox. A misbehaving Python script can't touch the rest of the fleet.
This is the foundation. Every other guardrail assumes it. Don't share sandboxes across agents. Don't reuse a sandbox across security boundaries.
2. Egress allowlist
By default, sandboxes can reach the public internet. For high-sensitivity workloads, restrict outbound to an allowlist:
- Your AP clerk can reach
vendor-portal.com,your-erp.example.com,slack.com, your secrets vault, and the Anthropic API. Nothing else. - Your paralegal can reach Westlaw, LexisNexis, your firm's document store, the court e-filing portals, and the model provider. Nothing else.
- Your support agent can reach Zendesk, your KB, Slack, the model provider. Nothing else.
The agent can't exfiltrate to a random URL even if a malicious prompt tells it to. Configure at workspace level; verify weekly that the allowlist is tight.
3. Per-task cost cap
Kill the agent if a single task exceeds $5 (or whatever number is large for your role's normal cost). Catches runaway loops cheaply — by the time the cap fires, the operator has lost a few dollars, not a few thousand.
Calibrate by role:
- AP clerk single-invoice processing: $0.50 cap (typical task is $0.05-0.15)
- Paralegal single-research-task: $5 cap (typical is $0.50-1.50)
- Research analyst single-report: $10 cap (typical $1-3)
- Code reviewer single-PR: $1 cap (typical $0.05-0.20)
The cap should be 5-10× the typical cost, so it triggers on actual runaway, not on slightly-longer-than-average runs.
4. Per-month budget
Hard stop with HTTP 402 when the monthly spend hits cap. Stops cost runaway in absolute terms. Per-task cap stops one task; per-month budget stops a series of slightly-runaway tasks adding up.
The platform's budget enforcement returns 402 to the agent, which interprets it as "I'm out of budget" and stops cleanly. Operator gets an alert.
5. Loop detector
If the agent makes the same tool call 5 times in a row, kill the run and alert. Catches the "agent stuck on a CAPTCHA" pattern and the "agent retrying a permanently-broken endpoint" pattern. Configurable threshold (default 5).
The loop detector looks at recent tool calls and flags exact-repetition or near-repetition (same URL, same payload, same agent reasoning). Three exact repeats = warning; five = kill.
6. Auto-stop on idle
Kills sandboxes that have nothing to do. Reduces accidental burn from agents that finished work but didn't shut down cleanly. Default 15 minutes for event-driven agents; longer for research-heavy roles.
Auto-stop is also a soft form of failure containment — an agent stuck "thinking" about something hits the idle threshold (no real work being done) and stops. The next event resumes it cleanly.
7. Read-only by default
Day one, give the agent read-only on databases, write access only to its own scratch space and the explicitly-needed write surfaces. Promote to broader write only after the shakedown.
By role:
- AP clerk: read-only on the GL; write on AP staging only.
- Paralegal: read-only on case database; write on draft folder only.
- Research analyst: read-only on source systems; write on Notion / Confluence drafts.
- Code reviewer: read-only on prod; write only on feature branches; PR-create but not auto-merge.
This is the seventh strap on the gurney. Together with the other six, most failure modes are survivable.
The retry-with-jitter pattern
For environment and rate-limit failures, retry. Not naively — with exponential backoff and jitter:
import random, time, logging class RetryableError(Exception): pass class NonRetryableError(Exception): pass def retry_with_jitter(action, max_attempts=3, base_delay=2, max_jitter=2): """ Retry an action with exponential backoff + jitter. Why jitter: 50 fan-out agents that all rate-limit at the same moment would all retry at the same moment without jitter, causing the same thundering herd. Jitter spreads retries. """ for attempt in range(max_attempts): try: return action() except NonRetryableError: raise # hallucinations, infinite loops, ambiguous tasks except RetryableError as e: if attempt == max_attempts - 1: raise delay = base_delay * (2 ** attempt) + random.uniform(0, max_jitter) logging.info(f"Retry {attempt+1}/{max_attempts} after {delay:.1f}s: {e}") time.sleep(delay)
Retry caps by failure type:
- Environment failures (503, timeout, bad gateway): 3 attempts, base delay 2 sec
- Rate-limit failures (429): 5 attempts, base delay 5 sec, longer jitter
- Hallucination failures: do not retry — fix the prompt or the tools first
- Infinite-loop detection: kill, don't retry — same loop will happen again
- Ambiguous-task failures: escalate, don't retry — let a human disambiguate
The thundering-herd protection
When 50 fan-out agents all hit the same rate limit at the same instant, naive retry causes them all to retry at the same instant — same rate limit, same failure. Jitter spreads them. With random.uniform(0, 2) jitter on top of exponential backoff, retries spread across 0-2 seconds of the retry window, not all at one point.
For very large fleets (100+ concurrent), increase jitter to random.uniform(0, base_delay) — full-jitter pattern recommended by AWS.
Circuit breakers for downstream systems
For agents talking to flaky downstreams, add a circuit breaker — after N failures within window M, stop trying for cooldown C. Prevents the fleet from hammering a system that's already broken.
from dataclasses import dataclass, field import time @dataclass class CircuitBreaker: failure_threshold: int = 5 cooldown_seconds: int = 60 failures: int = 0 last_failure: float = 0 def call(self, action): if self.failures >= self.failure_threshold: if time.time() - self.last_failure < self.cooldown_seconds: raise RuntimeError("Circuit open; not retrying") self.failures = 0 # half-open: try one try: result = action() self.failures = 0 # reset on success return result except Exception: self.failures += 1 self.last_failure = time.time() raise
Screenshot-on-failure (the browser-agent special)
When a browser agent fails, the most useful debugging artifact is a screenshot of what was on the screen at the moment it gave up. Configure this in the agent's CLAUDE.md:
"On any unrecoverable error during a browser session, take a full-page screenshot, save it to
/data/failures/{run_id}.png, and include the path in the failure message you post to Slack. Also save the page HTML to/data/failures/{run_id}.htmlfor after-the-fact inspection."
Why it matters: most browser-agent failures are environment changes (the vendor's portal redesigned a button, a CAPTCHA appeared, the cookie banner changed). The screenshot tells you instantly what went wrong without you replaying the whole run.
What's worth capturing on failure:
- Full-page screenshot — the visual state
- Page HTML — the DOM, useful when the visual state is obvious but the agent's logic was wrong
- Browser console logs — JS errors, network errors
- Last 10 actions the agent attempted — what was it doing right before it failed
- The failure error message itself — "element not found" vs "session expired" vs "CAPTCHA detected"
Storage: keep failure screenshots for 90 days, then delete. Don't accumulate — they're for debugging, not archival. The platform's audit log retention configuration handles this.
Escalation patterns: when the agent should stop and ask
The most underrated pattern is the agent knowing it doesn't know and stopping. This is the most powerful failure-mitigation tool you have.
Configuring escalation in CLAUDE.md
Concrete escalation rules by role:
| Role | Escalation rules in CLAUDE.md |
|---|---|
| AP clerk | "If a vendor portal asks you to upload a tax form, stop and message #ap-help." "If an invoice is over $10,000, stop and ping the controller." "If the same vendor appears with two different addresses, stop and verify." |
| Paralegal | "If a contract has a clause type you've never seen, stop and tag the partner on the case." "If a citation can't be verified against the database after 2 lookups, flag and stop." "If a deadline is within 48 hours, escalate immediately." |
| Research analyst | "If a competitor's site requires login, stop and post the URL to #intel-help." "If 3 sources contradict each other, flag and let a human pick." "If you can't find recent data (last 30 days), say so explicitly." |
| Customer support | "If the customer mentions legal action, escalate immediately." "If the customer asks for a refund, route to refunds-team." "If sentiment is strongly negative across multiple messages, escalate to a human." |
| Code reviewer | "If the diff touches files in /payment/, escalate to senior eng." "If tests fail in a way you don't understand, ask before suggesting changes." "If the PR is over 1000 lines, escalate (too big for AI review)." |
Escalation channels
The escalation should land where the right human will see it:
- Same channel as the work — most common, low friction. Agent posts in the same Slack channel where it normally reports.
- Dedicated help channel (e.g.
#ap-help,#intel-help) — for high-volume escalations, separate channel keeps the main one clean. - DM to the supervisor — for urgent / private escalations.
- Ticket creation — for escalations that need tracking (Linear / Jira).
- Page (PagerDuty) — for true urgency only. Most escalations should not page.
Escalation isn't failure
The opposite is the agent that pushes through ambiguity and ships wrong work — that's the bad outcome. You want the escalation rate to be 1-5% of runs, not 0%. The agent that asks for help is the agent that doesn't make expensive mistakes.
Watch for escalation rate dropping to zero. If your agent's escalation rate falls to 0%, it's not because it got smarter. It's because it stopped asking. Either the prompts got too aggressive ("don't ask, just do"), or the agent learned to push through edge cases it should have flagged. Bump back to live-watching and recalibrate the CLAUDE.md.
The partial-success mindset
If you fan out 100 agents and 96 succeed, 3 escalate, and 1 fails — that's a win. The math is dramatic:
| Outcome | Old (sequential, 1 human) | New (100 agents, partial success) |
|---|---|---|
| Throughput | 20 tasks/day max | 96 tasks complete + 3 escalations to a human |
| Time to result | 5 days | 15 minutes |
| Cost | $200/day labor | $1.20 compute + 10 min human time |
| Failure handling | 1 human gets stuck and stops | 97 done; 3 routed to a human; 1 retried tomorrow |
The mistake is treating "1 of 100 failed" as "the system failed." It didn't. 99 of 100 succeeded and the failures got logged for a human. That's the steady state, not an emergency.
What partial-success looks like in practice
- Per-task isolation — one agent's failure doesn't stop the other 99. Per-sandbox compute, per-task budget, per-task escalation.
- Failed-tasks queue — failures land in a dead-letter queue with their context (input, error, screenshot, last-attempted-action).
- Human triage — once a day, a human spends 10 minutes triaging the dead-letter queue.
- Patterns become guardrails — if the same vendor portal fails 5× in a week, that's a CLAUDE.md update or a tool fix.
- Aggregate success-rate alerts — alert if success rate drops below 90% (was 96%); not on individual failures.
When partial success isn't acceptable
Some workloads need 100% completion before any can proceed:
- Multi-step pipelines where step N+1 depends on step N. If task #47 fails, tasks #48-100 wait. Use a state machine, not fan-out.
- Financial close. You can't do a partial month-end reconciliation. Either every transaction reconciles or you stop and investigate.
- Regulatory submissions. 99/100 filings to the SEC isn't "almost done"; it's "incomplete and you'll get a fine."
- Customer-facing workflows. "We processed 96% of your orders" isn't a customer-acceptable outcome.
For these, treat any failure as critical and route to a human immediately. Partial-success is for batch / aggregate work, not for individual customer-affecting transactions.
Post-incident: when do you change the prompt, the model, or the tools?
After an incident, you have three knobs. Use them in this order:
Update CLAUDE.md (the cheapest fix)
80% of the time, the fix is in the job description. "Always verify case citations against the Bluebook 21st." "Never approve invoices over $10,000 without escalation." "If the vendor uses ALL CAPS in the email, this is auto-generated; verify the PO before paying." Cheap, immediate, no model retraining.
When this works: failure mode is encodable as a rule the agent can follow. When this doesn't: the issue is genuinely beyond the model's capability — bump to step 2.
Add or fix a tool
If the agent failed because it didn't have access to the right system or the wrong API, fix that. "Give the agent read access to the inventory database." "Add the contract-diff tool to its workspace." "Add a citation-verifier tool that hits the Westlaw API."
When this works: the agent's failure is fundamentally an information / access gap. When this doesn't: the agent has the right tools but is using them wrong — back to step 1, or forward to step 3.
Switch the model (the expensive option)
If you've fixed CLAUDE.md and tools and the agent still fails, the model might not be capable enough. Try Claude Sonnet 4.6 → Opus 4.7, or GPT-5 standard → GPT-5 reasoning. This is the expensive option; usually unnecessary.
When this works: the task genuinely requires more reasoning than the smaller model has. When this doesn't: the issue was actually 1 or 2; you just didn't catch it.
Don't reach for option 3 first. Most "the model is bad" claims are actually "the prompt didn't tell the model the constraint." Tighten the prompt before paying 5× more for compute.
Dead-letter queues for event-driven agents
If your agents are event-driven (webhooks, cron, queues), failed events should go to a dead-letter queue, not silently disappear:
- Webhook receiver: if the agent fails 3 times, push the event to
events.dlq - Daily DLQ digest: post the count and category summary to Slack at 9am
- Manual replay: a "replay this event" button in the dashboard for re-trying after a CLAUDE.md fix
- Pattern detection: if 5+ failures cluster around the same downstream system, that's a vendor issue, not an agent issue
- Retention: 14 days in DLQ; auto-delete after; export interesting ones for the post-mortem
resource "aws_sqs_queue" "agent_dlq" { name = "agent-events-dlq" message_retention_seconds = 1209600 # 14 days } resource "aws_sqs_queue" "agent_events" { name = "agent-events" redrive_policy = jsonencode({ deadLetterTargetArn = aws_sqs_queue.agent_dlq.arn maxReceiveCount = 3 }) } resource "aws_cloudwatch_metric_alarm" "dlq_growth" { alarm_name = "agent-dlq-growing" comparison_operator = "GreaterThanThreshold" threshold = 10 metric_name = "ApproximateNumberOfMessagesVisible" namespace = "AWS/SQS" dimensions = { QueueName = aws_sqs_queue.agent_dlq.name } alarm_actions = [aws_sns_topic.alerts.arn] }
Standard pattern. SQS, EventBridge, RabbitMQ, NATS — all have native DLQ support. The platform's queue integrations wire it up automatically; you don't have to.
Ten anonymized failure modes from the field
Concrete examples from operators we work with — anonymized, but real. Each includes the failure category, what happened, and the fix.
1. The CAPTCHA loop
Category: Environment + Infinite loop. What happened: An AP-clerk agent hit a vendor portal that suddenly required CAPTCHA after a security update. The agent kept retrying the login, racking up failed attempts until the loop detector caught it on the 5th attempt. Fix: the CLAUDE.md got "if the login page shows a CAPTCHA, stop and message #ap-help." Loop didn't repeat. Operator manually solved the CAPTCHA once, then the vendor's session cookie persisted for 30 days.
2. The hallucinated vendor address
Category: Hallucination. What happened: An agent processing a vendor change-of-address request "remembered" the new address as a different city. Compliance caught it before payment went out. The agent had read the change-of-address email and somehow conflated it with another vendor's last-known address. Fix: added a tool that looks up vendor records from the source-of-truth ERP, with a constraint: "always read the address from the ERP, never from memory." Plus: "for any address change, escalate for human verification."
3. The infinite contract review
Category: Infinite loop. What happened: A paralegal agent kept refining the same NDA review, never finishing. Each pass was slightly better; the agent kept thinking it could improve. Cost cap killed the run at $1.50. Fix: added "after the third pass, finalize and ship; refinement is an anti-pattern past pass two" to CLAUDE.md. Plus: cost-per-task cap of $2 (2× typical), so even if the rule wasn't followed, the cap would catch it.
4. The rate-limit cascade
Category: Rate limit. What happened: A research agent fanned out to 50 browsers reading the same publisher's site. Publisher rate-limited. Without jitter, all 50 retried at the same instant — same rate limit, same failure. Eventually the publisher's WAF blocked the agent's IP entirely for 24 hours. Fix: added jitter to the fan-out (random.uniform(0, 5)), capped concurrent reads to a single domain at 5, added User-Agent rotation, and added a circuit breaker that opens for 10 minutes if rate limits are detected.
5. The over-eager escalation
Category: Ambiguous task (mis-tuned). What happened: A QA agent escalated every flaky test to a human. Humans got tired of the noise — 40 escalations a day, most resolved by re-running the test. Fix: CLAUDE.md got "before escalating a test failure, retry it 3 times. Only escalate if it consistently fails or if it's a new failure type." Escalation rate dropped from 20% to 4%. Real failures got attention; flake didn't.
6. The phantom approval
Category: Hallucination. What happened: A code-review agent posted "Approved with no issues" on a PR that had a clear bug — the agent had been given a long context window and lost track of which file it was reviewing midway through. Fix: added a tool that runs the test suite explicitly before approval (the agent now has actual signal, not "I think the tests pass"). Plus: chunked review for PRs over 200 lines, with explicit per-chunk approval.
7. The silent timeout
Category: Environment. What happened: A research agent stopped posting heartbeats for 6 hours overnight. Operator didn't notice until 11am the next day. The cron-driven competitive-intel run silently didn't fire because the underlying scheduler had a config drift. Fix: added a heartbeat-missing alert (alert if no I'm-alive ping for 30 minutes during business hours, 2 hours overnight). Migrated from systemd timers to EventBridge Schedules (cloud-native scheduler with built-in alerting on missed fires).
8. The session-expiry storm
Category: Environment. What happened: All agents in the AP fleet hit a vendor's session-expiry simultaneously after a maintenance window. The shared session cookie expired; 12 simultaneous re-logins triggered the vendor's anti-fraud system; the vendor temporarily locked the AP service account. Fix: per-agent session cookies (not shared), staggered re-login (jitter on first hit), and a "vendor account locked" alert that pages immediately.
9. The model-version regression
Category: Hallucination (introduced by upstream change). What happened: Claude Sonnet's quarterly model update changed the way it handled a specific contract clause type. Existing CLAUDE.md was tuned to the previous behavior. Quality dropped overnight from 96% to 88% with no agent-side change. Fix: rolled back to the previous model version (the platform supports pinning specific model versions), then iterated CLAUDE.md to handle the new behavior, then upgraded again. Lesson: pin model versions for production agents; upgrade deliberately, not automatically.
10. The cross-agent contamination
Category: Environment + privacy. What happened: Two paralegal agents (different partners' agents at the same firm) shared an EBS volume by mistake. Agent A's research notes appeared in Agent B's context window. Caught during a quarterly audit. Fix: per-agent isolated volumes (now enforced at workspace level); audit alert if any sandbox attempts to mount a volume not in its allowed list; quarterly access-control review.
The post-mortem framework for AI agent incidents
When something goes wrong badly enough to warrant a post-mortem, follow the same shape you'd use for a human or system incident:
- Timeline. Pull from the audit log. When did the failure start? What did the agent do? When did the operator notice? When was it contained?
- Impact. Customer-affecting? Data integrity? Compliance? Cost burn? Quantify.
- Root cause. Which of the 5 categories? What specifically triggered it?
- Contributing factors. Why didn't the guardrails catch it earlier? Was the alerting tuned wrong? Was the CLAUDE.md too vague?
- What changed. The CLAUDE.md update; the new tool; the alert tuning; the model swap. Specifically what's different now.
- What we'll watch. How will we know if this recurs? What's the new metric or alert?
- Disclosure. If customer-affecting, who needs to be told and how? If compliance-affecting, who needs to know?
Blameless framing matters even more for AI failures. The agent didn't "decide" to do the wrong thing the way a human might have; the agent followed its instructions and tools. If the result was wrong, the system was wrong — the CLAUDE.md, the tools, the guardrails, the supervision rhythm. Fix the system; don't blame the agent. (The agent doesn't care, but blaming the agent leads to blaming the operator, which kills the muscle of reporting failures.)
Failure-rate benchmarks per role
Anonymized "healthy" rates from operators we work with at steady state:
| Role | Healthy success rate | Healthy escalation rate | Hard-failure rate |
|---|---|---|---|
| AP clerk (invoice processing) | 94-98% | 2-4% | <1% |
| Paralegal (NDA review / case research) | 88-94% | 3-7% | <2% |
| Research analyst (web research) | 90-96% | 2-5% | <3% |
| QA tester (browser flows) | 92-97% | 1-3% | <2% |
| Code reviewer | 85-92% | 5-10% | <3% |
| Customer-support tier-1 | 70-85% | 15-30% | <1% |
| Practice manager (eligibility / PA) | 90-95% | 3-6% | <1% |
| Always-on monitoring | 99%+ | varies | <0.1% |
Note customer-support tier-1 has higher escalation rates by design — the agent's job is partly to triage, and triaging means escalating the harder cases. Different work, different bar.
Monitoring failures: what dashboards and alerts to build
For every agent fleet:
- Per-agent failure rate. Rolling 7-day; alert when 2× baseline.
- Per-agent escalation rate. Alert when drops to zero (suspicious) or doubles (something's wrong).
- Per-agent cost-per-task. Alert at 2× baseline.
- DLQ depth. Should be near-zero; alert above 10.
- Time-to-completion p95. Alert when 3× baseline.
- Hard-failure rate. Alert at any non-zero hard-failure during business hours.
- Cross-agent failure correlation. If 5+ agents fail in the same 5-minute window with the same error, that's a downstream issue. Alert.
The platform's monitoring view rolls these up into one dashboard. Configure once, watch over time.
Compliance considerations for failures
Every regulated industry has expectations about failure handling:
- SOC2: incident response procedure documented; post-mortems on file; remediation tracked.
- HIPAA: any failure that may have exposed PHI must be evaluated; reportable if breach criteria met.
- SOX (financial): failures affecting financial reporting trigger CFO notification; remediation evidence retained 7 years.
- GDPR: failures that expose personal data may trigger 72-hour DPA notification.
- Industry-specific (banking, healthcare, legal): varies; check yours.
The platform's audit log + your post-mortem records together form the compliance evidence trail. Don't treat AI agent failures as a separate process from your existing incident framework — they fit into the same shape.
Frequently asked questions
Why do AI agents fail?
Five categories: hallucination, environment, rate limit, ambiguous task, infinite loop. Each has a different recovery pattern. Misdiagnosing the category is the most common operator mistake.
Should I retry a failed AI agent task?
Depends on the failure category. Environment and rate-limit: retry with exponential backoff and jitter, max 3 attempts. Hallucination and infinite-loop: do NOT retry — fix CLAUDE.md or tools first. Ambiguous task: escalate to a human.
How do I prevent an AI agent from a runaway cost spiral?
Three guardrails: per-task cost cap, per-month budget hard-stop, loop detector. All three configurable in the dashboard. Leave them on.
How fast should I respond to an alert?
Hard failures: within an hour during business hours. Cost spikes: real-time. Quality flags: within a day. Anomaly alerts: 48 hours. Calibrate so alerts feel meaningful, not noisy.
How do I tell hallucination from environment failure?
Hallucination is confident-and-wrong (the agent thinks it succeeded). Environment is "I tried but couldn't" (explicit error). The dashboard's audit log marks them differently.
Should the agent ever auto-recover without telling me?
For environment retries: yes, up to N attempts. After that, ping. For anything else: no.
What's the right number of failed runs per week?
Depends on volume and task type. Rule of thumb: 3-5% failure + escalation rate is healthy. Lower means the agent is pushing through ambiguity (suspicious). Higher means CLAUDE.md or tools need work.
Can the agent learn from its own failures?
Sort of. Some agents (Claude Code, Devin) re-read past run logs. The durable learning is when you, the operator, update CLAUDE.md based on what failed. Self-learning is unreliable; written rules persist.
What if the agent fails silently?
Silent failure is the worst kind. Defenses: heartbeats, expected-volume alerts, end-to-end probes, audit-log queries. If the agent never posts, never logs, never errors, monitoring should catch it.
How do I do a post-mortem when an AI agent caused an incident?
Same shape as a human post-mortem: timeline, root cause, contributing factors, what changed. Add a "CLAUDE.md update" section showing the specific rule added. Blameless framing applies.
Do AI agent failures count against my SLA with customers?
Yes — if the agent's role is in the SLA boundary. Treat it like any other production system. Most B2B contracts in 2026 don't distinguish AI-caused vs human-caused failures.
Should I switch to a smarter model when the agent fails?
Usually not. 80% of the time the fix is in CLAUDE.md or tools. Switching costs 3-5× more. Tighten the prompt before paying for compute.
What if the agent fails on Monday but works on Friday?
Almost always an environment failure that depends on day-of-week. Common causes: weekend-only batch jobs that Monday's run depends on; vendor portals with maintenance schedules. Audit log shows what the agent saw.
How do I detect that an agent is silently producing wrong output?
Three controls: downstream validation, sample-based human spot-checks, consistency checks (today's vs last week's). The first is automatic; the second and third you set up.
What's a healthy failure rate for an AI agent fleet?
By role: AP clerks 2-4%; paralegals 3-7%; research analysts 2-5%; QA testers 1-3%; customer support tier-1 15-30% (triage by design). Compare each agent to its peers in the same role.
What's next
Build a fleet that handles failure
The dashboard ships with cost caps, loop detectors, and DLQ wiring out of the box.
Open Dashboard