Inferensys

Prompt

Circuit Breaker Design Review Prompt Template

A practical prompt playbook for SREs and backend engineers reviewing circuit breaker configurations. Produces a structured assessment of failure thresholds, timeout windows, half-open state behavior, and fallback actions.
Legal team reviewing EU AI Act compliance documents on laptop in modern office, coffee cups and papers on table, casual meeting.
PROMPT PLAYBOOK

When to Use This Prompt

Defines the specific job-to-be-done, the ideal user, and the boundaries for applying the Circuit Breaker Design Review Prompt Template.

This prompt is for SREs and backend engineers who need a structured, pre-production review of a circuit breaker configuration. The job-to-be-done is to take a raw specification—including failure thresholds, timeout windows, state transition logic, and fallback actions—and produce a systematic assessment that identifies misconfigured thresholds, missing failure modes, unsafe recovery paths, and gaps in fallback coverage. The ideal user is someone conducting a design review, a pull request review, or a pre-release resilience audit who needs to move beyond intuition and check a configuration against known failure patterns before it reaches production.

Use this prompt when you have a concrete circuit breaker specification to evaluate. The input should include explicit values for error threshold, timeout duration, half-open state behavior, and the fallback mechanism. The prompt is designed to reason about state machine transitions, resource exhaustion risks, and downstream impact. It is not a general resilience advisor. Do not use this prompt for runtime incident diagnosis, where you are reverse-engineering behavior from production logs, or for reviewing retry policies, bulkheads, or rate limiters in isolation—those require separate, focused prompts with different evaluation criteria. Using this prompt for a component that is not a circuit breaker will produce a misleading assessment.

Before running this prompt, gather the circuit breaker specification, the service's error budget or SLO context, and any known upstream or downstream dependencies. The prompt works best when the reviewer can provide concrete numbers, not vague descriptions. After receiving the assessment, treat high-severity findings—such as a missing fallback for an open circuit or a recovery path that can cause a thundering herd—as blocking issues that require a configuration change before deployment. The next step is to apply the recommended changes and re-run the review, not to deploy with acknowledged risks.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Circuit Breaker Design Review Prompt Template delivers value and where it introduces risk. Use these cards to decide if this prompt fits your current review workflow.

01

Good Fit: Pre-Implementation Design Review

Use when: Reviewing circuit breaker configurations in design documents or RFCs before code is written. Guardrail: The prompt excels at static analysis of thresholds, windows, and state transitions against documented requirements. Pair with architecture diagrams for best results.

02

Good Fit: Production Configuration Audit

Use when: Auditing existing circuit breaker configurations across multiple services for consistency and risk. Guardrail: Feed the prompt your actual configuration files or infrastructure-as-code definitions. It will flag threshold mismatches, missing half-open states, and incomplete fallback chains.

03

Bad Fit: Runtime Behavior Analysis

Avoid when: You need to analyze actual production circuit breaker telemetry, trip events, or latency patterns. Guardrail: This prompt reviews design intent, not runtime data. Use observability tools and time-series analysis for production behavior. The prompt cannot see metrics dashboards.

04

Bad Fit: Single-Service Isolation Review

Avoid when: Reviewing a circuit breaker in complete isolation without upstream callers or downstream dependencies. Guardrail: Circuit breaker value emerges from system interactions. Provide the full call chain context, including client retry policies and downstream timeout configurations, or the review will miss cascading failure risks.

05

Required Input: Failure Mode Inventory

Risk: Without a list of expected failure modes, the prompt cannot validate whether the circuit breaker covers the right scenarios. Guardrail: Always provide a failure mode inventory or ask the prompt to generate one as a first pass. Missing failure modes are the most common production gap.

06

Operational Risk: Overconfident Threshold Recommendations

Risk: The prompt may suggest specific threshold values without production traffic data to validate them. Guardrail: Treat threshold suggestions as starting points for load testing, not final configurations. Validate all numeric thresholds against p95/p99 latency data and throughput requirements before deployment.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A copy-ready prompt that instructs the model to produce a structured JSON assessment of a circuit breaker design.

The prompt below is the core instruction set for the Circuit Breaker Design Review. It is designed to be copied directly into your AI harness, notebook, or evaluation runner. The model is instructed to act as a principal reliability architect and to produce a strictly structured JSON output. Every section of the output is tied to a specific resilience concern, making the review auditable and actionable.

