Inferensys

Prompt

Retry Storm Simulation Scenario Prompt

A practical prompt playbook for using the Retry Storm Simulation Scenario Prompt in production resilience engineering workflows.
Developer doing prompt engineering on laptop, prompt variations visible on screen, casual coding session.
PROMPT PLAYBOOK

When to Use This Prompt

Defines the precise job-to-be-done, ideal user profile, required context, and explicit boundaries for the Retry Storm Simulation Scenario Prompt.

This prompt is for resilience engineers and SREs who need to design a controlled chaos experiment to test how their distributed system behaves under cascading retry amplification. The core job-to-be-done is quantifying the blast radius of a downstream latency spike before it causes a production incident. Use it when you have a multi-service architecture where at least two services are configured to retry on failure, and you need to model the multiplicative effect of those retries under degraded conditions. The ideal user has access to service-level retry configurations, client library documentation, and baseline latency metrics for the services in the call chain.

The prompt requires specific inputs to produce a valid simulation scenario: the retry policy for each service in the call path (max attempts, backoff strategy, jitter configuration), the normal and degraded latency profiles for the downstream dependency, and the expected request rate at the entry point. Without these inputs, the model will make assumptions that may not match your system's actual behavior. The prompt explicitly validates for missing idempotency assumptions—a critical safety check because non-idempotent operations under retry amplification can cause duplicate side effects that are worse than the latency degradation itself. It also predicts dead letter queue accumulation rates, which helps you size your DLQ storage and alerting thresholds before running the experiment.

Do not use this prompt for simple single-service timeout testing where no retry chain exists, or for systems where retries are disabled at every layer. It is also inappropriate for testing circuit breaker behavior in isolation—circuit breakers are a mitigation for retry storms, not the storm itself. If your goal is to validate that a circuit breaker opens correctly under load, use the Third-Party Dependency Failure Simulation Prompt instead. For systems where all retries are bounded by a single global timeout with no fan-out, the amplification factor will always be 1.0, making this prompt's complexity unnecessary. The prompt assumes you can inject latency at the downstream dependency; if you cannot safely inject latency in production or a production-like staging environment, you should first establish that capability before using this scenario.

Before running the generated scenario, validate the output against your actual service topology. The prompt asks the model to calculate an expected retry amplification factor, but this calculation depends on accurate retry configuration inputs. A common failure mode is providing the intended retry policy rather than the actual deployed configuration—check your client library defaults, service mesh settings, and any infrastructure-layer retries (like Envoy or Istio) that may add hidden retry layers. After generating the scenario, review the dead letter queue predictions against your DLQ's current depth and processing rate to ensure the experiment won't cause a DLQ backlog that outlasts the test window.

This prompt is a design tool, not an execution tool. It produces a scenario specification that you then implement in your chaos engineering platform of choice (Gremlin, Chaos Mesh, Litmus, or custom scripts). The output includes abort conditions and monitoring queries; wire these into your observability platform before starting the experiment. Always run this scenario in a controlled environment with a limited blast radius first, even if the prompt's calculations suggest the amplification is manageable. Retry storms can saturate thread pools, exhaust connection limits, and cascade into unrelated services in ways that static analysis cannot fully predict.

PRACTICAL GUARDRAILS

Use Case Fit

Where this prompt works, where it fails, and the operational preconditions required before running a retry storm simulation.

01

Good Fit: Pre-Production Resilience Testing

Use when: you have a staging or pre-production environment with realistic service topology and can inject controlled latency. Guardrail: never run retry storm simulations against production payment, booking, or write-critical paths without full isolation and rollback plans.

02

Bad Fit: Undefined Idempotency Guarantees

Avoid when: the system under test lacks idempotency keys, deduplication, or exactly-once delivery semantics. Risk: the simulation will amplify side effects and produce false-positive breakage that reflects missing application design, not infrastructure resilience.

03

Required Input: Retry Policy Inventory

What to watch: the prompt needs explicit retry configurations per service including max attempts, backoff strategy, and timeout budgets. Guardrail: validate that the provided policies match the deployed configuration; stale policy docs produce misleading amplification factors.

04

Required Input: Downstream Dependency Map

What to watch: missing fan-out dependencies cause the scenario to underestimate amplification. Guardrail: require a service dependency graph with call fan-out factors and sync-vs-async call patterns before generating the scenario.

