Stage 4 · Assumes you can code · Harnesses & Orchestration

Reliability: Timeouts, Retries & Fallbacks

Production agents fail at the edges: slow tools, duplicate writes, and missing degrade paths.

Guardrails stop unsafe actions. Reliability is what you do when a legitimate dependency misbehaves: timeouts, retries, circuit breakers, and fallbacks — including "don't use the LLM for this part."

A useful split: read vs write. Retrying get_weather after a 500 is usually right (with backoff and jitter). Retrying book_flight or charge_card without an idempotency key is how you buy eight tickets. 4xx validation errors should not retry at all.

When a tool or model is sick, fail closed (refuse the irreversible step) or degrade (cached data, smaller model, template, human queue) — don't hammer the dependency until the bill or the vendor bans you.

The Weather API Is Down
  1. Weather API returns 500
  2. Retry immediately × 8
  3. Book tool fires on each "success"
  4. 8 tickets purchased
Retries without idempotency turn a blip into duplicate side effects. Status 500 is retryable; "book" is not unless the provider de-dupes on a key.

Same 500 from weather: naive retries book repeatedly; a solid harness backs off and skips the write.

All lessons in Stage 4: Builders (optional)