text
You are a principal reliability architect reviewing a circuit breaker design for a distributed system. Your task is to produce a structured JSON assessment of the provided circuit breaker specification. You must evaluate the design against standard resilience patterns, identify failure modes, and recommend concrete improvements.

## INPUT
[SPECIFICATION]

## CONSTRAINTS
- Base your analysis strictly on the provided specification and standard distributed systems resilience patterns.
- Do not invent details not present in the specification. If information is missing, flag it as a gap.
- Your output must be a single, valid JSON object conforming to the output schema.
- For any high-severity finding, you must propose a concrete mitigation.

## OUTPUT_SCHEMA
{
  "summary": "string (A one-paragraph executive summary of the design's overall resilience posture.)",
  "state_machine_analysis": {
    "closed_state": "string (Assessment of failure threshold configuration and error counting logic.)",
    "open_state": "string (Assessment of the timeout window and behavior when the circuit is open.)",
    "half_open_state": "string (Assessment of the probing strategy, request allowance, and transition logic back to closed or open.)"
  },
  "failure_mode_assessment": [
    {
      "failure_mode": "string (Description of a potential failure scenario.)",
      "severity": "string (One of: LOW, MEDIUM, HIGH, CRITICAL)",
      "likelihood": "string (One of: RARE, UNLIKELY, POSSIBLE, LIKELY)",
      "current_mitigation": "string (How the current design attempts to handle this, or 'None' if missing.)",
      "recommendation": "string (A concrete action to eliminate or reduce the risk.)"
    }
  ],
  "fallback_action_review": {
    "current_fallback": "string (Description of the defined fallback behavior when the circuit is open.)",
    "risks": ["string (List of risks associated with this fallback, e.g., stale data, degraded UX, cascading load.)"],
    "alternatives": ["string (List of alternative fallback strategies to consider.)"]
  },
  "configuration_recommendations": [
    {
      "parameter": "string (The configuration parameter, e.g., failure_threshold, timeout_window, half_open_max_requests.)",
      "current_value": "string (The value in the provided specification, or 'Not Specified'.)",
      "recommended_value": "string (A specific, justified recommendation.)",
      "rationale": "string (Why this change improves resilience.)"
    }
  ],
  "missing_information": ["string (List of critical details missing from the specification that prevent a complete review.)"],
  "overall_risk_score": "string (One of: LOW, MEDIUM, HIGH, CRITICAL)"
}

To adapt this template, replace the [SPECIFICATION] placeholder with your raw design notes, configuration files, or architecture decision record text. The prompt is self-contained and does not require external tools or retrieval, making it suitable for direct use in a chat interface or as a single-turn task in an automated pipeline. For high-risk production systems, always route the final JSON output to a human reviewer for approval before implementing any recommended configuration changes.

IMPLEMENTATION TABLE

Prompt Variables

Each placeholder must be replaced with concrete values. Missing or vague inputs produce unreliable assessments.

PlaceholderPurposeExampleValidation Notes

[CIRCUIT_BREAKER_CONFIG]

Full configuration block including thresholds, timeouts, and state machine settings

{"failureThreshold": 5, "successThreshold": 3, "timeoutMs": 30000, "halfOpenMaxRequests": 2, "slidingWindowSize": 10}

Must be valid JSON. Reject if missing failureThreshold, timeoutMs, or halfOpenMaxRequests fields. Schema check required.

[SERVICE_NAME]

Identifier for the protected service or endpoint

payment-gateway-primary

Must be a non-empty string matching service registry naming convention. Reject if null or empty.

[DEPENDENCY_GRAPH]

Upstream and downstream service relationships affected by circuit state changes

Upstream: order-service. Downstream: fraud-detection, ledger-writer

Must list at least one upstream caller. Null allowed if no downstream dependencies exist. Validate each service name exists in registry.

[FALLBACK_ACTIONS]

Defined fallback behavior when circuit is open

Return cached balance from last 5 minutes; if cache miss, return HTTP 503 with retry-after header

Must specify at least one concrete action. Reject if fallback is undefined or described as 'do nothing' without explicit justification.

[SLI_TARGETS]

Service level indicators and targets the circuit breaker must protect

p99 latency < 200ms, error rate < 1%, availability > 99.9%