05

Operational Risk: Dead Letter Accumulation

Risk: the simulation can flood dead letter queues and trigger storage alerts or downstream backpressure. Guardrail: pre-set DLQ retention windows, size limits, and monitoring thresholds; include DLQ drain procedures in the scenario abort conditions.

06

Operational Risk: Cascading Circuit Breaker Trips

Risk: retry amplification can trip circuit breakers across unrelated services, masking the target scenario. Guardrail: scope the simulation to a bounded blast radius with service-specific circuit breaker overrides or separate test instances.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A ready-to-use prompt that generates a complete retry storm simulation scenario, including policy configurations, backoff variations, and amplification factor calculations.

This prompt template is designed to be pasted directly into your AI harness for generating retry storm simulation scenarios. It instructs the model to produce a structured, executable scenario that resilience engineers can use to test cascading retry amplification in distributed systems. The output includes retry policy configurations, backoff strategy variations, downstream latency injection parameters, and expected retry amplification factor calculations. Replace each square-bracket placeholder with your system's specific architecture details, failure domains, and testing constraints before execution.

text
You are a resilience engineering assistant. Your task is to design a retry storm simulation scenario for a distributed system.

## System Context
- Architecture: [ARCHITECTURE_DESCRIPTION]
- Services involved: [SERVICE_NAMES_AND_ROLES]
- Communication protocol: [SYNC_ASYNC_MIX]
- Current retry policies: [EXISTING_RETRY_CONFIGS]
- Known idempotency guarantees: [IDEMPOTENCY_DETAILS]
- Dead letter queue configuration: [DLQ_CONFIG]

## Scenario Requirements
- Failure injection point: [FAILURE_TARGET_SERVICE]
- Initial failure type: [TIMEOUT_ERROR_THROTTLE]
- Simulation duration: [DURATION]
- Request rate baseline: [BASELINE_RPS]

## Output Schema
Produce a JSON object with the following structure:
{
  "scenario_name": "string",
  "failure_injection": {
    "target_service": "string",
    "failure_type": "string",
    "latency_injection_ms": number,
    "error_rate_percent": number,
    "duration_seconds": number
  },
  "retry_policy_variations": [
    {
      "policy_name": "string",
      "max_retries": number,
      "backoff_strategy": "fixed|exponential|jittered|decorrelated",
      "initial_backoff_ms": number,
      "max_backoff_ms": number,
      "timeout_ms": number
    }
  ],
  "amplification_analysis": {
    "expected_amplification_factor": number,
    "calculation_method": "string",
    "peak_retry_rate_rps": number,
    "cascading_services_affected": ["string"]
  },
  "dead_letter_predictions": {
    "expected_dlq_volume": number,
    "accumulation_rate_per_second": number,
    "dlq_capacity_breach_risk": "low|medium|high|critical"
  },
  "idempotency_gaps": [
    {
      "service": "string",
      "operation": "string",
      "risk_description": "string",
      "recommended_safeguard": "string"
    }
  ],
  "monitoring_signals": [
    {
      "metric_name": "string",
      "warning_threshold": "string",
      "critical_threshold": "string",
      "observation_point": "string"
    }
  ],
  "safe_abort_conditions": ["string"]
}

## Constraints
- Assume no idempotency unless explicitly stated in the system context.
- Flag every operation that lacks idempotency guarantees as a risk.
- Calculate amplification factor as: (initial_requests * retry_multiplier * downstream_fanout) / initial_requests.
- Include at least three distinct backoff strategy variations.
- Identify cascading services that will receive amplified retry traffic.
- Predict dead letter queue accumulation if retries exhaust.
- Define clear abort conditions to prevent test-induced production impact.

## Validation Checks
After generating the scenario, self-check for:
1. Missing idempotency assumptions for any service in the retry path.
2. Unrealistic backoff ceilings that would cause retry overlap.
3. Amplification factor that ignores downstream fan-out.
4. Absent monitoring signals for each cascading service.
5. Abort conditions that trigger too late to prevent overload.

After pasting this template, adapt the placeholders to match your specific system. The [ARCHITECTURE_DESCRIPTION] should include service dependencies and call paths. The [EXISTING_RETRY_CONFIGS] field is critical—if left empty, the model will assume no retry policies exist and the amplification analysis will be incomplete. Run the output through a JSON schema validator before feeding it into your chaos engineering or load testing tool. For high-risk production-adjacent environments, require a human resilience engineer to review the scenario's abort conditions and blast radius before execution.

