The Circuit Breaker Pattern: Stopping Cascading Failures Before They Take Down Your System (2026)


The conventional circuit breaker was designed for a world where one service called one downstream and the failure modes were mostly availability — the dependency was up or down. AI agents inhabit a different world: an orchestrator that fans out to a heterogeneous set of tools, multiple LLM providers, and internal capabilities, each with its own failure profile, latency distribution, cost per call, and consequence on the agent's task. A single per-host breaker treats them all the same and is wrong almost everywhere. The agent-level circuit breaker pattern replaces the conventional one with a hierarchy of breakers — per-tool, per-provider, per-capability — each tuned to the failure mode it is meant to protect against. This article walks through the hierarchy in production: which dimensions need their own breakers, how thresholds should differ, what fallback semantics make sense at each layer, how to compose breakers with retries and timeouts without amplifying load, and the operational dashboards that make agent-level breakers debuggable.
The most consequential string in any production AI system is the prompt template. It controls behaviour, tone, safety, accuracy, cost, and latency. A small change can move quality up or down by ten per cent; a thoughtless edit can introduce regressions that take weeks to detect. Yet in the early demo era, prompts were typically pasted into application code as multi-line string literals, edited directly, with no review, no version history, no rollback story. The versioned prompt templates pattern fixes this by treating prompts as first-class system assets — stored in a versioned repository, referenced by explicit version IDs, deployed through review-and-rollout discipline, logged in the audit trail. This article covers immutability of published versions, implementation patterns (file-based, database-backed, managed platforms, hybrid), composition with classification-first and prompt routing, anti-patterns, configuration values, and the operational discipline of A/B testing and quality-gated promotion.
The most common AI architecture mistake of 2024 and 2025 was sending the user's raw input directly into the language model and hoping the prompt was clever enough to handle every case. The mistake produced predictable failures: medical chatbots that gave dosing advice, support bots jailbroken into discussing competitors, internal copilots that exfiltrated data because the prompt did not know what kind of question it was answering. Classification-first inserts a small fast classifier in front of the LLM whose only job is to determine intent and route the request accordingly. This article covers the foundational role of intent classification, implementation patterns (fine-tuned small models, embedding routing, LLM-as-classifier, hybrid), composition with prompt routing and per-category guardrails, anti-patterns, configuration values, and operational discipline of monitoring accuracy and drift over time.
Real microservices architectures contain SOAP services that nobody dares rewrite, partner integrations in protocols nobody picks anymore, and external APIs whose payload shapes resemble nothing the internal domain model uses. The adapter pattern places dedicated translation components between systems that need to talk but speak incompatible protocols, formats, or semantics. This guide covers the canonical use cases (legacy bridging, schema translation, vendor abstraction), the variants (inbound, outbound, anti-corruption layer), production implementation patterns including a worked Stripe webhook adapter, and the failure modes that turn adapters from useful seams into the most fragile parts of the system.
Advertise and partner
Reach engineering leaders and CTOs reading about AI, mobile and cloud architecture.
Sponsored mentions and co-authored articles or technical deep-dives. Relevant products only, always disclosed.