Must include at least one quantifiable target with threshold. Reject if targets are qualitative only. Parse check for numeric thresholds.

[MONITORING_HOOKS]

Observability integration points for circuit state transitions

OpenTelemetry span events on state change, Prometheus counter metrics, PagerDuty alert on open state > 60s

Must specify at least one monitoring mechanism. Validate hook names against known observability platform schemas.

[RECOVERY_TEST_SCENARIOS]

Specific failure scenarios to validate circuit breaker behavior

  1. Downstream 5 consecutive 500 errors. 2. Downstream slow responses exceeding timeout. 3. Half-open state with mixed success/failure

Must include at least 3 distinct scenarios covering open, half-open, and closed state transitions. Reject if scenarios are duplicates or untestable.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Circuit Breaker Design Review prompt into an application or review workflow.

The Circuit Breaker Design Review prompt is designed to be integrated into a pre-production design review pipeline, not as a one-off chat interaction. The prompt expects a structured [DESIGN_SPEC] input containing the circuit breaker configuration, the service it protects, its dependencies, and the expected failure modes. Before calling the model, the application harness should validate that the input spec includes required fields: failure threshold, timeout window, half-open behavior, and fallback action. If any field is missing, the harness should return a validation error to the user rather than sending an incomplete spec to the model, which would produce an unreliable review.

For production integration, wrap the prompt in a function that accepts a validated design spec object and returns a structured assessment. Use a model with strong JSON mode or structured output support (e.g., GPT-4o with response_format or Claude with tool use) and enforce the [OUTPUT_SCHEMA] defined in the prompt template. The output should include a severity field (PASS, WARN, FAIL), a list of findings with category and recommendation, and a recovery_path_review object. Implement a post-processing validator that checks the output schema before surfacing results to the user. If the model returns a finding without a corresponding recommendation, or if the severity is FAIL but the findings list is empty, flag the response for human review rather than displaying it as a completed assessment.

Circuit breaker misconfiguration can cause cascading production failures, so this workflow should include a human approval gate for any FAIL severity result. Log every review to an audit table with the design spec hash, model version, timestamp, and reviewer identity. For teams running multiple reviews, cache common failure patterns in a vector store and use retrieval-augmented generation (RAG) to inject relevant past incidents into the [CONTEXT] field before each review. This prevents the model from missing failure modes that have already caused outages in your specific environment. Avoid running this prompt against live production configurations without a staging review step—the prompt assesses design intent, not runtime state, and conflating the two produces false confidence.

IMPLEMENTATION TABLE

Expected Output Contract

The model must return a JSON object matching this structure. Validate these fields before accepting the output.

Field or ElementType or FormatRequiredValidation Rule

assessment_summary

string

Non-empty string; length between 50 and 500 characters; must not be a generic placeholder

circuit_breaker_config

object

Must contain failure_threshold, timeout_window_ms, half_open_max_requests, and sliding_window_size fields

circuit_breaker_config.failure_threshold

integer

Integer >= 1; must match the threshold described in [INPUT_CONFIG]

circuit_breaker_config.timeout_window_ms

integer

Integer >= 100; must be parseable as milliseconds

circuit_breaker_config.half_open_max_requests

integer

Integer >= 1; must be less than or equal to failure_threshold

failure_modes_identified

array

Array of strings; minimum 1 item; each string must be non-empty and not duplicated

fallback_actions

array

Array of objects; each object must contain action_type (string) and description (string)

recovery_path_assessment

object

Must contain half_open_behavior (string), reset_conditions (array of strings), and risk_of_flapping (boolean)

PRACTICAL GUARDRAILS

Common Failure Modes

Circuit breaker prompts fail in predictable ways. These cards cover the most common failure modes when using an LLM to review circuit breaker designs, along with practical guardrails to prevent them.

01

Missing Failure Mode Enumeration

What to watch: The model accepts the documented failure modes at face value and fails to identify unlisted scenarios such as partial network partitions, slow-responding dependencies that never fully fail, or resource exhaustion during half-open state. Guardrail: Include a mandatory step in the prompt that requires the model to generate at least three failure modes not explicitly mentioned in the input configuration before proceeding to the assessment.

02

Threshold Value Hallucination