IMPLEMENTATION TABLE

Prompt Variables

Inputs the prompt needs to simulate a retry storm reliably. Provide these with enough detail to avoid hallucinated configurations or missing idempotency assumptions.

PlaceholderPurposeExampleValidation Notes

[SYSTEM_ARCHITECTURE]

Describes the service topology, including message broker, queue names, and downstream dependencies involved in the retry path.

Service A publishes to Kafka topic 'orders', consumed by Service B which calls Payment API and Inventory DB.

Must include at least one producer, one consumer, and one external dependency. Parse check for component names and connection paths.

[RETRY_POLICIES]

Defines the retry configuration for each service, including max attempts, backoff strategy, and timeout per attempt.

Service B: max 5 retries, exponential backoff 1s-16s, 500ms per-request timeout.

Each policy must specify max_attempts, backoff_type (fixed, exponential, decorrelated_jitter), and per_attempt_timeout_ms. Schema check required.

[FAILURE_INJECTION_POINT]

Specifies which downstream dependency will be degraded and how latency or errors will be injected.

Payment API: inject 5s latency on 80% of requests for 120 seconds.

Must specify target component, injection type (latency, error_code, connection_refused), percentage, and duration. Null not allowed.

[IDEMPOTENCY_CONFIGURATION]

Details how each service handles duplicate requests, including idempotency key sources and TTL.

Service B uses 'X-Idempotency-Key' header from Service A; Payment API uses idempotency key with 24h TTL.

For each service, must declare idempotency_key_source or explicitly state 'none'. Missing idempotency is a critical failure signal for retry storm amplification.

[DEAD_LETTER_POLICY]

Defines what happens to messages that exhaust all retries, including DLQ name and alerting thresholds.

DLQ 'orders-dlq'; alert if > 50 messages accumulate in 5 minutes.

Must specify DLQ destination and an alert threshold. Null allowed only if explicitly stated as 'no DLQ configured'.

[OBSERVABILITY_SIGNALS]

Lists the metrics, logs, and traces that will be monitored during the simulation to measure amplification.

Metrics: retry_rate, dlq_depth, p99_latency. Logs: retry_exhausted events. Traces: full end-to-end for 1% of requests.

Must include at least one metric for retry rate and one for queue depth. Parse check for metric names and sampling rates.

[SIMULATION_DURATION]

Total time the simulation will run, including ramp-up, steady-state failure injection, and recovery observation.

600 seconds total: 60s ramp, 300s failure injection, 240s recovery observation.

Must specify total_seconds and phase breakdowns. Validate that recovery_observation is at least 2x the max backoff window.

[EXPECTED_AMPLIFICATION_FACTOR]

The predicted multiplier of total requests vs. initial requests, used as a pass/fail threshold for the simulation.

Predicted amplification factor: 3.2x (5 retries with jitter, 80% failure rate).

Must be a numeric value with calculation basis. Used as eval threshold: actual amplification within ±20% of prediction passes.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the retry storm simulation prompt into a resilience testing workflow with validation, logging, and safe execution controls.

The retry storm simulation scenario prompt is designed to be integrated into a chaos engineering or resilience testing pipeline, not used as a standalone chat interaction. The prompt expects structured inputs—retry policy configurations, backoff strategy parameters, downstream latency profiles, and idempotency assumptions—and produces a machine-readable scenario definition that can be fed into fault injection tools like Gremlin, Chaos Mesh, or custom load generators. Treat the output as a test specification artifact that must pass validation before execution, not as a final runbook.

Wire the prompt into your testing harness by first collecting the required inputs from your service mesh configuration, retry middleware settings, and distributed tracing data. Pass these as structured JSON in the [RETRY_POLICIES], [BACKOFF_STRATEGIES], and [DOWNSTREAM_LATENCY_PROFILES] placeholders. The model will return a scenario definition containing retry amplification factor calculations, dead letter accumulation predictions, and missing idempotency flag warnings. Validate the output against a schema that checks: (1) amplification factor is a numeric value with explicit derivation steps, (2) dead letter queue size predictions include time-bounded accumulation rates, (3) any missing idempotency key assumptions are flagged with severity levels, and (4) the scenario includes safe-abort conditions tied to specific metric thresholds. Reject outputs that lack these fields or contain unresolvable placeholder references.

