This prompt is designed for resilience engineers and SREs who need to move beyond generic 'what if the payment gateway goes down?' discussions and into concrete, executable failure injection scenarios. The job-to-be-done is translating a system architecture diagram and a list of external dependencies into a precise test plan that specifies latency injection ranges, error rate targets, timeout configurations, and the expected behavior of circuit breakers, retry logic, and fallback mechanisms. The ideal user has a working knowledge of their system's dependency graph and can provide context on existing resilience patterns, but needs help generating the specific parameters that make a chaos experiment or failure test both realistic and safe to execute.
Prompt
Third-Party Dependency Failure Simulation Prompt

When to Use This Prompt
Define the job, the user, and the boundaries for the Third-Party Dependency Failure Simulation Prompt.
You should use this prompt when you have a defined system boundary and a known set of third-party services (APIs, databases, message queues, cloud services) that your application depends on. It is particularly valuable during pre-release resilience reviews, when onboarding a new critical dependency, or when designing chaos engineering game days. The prompt requires you to supply a structured [DEPENDENCY_MAP] detailing each service, its criticality, and its current timeout and retry configuration. Without this input, the model will make assumptions that could lead to unrealistic or unsafe test scenarios. The output is not a runnable script but a detailed scenario specification that a human or an automation harness can translate into a fault injection tool like Gremlin, Chaos Mesh, or AWS FIS.
Do not use this prompt for systems where you have no visibility into the dependency chain or where the architecture is entirely undocumented. It is also not a substitute for a full threat model or a security-focused failure analysis. The prompt assumes you are testing for availability and performance degradation, not for malicious compromise or data corruption attacks. After generating the scenario, you must review the proposed injection parameters against your actual production configurations; a model cannot know your exact network topology or rate-limiting rules. The next step is to take the generated scenario and run it in a pre-production environment, using the provided eval checks to validate that the simulated failures trigger the expected circuit breaker and fallback behaviors without causing unexpected cascading failures.
Use Case Fit
Where this prompt works and where it does not.
Good Fit: Pre-Production Resilience Drills
Use when: You have a defined architecture diagram and want to generate specific failure injection scenarios for a game day or chaos experiment. Guardrail: Always map the prompt's output to a specific blast radius and abort condition before execution.
Good Fit: Circuit Breaker Tuning
Use when: You need to define latency injection ranges and error rate targets to validate that your circuit breaker opens and closes correctly. Guardrail: Pair the generated thresholds with your actual SLA definitions to ensure they are not too aggressive or too lenient.
Bad Fit: Production Safety Validation
Avoid when: You are trying to generate a direct command to execute a failure in a live production system without a human-in-the-loop review. Guardrail: This prompt designs the scenario; it does not approve its execution. Always route the output to a manual approval queue.
Required Input: Dependency Map
Risk: Without a clear list of upstream and downstream services, the prompt may hallucinate non-existent dependency chains. Guardrail: Provide a structured [DEPENDENCY_MAP] input, such as a JSON service graph, rather than a free-text description to ensure accuracy.
Required Input: Timeout and Retry Configs
Risk: The prompt might assume default or unrealistic timeout values if not explicitly provided. Guardrail: Feed in your actual [CLIENT_CONFIGURATION] including connection timeouts, read timeouts, and retry backoff policies to generate a valid simulation.
Operational Risk: Unrealistic Recovery
Risk: The model may generate a scenario where the system recovers instantly after the fault is removed, ignoring state corruption or cold-start latency. Guardrail: Explicitly instruct the prompt to include a [RECOVERY_WINDOW] phase in the scenario to validate warm-up and data integrity checks.
Copy-Ready Prompt Template
A reusable prompt for generating third-party dependency failure simulation scenarios with structured injection parameters and expected system behavior.
This prompt template produces a failure injection scenario for a specified third-party dependency. It guides the model to define latency injection ranges, error rate targets, timeout configurations, and expected circuit breaker or fallback behavior. Use it when you need a structured, repeatable way to generate resilience test scenarios for external service degradation. Do not use this prompt for internal service failures, infrastructure-level chaos experiments, or scenarios where the dependency's internal implementation details are required—those require different context and injection models.
Below is the copy-ready prompt template. Replace each square-bracket placeholder with your specific context before sending it to the model. The placeholders control the dependency scope, failure dimensions, and output structure. After the code block, adaptation guidance explains how to adjust the template for different resilience testing needs.
codeYou are a resilience engineer designing a failure injection scenario for a third-party dependency. Generate a structured failure simulation scenario for the following dependency: [DEPENDENCY_NAME] [DEPENDENCY_DESCRIPTION] [DEPENDENCY_CRITICALITY: critical | high | medium | low] Include these failure dimensions with specific, testable parameters: 1. Latency Injection - Baseline latency (p50, p95, p99) in milliseconds - Injected latency range (min, max, step) in milliseconds - Injection duration and ramp profile - Which endpoints or operations receive latency injection 2. Error Injection - Error types to inject (timeout, 5xx, connection refused, DNS failure, TLS error) - Error rate targets (percentage of requests) - Error rate ramp profile (instant, gradual, oscillating) - Which endpoints or operations receive error injection 3. Timeout Configuration - Current client-side timeout settings - Recommended timeout adjustments for the test - Connection pool timeout settings - Request queue timeout settings 4. Expected System Behavior - Circuit breaker state transitions and timing - Fallback mechanism activation criteria - Expected degradation mode (graceful, partial, full outage) - Recovery behavior after injection stops - Metrics to monitor during the test 5. Test Execution Parameters - Steady-state traffic level during injection - Injection start and stop triggers - Abort conditions and safety thresholds - Rollback procedure if system becomes unstable [ADDITIONAL_CONTEXT] [CONSTRAINTS] Output the scenario as a structured JSON object with the following schema: [OUTPUT_SCHEMA] Include a "risk_assessment" field that identifies: - Potential cascading failures - Data consistency risks - Monitoring blind spots - Recommended pre-test checks
To adapt this template, start by narrowing the failure dimensions to match your actual dependency surface. If the dependency has a well-defined API with known endpoints, replace the generic endpoint placeholders with specific paths or operation names. For dependencies with client libraries, include the library version and known timeout defaults in [ADDITIONAL_CONTEXT]. When testing circuit breakers, ensure [CONSTRAINTS] specifies the circuit breaker library (e.g., Resilience4j, Polly, Hystrix) and its configuration so the model can produce accurate state transition predictions. For high-risk production tests, add a human review step before execution: the generated scenario should be reviewed by a senior engineer who can validate that the injection parameters won't cause unrecoverable data corruption or cascade beyond the intended blast radius.
Before using this prompt in a test pipeline, validate the output against these criteria: every injection parameter must have a numeric range or specific value, not a vague description; the expected behavior section must reference specific circuit breaker or fallback mechanisms named in your [ADDITIONAL_CONTEXT]; the abort conditions must include concrete metric thresholds (e.g., 'abort if p99 latency exceeds 5000ms for 30 seconds'); and the risk assessment must identify at least one monitoring blind spot. If the model output fails any of these checks, re-prompt with more explicit constraints or narrow the scope to a single failure dimension. For production use, store generated scenarios in version control alongside the prompt version that produced them, enabling traceability when scenarios are reused or modified.
Prompt Variables
Required inputs for the Third-Party Dependency Failure Simulation Prompt. Each placeholder must be populated before the prompt can generate a valid failure injection scenario.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[DEPENDENCY_NAME] | Identifies the specific external service or API being tested for failure resilience | payment-gateway-api | Must match a real dependency in the system architecture diagram; null not allowed |
[DEPENDENCY_SLO] | Defines the normal operating latency and availability targets for the dependency | p99 < 200ms, 99.9% availability | Must include at least one latency percentile and one availability percentage; parse as structured SLO object |
[FAILURE_MODE] | Specifies which degradation type to simulate: latency injection, error injection, or complete unavailability | latency-injection | Must be one of: latency-injection, error-injection, complete-outage, partial-degradation; enum validation required |
[LATENCY_RANGE_MS] | Defines the injected latency range in milliseconds for timeout boundary testing | 500-5000 | Required when FAILURE_MODE is latency-injection; must be parseable as integer range with min < max; null allowed for non-latency modes |
[ERROR_RATE_TARGET] | Specifies the target error rate percentage to inject for error injection scenarios | 25 | Required when FAILURE_MODE is error-injection; must be integer between 1 and 100; null allowed for non-error modes |
[TIMEOUT_CONFIG_MS] | Defines the current timeout configuration for calls to this dependency | 3000 | Must be positive integer; used to validate that injected latency exceeds or approaches timeout threshold for circuit breaker testing |
[CIRCUIT_BREAKER_CONFIG] | Describes the circuit breaker settings: failure threshold, open duration, half-open behavior | 5 failures in 30s window, 60s open, 3 half-open probes | Must include failure count, time window, open duration, and half-open probe count; parse as structured breaker object |
[FALLBACK_BEHAVIOR] | Documents the expected fallback or graceful degradation behavior when dependency fails | return cached balance with stale-flag header | Must describe concrete fallback action; validation checks for vague descriptions like 'handle gracefully'; approval required if fallback is undefined |
Implementation Harness Notes
How to wire the Third-Party Dependency Failure Simulation Prompt into a resilience testing pipeline with validation, retries, and human review gates.
This prompt is designed to be integrated into a resilience engineering workflow, not used as a one-off chat. The primary integration point is a CI/CD pipeline stage or a chaos engineering platform that consumes structured failure injection scenarios. The application should supply the prompt with a system architecture document, a service dependency graph, and the target SLA or SLO definitions as [CONTEXT]. The model's output—a JSON array of failure scenarios—must be validated against a strict schema before any failure is injected into a live environment. Treat the model as a scenario generator, not an authority; every generated scenario must pass automated validation and, for production environments, a human approval step.
Wire the prompt into an application by first constructing the [CONTEXT] block programmatically. This block should be assembled from your service registry, distributed tracing data (e.g., Jaeger or Zipkin traces showing actual dependency call paths), and your incident response runbooks. The [CONSTRAINTS] placeholder should be populated with your organization's specific blast radius policies, allowed injection types (latency, error codes, connection drops), and any regulatory boundaries. After the model returns the JSON output, run a validation layer that checks: (1) every dependency in the scenario exists in your service graph, (2) latency injection ranges do not exceed your configured timeouts, (3) error rate targets are within the circuit breaker thresholds you have actually configured, and (4) recovery assumptions reference real fallback mechanisms you have implemented. Reject any scenario that references a non-existent fallback or an unrealistic recovery time. Log every generated scenario, validation result, and human approval decision for auditability.
For high-risk production environments, insert a mandatory human review step before any failure injection executes. The review interface should display the generated scenario alongside the source evidence from your service graph that supports each dependency claim. Use a model with strong JSON mode and low temperature (0.1–0.2) for this task; avoid models prone to hallucinating plausible-sounding but non-existent API endpoints. Implement a retry loop with a maximum of two retries if validation fails, using the validation errors as feedback in the retry prompt. If the model consistently generates scenarios that fail validation, escalate to a human resilience engineer rather than silently discarding outputs. The next step after a validated scenario is to feed it into your chaos engineering tool (e.g., Gremlin, Chaos Mesh, or LitmusChaos) with the abort conditions and monitoring thresholds already defined in the scenario output.
Expected Output Contract
Defines the required fields, types, and validation rules for the structured output of the Third-Party Dependency Failure Simulation Prompt. Use this contract to parse and validate the model's response before injecting it into a test harness.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
dependency_name | string | Must match a dependency listed in [DEPENDENCY_MAP] input. Non-empty. | |
failure_mode | string | Must be one of: 'latency_injection', 'error_injection', 'connection_drop', 'partial_degradation'. Case-sensitive enum check. | |
latency_injection_range_ms | object {min: integer, max: integer, p95: integer} | Required if failure_mode is 'latency_injection'. min < max < p95. All values must be positive integers. | |
error_rate_target | object {percentage: float, http_status_codes: integer[]} | Required if failure_mode is 'error_injection'. percentage must be between 0.0 and 100.0. http_status_codes must be a non-empty array of valid 4xx/5xx codes. | |
timeout_configuration_ms | integer | Must be a positive integer. Should be less than the upstream service's SLA timeout defined in [SLA_REQUIREMENTS]. | |
expected_circuit_breaker_behavior | string | Must describe the expected state transition (e.g., 'CLOSED -> OPEN'). Must reference a circuit breaker name from [CIRCUIT_BREAKER_CONFIG]. | |
fallback_action | string | Must be one of: 'return_cached', 'return_static_default', 'fail_silently', 'escalate'. Must align with the fallback strategy defined in [RESILIENCE_POLICIES]. | |
recovery_assumption | string | Must describe the expected recovery path. Must not contain the phrase 'auto-heal' or assume instantaneous recovery. Must specify a time-bound condition (e.g., 'after 3 consecutive successful health checks'). |
Common Failure Modes
What breaks first when simulating third-party dependency failures and how to guard against unrealistic or incomplete scenarios.
Missing Transitive Dependencies
What to watch: The prompt identifies direct dependencies but misses downstream services that also degrade when the primary dependency fails. This produces scenarios that pass in isolation but fail in production because the real blast radius is wider. Guardrail: Require the prompt to traverse the full call graph. Add a validation step that asks: 'For each dependency identified, list every service that depends on it, directly or indirectly.'
Unrealistic Recovery Assumptions
What to watch: The generated scenario assumes dependencies recover cleanly after the failure window, ignoring real-world effects like connection pool exhaustion, stale connection states, or thundering herd reconnection storms. Guardrail: Add a post-failure recovery phase to every scenario. Require explicit validation of connection pool health, circuit breaker half-open states, and client-side retry backlog before declaring recovery complete.
Static Failure Injection Without Variance
What to watch: The prompt produces a single fixed latency or error rate value instead of a distribution. Real dependencies degrade with jitter, intermittent failures, and partial responses that are harder to handle than total failure. Guardrail: Require the output to specify latency ranges (e.g., p50/p95/p99), error rate bands, and intermittent failure patterns. Add an eval check that rejects scenarios with only a single static value per injection parameter.
Ignoring Timeout and Retry Interaction
What to watch: The scenario specifies dependency latency but doesn't account for how client-side timeouts, retry budgets, and circuit breaker thresholds interact. A 5-second latency injection may be harmless if the client times out at 3 seconds and retries, amplifying load. Guardrail: Require the prompt output to include the expected client timeout configuration, retry policy, and circuit breaker settings alongside each injection parameter. Validate that the injection values exercise the boundaries of these settings.
Single-Dependency Focus Without Cumulative Degradation
What to watch: The prompt models one dependency failing at a time, missing scenarios where multiple dependencies degrade simultaneously or in sequence. Production incidents often cascade across several external services. Guardrail: Add a requirement for at least one multi-dependency degradation scenario. Validate that the output includes a dependency failure combination matrix and explains why the chosen combinations represent realistic correlated failure modes.
Fallback Behavior Left Unverified
What to watch: The scenario describes expected fallback or circuit breaker behavior but doesn't specify how to verify that the fallback actually executed correctly. Teams run the test, see no errors, and assume fallbacks worked when they may have silently returned stale or incorrect data. Guardrail: Require each failure injection scenario to include explicit fallback verification assertions. For example: 'After injecting 500 errors on the payment service, verify the order service returns a retryable error to the client, not a null payment confirmation.'
Evaluation Rubric
Criteria for evaluating the quality and safety of a Third-Party Dependency Failure Simulation Prompt's output before integrating it into a resilience testing harness.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Dependency Chain Completeness | All downstream services affected by the simulated failure are explicitly listed with their expected failure mode. | The output omits a known downstream service or assumes a dependency that does not exist in the provided architecture context. | Manually trace the dependency graph from the provided [ARCHITECTURE_DIAGRAM] and verify every node is accounted for in the output. |
Injection Parameter Realism | Latency injection ranges, error rates, and timeout values are within 2 standard deviations of historical baseline data provided in [BASELINE_METRICS]. | Injection parameters are extreme (e.g., 100% packet loss, 0ms timeout) without justification, or fall outside the bounds of real-world degradation events. | Parse the output's injection values and run a script to compare them against the statistical distribution in [BASELINE_METRICS]. |
Circuit Breaker State Transition | The expected circuit breaker state (Closed, Open, Half-Open) is correctly predicted for each service based on the injected failure and the provided [CIRCUIT_BREAKER_CONFIG]. | The output predicts a circuit remains closed under a failure rate that exceeds the configured threshold, or predicts an open circuit when the error budget is not exhausted. | Write a unit test that simulates the failure injection against a mock of the circuit breaker library with the given config and asserts the state matches the prediction. |
Fallback Behavior Specification | For every critical user journey in [USER_JOURNEYS], a specific, testable fallback behavior is defined (e.g., 'serve stale cache', 'return degraded result', 'queue and retry'). | The output uses vague terms like 'handle gracefully' or 'fail safely' without a concrete, verifiable action, or omits a fallback for a critical journey. | For each journey, check if the output's fallback action can be directly translated into an automated integration test assertion. |
Recovery Assumption Validation | The scenario explicitly states the expected recovery time and behavior after the fault is removed, referencing the provided [RECOVERY_PROCEDURE]. | The output assumes instantaneous recovery with no data backfill, cache warming, or connection pool re-establishment period. | Check the output for a 'Recovery Phase' section and verify it includes a non-zero time duration and a list of state reconciliation steps. |
Blast Radius Containment | The simulation is scoped to a single logical dependency failure, and the output explicitly lists which system components are expected to be unaffected. | The failure scenario cascades uncontrollably to take down the entire system in the prediction, indicating a lack of isolation in the test design. | Review the 'Expected Impact' section; a pass requires a clear 'Out of Scope / Unaffected Components' list. |
Observability Signal Mapping | The output maps each predicted system behavior to a specific metric or log query from the provided [OBSERVABILITY_PLATFORM] that would confirm the behavior. | Predictions are made without any reference to how an engineer would observe them, making the hypothesis non-falsifiable. | Verify that every statement in the 'Expected Behavior' section has a corresponding entry in the 'Monitoring Signals' section with a concrete metric name and threshold. |
Idempotency and Retry Storm Risk | The scenario explicitly addresses the risk of retry storms by referencing the provided [RETRY_POLICY] and calculating the expected amplification factor. | The output ignores the retry configuration, potentially describing a scenario that would cause a catastrophic retry storm in production without warning the user. | Check the output for a 'Retry Amplification Analysis' subsection that includes a numerical amplification factor and a safety recommendation. |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Start with the base prompt template and a single dependency. Remove the circuit breaker and fallback behavior sections. Focus on latency injection and error rate targets only. Use a simple markdown table for the output instead of a structured JSON schema.
Watch for
- Missing realistic recovery assumptions when fallback logic is omitted
- Overly broad latency ranges that don't reflect actual third-party behavior
- No validation that the injected failure actually exercises the timeout configuration

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us