What to watch: The model invents specific numeric recommendations for failure thresholds, timeout windows, or retry budgets without grounding them in the provided system context or traffic patterns. Guardrail: Constrain the prompt to flag threshold concerns with qualitative reasoning only, and require an explicit [EVIDENCE_GAP] marker when the input lacks data needed for a numeric recommendation.

03

Half-Open State Oversimplification

What to watch: The review treats half-open state as a simple binary transition and ignores critical design questions such as probe request selection, concurrent request limits during probing, and fallback behavior if probes fail again. Guardrail: Add a dedicated half-open state checklist to the prompt template that forces the model to address probe strategy, concurrency, and probe failure escalation separately.

04

Fallback Action Completeness Gap

What to watch: The model validates that a fallback exists but does not check whether the fallback itself can fail, whether it respects the same SLOs, or whether it creates a cascading dependency on another fragile component. Guardrail: Require the prompt to trace each fallback action through one additional failure layer and flag any fallback that lacks its own degradation path.

05

Cross-Service Interaction Blindness

What to watch: The review evaluates each circuit breaker in isolation and misses systemic risks such as synchronized trip events across multiple breakers, retry amplification from upstream services, or thundering herd recovery when multiple breakers reset simultaneously. Guardrail: Include a cross-service dependency section in the prompt that asks the model to identify at least two multi-breaker interaction scenarios and assess their combined blast radius.

06

Configuration Drift from Implementation Reality

What to watch: The model reviews the documented configuration without questioning whether the actual deployed configuration matches, leading to a clean review of a design that does not reflect production. Guardrail: Add a pre-review instruction that requires the model to list assumptions about deployment fidelity and flag any configuration element that should be verified against runtime state before the review is considered complete.

IMPLEMENTATION TABLE

Evaluation Rubric

Run these checks against a golden dataset of known circuit breaker configurations with documented issues. Each row validates a specific failure mode or design gap.

CriterionPass StandardFailure SignalTest Method

Failure threshold accuracy

Identified threshold matches documented value within ±1 request

Output threshold differs from golden config by more than 1 or is missing

Exact match comparison against golden dataset [FAILURE_THRESHOLD] field

Timeout window detection

Timeout window value extracted and matches golden config in milliseconds

Wrong unit interpretation (seconds vs ms) or value off by factor of 10+

Parse output for [TIMEOUT_WINDOW_MS] and compare to golden expected value

Half-open state behavior description

Describes max requests in half-open, success threshold to close, and trial duration

Omits any of the three half-open parameters or describes incorrect state transition

LLM judge pairwise comparison against golden [HALF_OPEN_BEHAVIOR] reference description

Fallback action completeness

Fallback action includes response type, timeout, and downstream impact note

Fallback missing response payload shape, timeout, or cascading effect on callers

Schema check: output must contain [FALLBACK_RESPONSE_TYPE], [FALLBACK_TIMEOUT], [DOWNSTREAM_IMPACT]

Missing failure mode flagging

Flags at least the known injected failure mode from the golden dataset

Does not flag the pre-seeded failure mode that golden config documents as missing

Assert [MISSING_FAILURE_MODES] array contains the golden [KNOWN_GAP] identifier

Recovery path misconfiguration detection

Identifies incorrect reset timeout or missing retry-after header propagation

Reports recovery path as correct when golden config has documented misconfiguration

Boolean check: [RECOVERY_MISCONFIG_DETECTED] must equal true for poisoned samples

Circuit state transition diagram accuracy

Describes closed→open→half-open→closed cycle with correct trigger conditions

Reverses transition direction, omits a state, or uses wrong trigger for any transition

State machine validation: parse [STATE_TRANSITIONS] array and diff against golden expected graph

Configuration consistency cross-check

No contradiction between threshold count, window size, and half-open max requests

Threshold count exceeds half-open max requests or window shorter than single request timeout

Rule-based validator: assert [FAILURE_THRESHOLD] <= [HALF_OPEN_MAX_REQUESTS] and [TIMEOUT_WINDOW_MS] > [REQUEST_TIMEOUT_MS]

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base prompt with a frontier model (GPT-4o, Claude 3.5 Sonnet). Remove the [OUTPUT_SCHEMA] constraint and ask for a free-text assessment first. Focus on getting the right failure modes surfaced before locking down format.

Watch for

  • Missing half-open state analysis
  • Overly optimistic fallback assumptions
  • No distinction between transient and persistent failures
Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.