Before executing the generated scenario in production or staging, run it through a dry-run validation step that simulates the retry storm against a sandboxed service instance with identical retry configuration but isolated downstream dependencies. Log the predicted vs. actual amplification factor, dead letter accumulation rate, and any idempotency-related duplicate processing events. Store these validation results alongside the prompt version, input parameters, and model identifier for auditability. If the scenario involves production traffic, require explicit human approval with a review checklist covering blast radius boundaries, monitoring alert thresholds, and rollback procedures. Never execute retry storm scenarios without first confirming that circuit breakers and rate limiters are configured to contain cascading failures beyond the target service boundary.

IMPLEMENTATION TABLE

Expected Output Contract

Validate the model's output against this contract before feeding it into your simulation harness. Reject or request repair for any field that fails its validation rule.

Field or ElementType or FormatRequiredValidation Rule

scenario_id

string (slug)

Must match pattern ^retry-storm-[a-z0-9-]+$. Reject if missing or malformed.

retry_policies

array of objects

Each object must contain fields: service_name (string), max_retries (integer >= 0), backoff_strategy (enum: fixed, exponential, jittered), base_delay_ms (integer > 0), max_delay_ms (integer >= base_delay_ms). Reject if array is empty or any object fails schema.

downstream_latency_injection

object

Must contain fields: target_service (string), latency_ms (integer >= 0), injection_probability (float between 0.0 and 1.0). Reject if probability out of range or target_service not found in retry_policies.

idempotency_assumptions

array of strings

Each string must be a service name present in retry_policies. If empty, flag as high-risk: missing idempotency assumption means duplicate processing is possible.

expected_amplification_factor

float

Must be >= 1.0. Calculate independently: sum of (max_retries + 1) for each service in the call chain. Reject if model output deviates > 10% from calculated value.

dead_letter_accumulation_prediction

object

Must contain fields: queue_name (string), estimated_messages_per_second (float >= 0), time_to_fill_minutes (float >= 0 or null). If null, require explicit justification string in notes field.

scenario_steps

array of objects

Each step must contain: step_number (integer, sequential starting at 1), action (string), expected_behavior (string), observation_check (string). Reject if steps array is empty or step_numbers are non-sequential.

failure_modes_identified

array of strings

If present, each string must be a distinct failure mode. If absent, flag as incomplete: scenario should identify at least one potential cascading failure mode.

PRACTICAL GUARDRAILS

Common Failure Modes

Retry storm simulations are complex and prone to modeling errors that can invalidate test results or, worse, cause real production impact if the simulation itself triggers cascading failures. These cards cover the most common failure modes and how to guard against them.

01

Missing Idempotency Assumptions

What to watch: The prompt produces a retry scenario without specifying idempotency keys, deduplication logic, or exactly-once delivery mechanisms. This leads to simulations that underestimate real-world amplification because the model assumes the system safely ignores duplicates. Guardrail: Add a hard constraint in the prompt template requiring explicit idempotency configuration per operation type. Validate the output by checking that every retry-eligible operation has a defined idempotency strategy before running the simulation.

02

Unrealistic Backoff Saturation

What to watch: The generated scenario uses uniform backoff strategies across all services, ignoring that different clients and SDKs have different jitter, cap, and multiplier defaults. This produces a clean theoretical amplification factor that doesn't match production. Guardrail: Require the prompt to enumerate backoff strategy variations per client type (SDK version, language runtime, gateway proxy). Include a validation step that compares generated backoff configurations against your production client library defaults.

03

Dead Letter Accumulation Blind Spot

What to watch: The scenario focuses entirely on retry amplification but ignores what happens to messages that exhaust all retry attempts. Dead letter queues fill silently, and the simulation provides no prediction for DLQ growth rate or storage pressure. Guardrail: Add an output schema field for dead_letter_accumulation_rate and require the prompt to calculate expected DLQ volume over the simulation duration. Validate that the scenario includes DLQ monitoring thresholds and disk saturation alerts.

04

Downstream Latency Injection Without Backpressure Propagation

