Bourne Forge AI
← Notes
ReliabilityAI

Designing AI Systems for Failure

Retries, fallbacks, circuit breakers and graceful degradation for model-dependent applications.

By Mark Bourne

Designing AI Systems for Failure: a five-step workflow diagram with step 3 timing out, and the line 'Retry, fallback, preserve work. Failure is inevitable. The response is architectural.'

Introduction

Defining Reliability for AI Systems argued that reliability has to be measured before it can be engineered.

This article is about the engineering.

Every model-dependent application will, eventually, have a bad day: a provider outage, a rate limit, a malformed tool response, a retrieval index returning nothing useful. The question that determines whether the application is production-grade is not whether this happens—it will—but what happens next.

A system that has never been asked “what happens when this fails?” will answer that question for you, at the worst possible time.

This piece works through the common ways AI workflows fail, and the patterns—retries, circuit breakers, fallbacks, degraded modes, human escalation—that keep a failure from becoming an outage.

The Internet Lesson: Assume Failure, Design for Recovery

Networks fail constantly.

Routers reboot. Links drop. Power disappears. Good network architecture never assumed otherwise—it assumed failure and built recovery paths around that assumption: redundant routes, automatic failover, graceful degradation under load.

AI workflows fail just as often, for reasons that are often outside your control: a provider having a bad night, a rate limit hit during a traffic spike, a tool returning something the parser didn't expect.

The architecture question isn't how to prevent every failure. It's what the system does in the ninety seconds after one occurs.

Infographic panel comparing network architecture (redundant routes, automatic failover) with AI workflow architecture (model, retrieval and tools each needing their own recovery path), asking what the system does in the ninety seconds after failure.

A Realistic Failure Scenario

An agent is midway through a five-step workflow: retrieve context, draft a response, call a tool to check inventory, revise the draft, send.

The inventory tool times out. With no failure handling, the entire workflow throws an exception. The draft—already reviewed and mostly correct—is discarded. The user sees a generic error and has to start over from nothing.

None of that was necessary. The failure was in one step out of five. A well-designed system would retry the tool call once, fall back to a cached inventory snapshot if the retry also failed, and preserve the draft either way.

The difference between an annoyance and an outage is usually a few lines of failure handling around one step.

Infographic panel contrasting a five-step workflow without failure handling, where a tool timeout discards the draft and forces a restart, against the same workflow with designed recovery: retry once, fall back to cache, keep completed work.

The Ways AI Workflows Actually Fail

Most production incidents trace back to a small set of recurring causes:

  • Model or API outage
  • Rate limits and exhausted quotas
  • Invalid or malformed tool responses
  • Context retrieval returning nothing, or the wrong thing
  • Timeouts on slow reasoning or long tool calls
  • Repeated low-confidence or contradictory output

Each of these needs a specific, tested response—not a single generic try/catch around the whole workflow.

Infographic panel listing six recurring AI workflow failure modes with detection and response pairs: model/API outage, rate limit or quota, malformed tool output, retrieval failure, slow reasoning or tool, and low-confidence output.

Retry Strategies (and Retry Storms)

Retrying a failed call is the simplest recovery pattern, and the easiest one to get wrong.

Done well, a retry policy includes:

  • A small, capped number of attempts
  • Exponential backoff between attempts
  • Jitter, so many clients don't retry in lockstep
  • A distinction between retryable errors (timeouts) and non-retryable ones (bad request)

Done badly, retries turn a brief provider hiccup into a self-inflicted denial-of-service: every failed request immediately retries, multiplying load on a system that was already struggling. This is a retry storm, and it has taken down more services than the original outage ever would have.

Retries buy time. They are not a strategy on their own.

Infographic panel showing a healthy retry policy (call, fail, backoff, retry, result, with jitter and retryable-errors-only guardrails) beside a retry storm, where uncapped retries pile more load onto an already-failing provider.

Circuit Breakers

A circuit breaker stops calling a dependency once it has failed enough times in a row, instead of letting every request queue up behind a service that isn't responding.

After a cooling-off period, it allows a small number of test requests through. If they succeed, normal traffic resumes. If they don't, it stays open and keeps failing fast.

For AI workflows, this applies to model providers, retrieval services, and any tool call—anywhere a slow, failing dependency could otherwise back up an entire queue of user requests.

Infographic panel of the circuit breaker state machine: closed (traffic flows normally), open (calls blocked during cooldown), and half-open (small test traffic decides whether to recover), contrasted with the queue collapse that happens without one.

Fallback Models and Reduced-Capability Modes

