AI Systems Reference/Reliability & Safety

Failure Modes & Degradation

Model timeouts, rate limits, retrieval misses, and tool failures — degradation ladders that preserve core product value without silent garbage.

4/5Overview: 35m

LLM-specific failure modes

FailureSymptomUser impact
TimeoutPartial stream, 504Broken UX, duplicate retries
Rate limit429 burstFeature unavailable
HallucinationConfident wrong answerTrust damage, liability
Retrieval missAnswer without groundingFabricated citations
Tool failureSide effect partialData inconsistency
Policy blockEmpty or generic refusalFrustration if over-tuned

Traditional circuit breakers (Distributed Systems) apply to vendor APIs — open circuit → degradation ladder, not infinite retry.

Degradation ladders

Define explicit rungs before incident:

Rung 0: Full AI (retrieve + frontier model) Rung 1: Smaller/faster model (quality ↓, latency ↓) Rung 2: Cached / templated responses for FAQ intents Rung 3: Non-AI fallback (search results, static help) Rung 4: Graceful "temporarily unavailable"

Each rung needs:

  • Trigger (latency SLO breach, error rate, cost cap)
  • User-visible copy (honest, not "an error occurred")
  • Metric (degradation_level on traces)

Google SRE overload handling: shed load ** deliberately**, don't serve garbage slowly.

Bulkheads

Isolate failure domains:

  • Separate rate-limit pools per feature/tenant
  • Dedicated model capacity for payment-critical flows
  • Retrieval timeout independent of generation timeout

One viral feature shouldn't exhaust tokens for core product.

Retry discipline

Call typeRetry?
Read-only completionYes, with backoff + idempotency key
Tool with side effectsNo blind retry — use idempotent tool design
StreamingRetry only if no bytes sent

Retry storms during vendor outage make it worse — coordinate with global circuit breaker.

Handling wrong answers

You can't circuit-break hallucinations. Mitigations:

  • Confidence thresholds → "I'm not sure"
  • Citation-required mode — show sources or refuse
  • User feedback loop → eval regression

Quality incidents are SLO violations — treat like latency incidents.

Chaos and game days

Test:

  • Vendor 100% 503 for 10 minutes
  • Retrieval index empty
  • 10× latency injection on model
  • Policy service down

Verify ladder activates and on-call runbook matches reality.

Interview framing

"Model API is down — what happens?"

  1. Circuit opens after N failures
  2. Serve rung 3 fallback within 1s
  3. Alert on-call; status page if user-facing
  4. Post-incident: did we retry into bankruptcy?

Senior signal: Mention duplicate submission — users double-click send; idempotency keys prevent double charges on tool calls.

Link forward

Evaluation & Quality measures whether degradation rungs still meet minimum quality bars.

Further Reading

Hands-On Tasks (Optional)

Design drills and architecture sketches — gateway SLOs, eval gates, rollout plans. Assumes AI Engineering fundamentals are already in place.

  • Define a 4-rung degradation ladder

    For a search-with-AI feature: full LLM answer → cached snippet → keyword results only → static fallback message. Specify triggers, user-visible copy, and metrics per rung.

    20m