What to watch: The prompt injects latency into a downstream dependency but doesn't model how that latency propagates upstream through connection pools, thread exhaustion, and request queuing. The simulation shows a clean retry storm when production would show a thread-starvation cascade. Guardrail: Require the scenario to include resource saturation indicators per service tier (thread pool utilization, connection pool wait time, request queue depth). Validate that latency injection is paired with resource constraint modeling.

05

Retry Amplification Factor Miscalculation

What to watch: The prompt calculates retry amplification as a simple multiplier (retries × services) without accounting for fan-out, nested retries, or retry budget sharing across call chains. The predicted amplification factor is orders of magnitude too low. Guardrail: Require the prompt to produce a retry call graph showing fan-out at each hop and to calculate amplification as the product of retry attempts along each path, not the sum. Validate against a manual calculation for a single representative call chain.

06

Missing Circuit Breaker Interaction

What to watch: The scenario models retries as if circuit breakers don't exist, or assumes they open instantly. In production, circuit breakers have half-open states, sliding windows, and per-endpoint vs per-service granularity that dramatically alter retry storm dynamics. Guardrail: Include circuit breaker configuration as a required input variable in the prompt template. Validate that the output describes how retry storms interact with each breaker state transition and includes breaker state monitoring during the simulation.

IMPLEMENTATION TABLE

Evaluation Rubric

Score each criterion on a pass/fail basis. A passing output must pass all criteria. Use this rubric to validate the retry storm simulation scenario before executing it in a test environment.

CriterionPass StandardFailure SignalTest Method

Retry Policy Completeness

Scenario defines max retries, backoff strategy, and timeout for each participating service

Missing retry cap, no backoff type specified, or timeout undefined

Schema check: confirm [RETRY_POLICIES] array contains max_attempts, backoff_type, and timeout_ms fields

Idempotency Assumption Validation

Scenario explicitly flags endpoints or operations that lack idempotency guarantees

No mention of idempotency keys, duplicate processing risk, or at-least-once delivery assumptions

Keyword scan: output must contain 'idempotent' or 'idempotency' with a boolean or risk flag per endpoint

Downstream Latency Injection Specification

Scenario defines latency injection ranges, target percentiles, and duration for each downstream dependency

Latency values are missing, unbounded, or applied uniformly without percentile targets

Schema check: confirm [DOWNSTREAM_LATENCY] entries include min_ms, max_ms, target_percentile, and duration_seconds

Retry Amplification Factor Calculation

Scenario computes expected amplification factor with formula and worst-case bound

Amplification factor is absent, uses a placeholder, or lacks a worst-case ceiling

Parse check: output must contain a numeric amplification_factor field with a formula reference and a worst_case_multiplier

Dead Letter Accumulation Prediction

Scenario estimates dead letter queue growth rate and total accumulated messages over the simulation window

No DLQ volume estimate, or estimate ignores retry multiplier effect

Numeric validation: dead_letter_estimated_count must be greater than 0 and derived from request_rate * failure_rate * amplification_factor

Circuit Breaker Interaction Modeling

Scenario describes how circuit breakers, if present, will interact with retry storms and whether they mitigate or delay saturation

No mention of circuit breaker state transitions, half-open behavior, or trip thresholds

Keyword scan: output must reference 'circuit_breaker' with expected state changes during the simulation timeline

Safe-Abort Condition Definition

Scenario specifies monitoring thresholds that trigger test abort to prevent production-like damage in shared environments

No abort conditions, or conditions reference only time elapsed without resource saturation limits

Schema check: abort_conditions array must contain at least one metric threshold (e.g., error_rate_pct, queue_depth, or cpu_utilization_pct)

Scenario Reproducibility

Scenario includes all parameter values, seed data, and initial state needed to reproduce the retry storm

Missing seed values, hardcoded assumptions without justification, or environment-specific state not documented

Completeness check: output must include a reproducibility section with seed values, initial queue depths, and service health state

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base prompt with a single retry policy and one downstream service. Remove the amplification factor calculation and dead letter accumulation sections. Focus on generating one scenario with a fixed backoff strategy and a single latency injection range.

Simplify the output schema to only require: scenario_name, retry_policy, downstream_latency_ms, and expected_retry_count. Skip idempotency validation.

Watch for

  • Overly broad instructions producing generic retry descriptions instead of specific configurations
  • Missing concrete numbers for timeouts and max attempts
  • No distinction between client-side and server-side retries
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.