When the primary model or provider is unavailable, the workflow has three real options: fail outright, fall back to an alternative, or continue in a reduced-capability mode.

  • Fallback model: a different provider or a smaller model steps in, possibly with a quality trade-off the user is told about
  • Reduced-capability mode: skip the optional steps (tone polishing, tool-augmented enrichment) and deliver the core result
  • Cached or templated response: for well-understood requests, serve a previously generated or templated answer instead of a fresh one

The failure mode to avoid is silent substitution—serving a materially different or lower-quality answer without telling the user anything changed.

Infographic panel showing a recovery router sending an unavailable primary model to one of three options: fallback model, reduced mode, or cache/template, each labelled 'user is told what changed', with a warning against silent substitution.

Human Escalation

Some failures shouldn't be retried, faked around, or hidden behind a degraded mode. They should go to a person.

That requires the workflow to recognise, in advance, which situations warrant escalation:

  • Confidence stays below threshold after retries
  • The action is high-risk (financial, legal, irreversible)
  • Context retrieval comes back empty for a question that clearly has an answer
  • The user has already corrected the system twice in this session

An escalation path that only exists in theory is not an escalation path. It needs an owner, a queue, and a response-time expectation, the same as any other on-call rotation.

Preserving Partially Completed Work

Multi-step workflows fail partway through far more often than they fail at step one.

When step four of five fails, the output of steps one through three is usually still valid and often still valuable. Discarding it—forcing a full restart—wastes work the user has often already reviewed and approved.

Checkpoint state between steps. Resume from the last good step, not from zero.

Infographic panel listing when to escalate to a human (low confidence after retries, high-risk actions, empty retrieval, repeated user corrections) beside a checkpointed five-step workflow that resumes from the failed step rather than from the start.

A Failure-Mode Matrix

Mapping failures to responses in advance turns incident response from improvisation into execution:

FailureDetectionAutomated responseEscalation
Model or API outageHealth checks, request timeoutsSwitch to fallback model or providerPage on-call if fallback also fails
Rate limit / quota exhausted429 responses, quota telemetryQueue, throttle, or route to secondary providerNotify owner if queue exceeds SLA
Invalid tool responseSchema validation on tool outputRetry once with corrected instructions, else abort stepLog for review; escalate if step is critical path
Context retrieval failureEmpty or low-confidence retrieval resultsFall back to broader search or cached contextFlag for human review before acting on thin context
Repeated low-confidence outputConfidence score below threshold, N timesSwitch to reduced-capability modeRoute to human queue
Infographic version of the failure-mode matrix mapping five failure types to detection, automated response and escalation, alongside four anti-patterns that only look like resilience: one try/catch, uncapped retries, silent fallback, and untested escalation.

Trade-offs and Anti-Patterns

  • Wrapping the entire workflow in one try/catch instead of handling each step's failure specifically
  • Retrying without backoff or a cap, risking retry storms
  • Falling back silently, with no signal to the user or the logs that quality changed
  • Building escalation paths that are never tested until the day they're needed
  • Over-engineering recovery for low-stakes workflows where a simple error message is genuinely fine

Not every workflow needs circuit breakers and fallback models. The level of failure handling should match the cost of failure—a drafting tool and a payment approval flow do not need the same safety net.

Final Thoughts

Internet engineers stopped asking whether a link would fail and started asking what the network would do about it. That shift—from prevention to designed recovery—is what separates a demo from a system people can depend on.

Failure is not the incident.

An undesigned response to failure is.

A Practical Checklist

Before calling a workflow production-ready, work through these questions:

  1. 1Does every external call (model, tool, retrieval) have a timeout and a defined fallback?
  2. 2Is there a retry policy with backoff, and a cap that prevents retry storms?
  3. 3Is there a circuit breaker that stops calling a provider that's already failing?
  4. 4Is there a reduced-capability mode, or does any failure take the whole workflow down?
  5. 5Is partially completed work saved before a step that might fail?
  6. 6Does the user get a clear, honest message when the system degrades?
  7. 7Is there a defined path to a human when automation can't recover?
  8. 8Have you tested what happens when the primary model is simply unavailable?
Infographic panel: the failure-design checklist, summarising all eight production-readiness questions with the line 'Failure is not the incident. An undesigned response to failure is.'

About This Series

This article is part of the AI Infrastructure & Architecture series on Bourne Forge AI. It follows Defining Reliability for AI Systems by turning reliability targets into concrete failure-handling patterns, ahead of the next article on observability for non-deterministic systems.

More from the Notes

Short technical notes and observations, written up as experiments produce something worth documenting.

Back to Notes

Was this useful?

Published