This prompt is designed for integration engineers, SREs, and backend architects who are actively evaluating a third-party API for production use. The core job-to-be-done is to transform static vendor documentation, SLA pages, and error code references into a structured, actionable resilience contract review. The output is not a simple summary; it is a formal audit that identifies gaps between the vendor's promises and the operational requirements of a production system, covering SLA commitments, error response handling, rate limit compliance, timeout defaults, and the blast radius of a vendor outage.
Prompt
Third-Party API Resilience Contract Prompt

When to Use This Prompt
Defines the job-to-be-done, the ideal user, required context, and clear boundaries for when this prompt should and should not be applied.
To use this prompt effectively, you must provide the raw or copied text from the vendor's official API documentation, their Service Level Agreement (SLA) terms, and their error code reference. The prompt is engineered to cross-reference these three inputs. For example, it will check if a documented 99.9% uptime SLA is backed by a clear error budget and financial penalty, or if a 429 Too Many Requests error code is accompanied by a Retry-After header specification. Without these specific source materials, the prompt will produce a low-confidence, speculative analysis that is unsuitable for an architectural decision record.
Do not use this prompt for reviewing internal services, database resilience, or client-side patterns. An internal gRPC service is governed by your own SLOs and error budgets, not a vendor contract. Similarly, a mobile app's offline queue is a client-side resilience pattern that requires a different evaluation framework. Using this prompt for those scenarios will produce irrelevant checks, such as looking for financial penalties in an internal SLA, and will miss critical failure modes like connection pool exhaustion or stale data display. For those use cases, refer to the sibling playbooks on Circuit Breaker Design Review or Client-Side Resilience Pattern Audit. After completing this review, the logical next step is to feed the identified risks into a Failure Mode and Effects Analysis (FMEA) prompt to quantify their potential impact on your specific system.
Use Case Fit
Where the Third-Party API Resilience Contract Prompt delivers value and where it falls short.
Strong Fit: Pre-Integration Vendor Assessment
Use when: evaluating a new third-party API before signing a contract or beginning integration. The prompt excels at systematically extracting SLA terms, error response patterns, and rate limit structures from vendor documentation. Guardrail: always ground findings in specific documentation sections; never rely on the model's general knowledge of a vendor.
Strong Fit: Resilience Gap Discovery
Use when: auditing existing integrations for undocumented failure modes, missing timeout defaults, or incomplete retry logic. The prompt's structured contract output makes gaps visible. Guardrail: pair the prompt output with production incident data to validate whether theoretical gaps have caused real outages.
Poor Fit: Real-Time Production Decisioning
Avoid when: the output needs to drive automated circuit breaker configuration or runtime policy enforcement without human review. The prompt identifies risks but does not calculate safe thresholds for production systems. Guardrail: route all configuration changes through a human approval step and staging validation before deployment.
Poor Fit: Undocumented or Proprietary APIs
Avoid when: the vendor provides no public SLA, error code reference, or rate limit documentation. The prompt cannot invent resilience contracts from black-box behavior alone. Guardrail: if documentation is missing, switch to an empirical testing approach with recorded traffic analysis rather than relying on prompt-based contract generation.
Required Input: Vendor Documentation Artifacts
Risk: incomplete or outdated documentation produces an incomplete resilience contract that misses critical failure modes. Guardrail: require at minimum the vendor's SLA page, API reference with error codes, and rate limiting documentation as input context. Flag any contract sections where source material was insufficient.
Operational Risk: Overconfidence in Completeness
Risk: teams treat the generated contract as exhaustive, missing failure modes the vendor has not documented or the model could not infer. Guardrail: treat the output as a starting hypothesis, not a finished audit. Validate against production observability data and run chaos experiments against the actual integration.
Copy-Ready Prompt Template
Paste this prompt into your AI harness to generate a structured resilience contract review for any third-party API dependency.
This template forces the model to act as an integration engineer auditing a vendor API for resilience gaps. It requires you to supply the vendor's actual documentation—API reference pages, SLA terms, error code lists, and rate limit policies—as the [VENDOR_DOCS] input. The prompt is designed to produce a consistent, machine-readable JSON output that your application can parse, store, and compare across multiple vendor reviews. Do not use this prompt for internal service-to-service contracts where you control both sides; those require a different review frame focused on implementation correctness rather than external dependency risk.
textYou are an integration reliability engineer reviewing a third-party API for production resilience risks. ## INPUT [VENDOR_DOCS] ## SYSTEM CONTEXT Our system calls this vendor API for: [INTEGRATION_PURPOSE] Criticality level: [CRITICALITY_LEVEL] Expected call volume: [CALL_VOLUME] Acceptable latency ceiling: [LATENCY_CEILING_MS]ms ## OUTPUT_SCHEMA Return valid JSON matching this structure exactly: { "vendor_name": "string", "review_date": "YYYY-MM-DD", "sla_summary": { "uptime_commitment": "string or null", "latency_commitment": "string or null", "support_response_time": "string or null", "sla_credit_terms": "string or null", "gaps": ["string observations about missing or weak SLA terms"] }, "error_handling": { "documented_error_codes": ["list of error codes found in docs"], "retryable_errors": ["subset that are safe to retry"], "missing_error_documentation": ["gaps identified"], "timeout_defaults": { "connect_timeout_documented": true or false, "read_timeout_documented": true or false, "recommended_timeout_ms": number or null } }, "rate_limiting": { "limit_type": "string describing the limit model", "limit_value": "string or null", "window": "string or null", "rate_limit_headers_documented": true or false, "burst_allowance": "string or null", "compliance_risk": "low" | "medium" | "high" }, "outage_impact": { "failure_scenarios": ["list of plausible outage modes"], "blast_radius": "string describing what breaks if this API is down", "graceful_degradation_options": ["fallback paths available"], "recommended_circuit_breaker_threshold": "string recommendation" }, "overall_risk_rating": "low" | "medium" | "high" | "critical", "recommendations": ["prioritized list of actions before production use"], "undocumented_failure_modes": ["failure scenarios the docs do not address"], "confidence": "high" | "medium" | "low" } ## CONSTRAINTS - Only use information present in [VENDOR_DOCS]. Do not invent API behavior. - If a field cannot be determined from the documentation, use null or an empty array. - Mark confidence as "low" when documentation is sparse or ambiguous. - Flag missing timeout defaults as a high-severity finding. - For undocumented failure modes, reason from what the docs omit, not from general API experience. ## EVALUATION CRITERIA A valid output must: 1. Contain all top-level keys in the schema. 2. Set confidence accurately based on documentation completeness. 3. Never hallucinate error codes or SLA terms not present in the input. 4. Identify at least one undocumented failure mode if the docs lack timeout or error information.
Adapt this template by adjusting the [INTEGRATION_PURPOSE], [CRITICALITY_LEVEL], [CALL_VOLUME], and [LATENCY_CEILING_MS] placeholders to match your actual dependency context. The criticality level should drive the risk rating: a payment-processing dependency with no documented retryable errors should surface as "critical," while a non-essential analytics endpoint might tolerate "medium" risk. If your organization has a standard resilience contract template, replace the OUTPUT_SCHEMA with your internal format—but preserve the requirement to flag missing timeout defaults and undocumented failure modes, as these are the most common production surprises.
Before wiring this into an automated pipeline, run it against a vendor whose documentation you know well and compare the output to your manual assessment. If the model invents SLA terms or error codes, add a stronger constraint in the prompt or switch to a model with lower hallucination rates for structured extraction tasks. For high-risk integrations, always route the output to a human reviewer before accepting the contract as complete. Store each review as a versioned artifact so you can detect when a vendor's documentation changes and re-trigger the audit.
Prompt Variables
Each placeholder required by the Third-Party API Resilience Contract Prompt, its purpose, a concrete example, and actionable validation rules to ensure the prompt receives complete and correct inputs before execution.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[API_VENDOR_NAME] | Identifies the external service provider under review. | Stripe | Non-empty string. Must match a known vendor in the integration registry. Null not allowed. |
[API_ENDPOINT_SPEC] | The specific API contract or OpenAPI spec to analyze for resilience gaps. | POST /v1/charges | Must be a valid URI path or a raw OpenAPI/Swagger JSON string. Schema parse check required before prompt injection. |
[SLA_DOCUMENT_TEXT] | The full text of the vendor's Service Level Agreement or Terms of Service. | "Uptime: 99.95%, measured monthly..." | Non-empty string. Minimum 50 characters. Human review required if the source document is a scanned PDF or image. |
[INTEGRATION_CONTEXT] | Describes how the internal system depends on this API, including criticality and user impact. | Payment processing for checkout flow. Critical path. | Non-empty string. Must include a criticality rating (Critical/High/Medium/Low). Null not allowed. |
[CURRENT_TIMEOUT_CONFIG] | The existing timeout, retry, and circuit breaker settings applied to this dependency. | connectTimeout: 5s, readTimeout: 30s, maxRetries: 3 | Must be a valid JSON object with numeric values for timeout fields. Parse check for negative numbers or missing keys. |
[RATE_LIMIT_HEADERS] | The specific HTTP headers the vendor uses to communicate rate limits. | X-RateLimit-Remaining, Retry-After | Comma-separated string. Validation checks for standard header format (no spaces in header names). Null allowed if vendor provides no headers. |
[KNOWN_FAILURE_MODES] | A list of previously observed or documented failure modes for this integration. | ["500 errors during peak hours", "TCP connection resets"] | Must be a valid JSON array of strings. An empty array is allowed but triggers a lower-confidence evaluation note. |
Implementation Harness Notes
How to wire the Third-Party API Resilience Contract Prompt into an application with validation, retries, logging, and human review gates.
This prompt is designed to be called programmatically as part of an integration review pipeline, not as a one-off chat interaction. The typical harness wraps the LLM call in a function that accepts a structured input object (vendor name, API documentation text, observed error logs, and SLA excerpts) and returns a typed resilience contract object. Because the output drives architectural decisions about timeout budgets, circuit breaker thresholds, and fallback strategies, the harness must enforce schema validation before the result is accepted into any design document or ADR.
Wire the prompt through a service function that constructs the full prompt by injecting the [VENDOR_NAME], [API_DOCUMENTATION], [OBSERVED_ERROR_LOG], and [SLA_EXCERPTS] placeholders. On the response path, apply a JSON schema validator that checks for required fields: sla_gaps, error_response_risks, rate_limit_exposure, outage_impact_assessment, and recommended_contract_clauses. If validation fails, retry once with the validation error message appended as a correction instruction. Log the raw prompt, the model response, the validation result, and the retry count to your observability platform. For high-risk integrations (payment processors, auth providers, health data APIs), route the validated output to a human review queue before it is committed to the architecture repository.
Model choice matters here. Use a model with strong structured output support and a context window large enough to hold the full API documentation plus the prompt instructions. If the documentation exceeds the context window, pre-process it with a chunking strategy that extracts endpoint definitions, error code tables, and SLA sections before passing them into the prompt. Do not truncate error code tables mid-row. The harness should also enforce a timeout on the LLM call itself—if the model takes longer than 30 seconds, fail the call and escalate rather than silently accepting a partial or hallucinated contract review.
Expected Output Contract
The structured JSON fields the model must return for the Third-Party API Resilience Contract Review. Use this contract to validate the model's output before it enters downstream workflows.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
resilience_assessment | object | Schema check: must contain all required sub-objects. Parse failure triggers retry. | |
resilience_assessment.overall_risk_score | string (enum) | Must be one of: low, medium, high, critical. Enum mismatch triggers retry. | |
resilience_assessment.sla_terms | array of objects | Each object must have fields: metric (string), target (string), measurement_window (string). Null array not allowed. | |
resilience_assessment.error_response_handling | array of objects | Each object must have fields: status_code (integer), retryable (boolean), recommended_action (string). Missing status_code triggers validation failure. | |
resilience_assessment.rate_limit_compliance | object | Must contain fields: rate_limit_header_detected (boolean), limit_remaining_threshold (integer), recommended_backoff_strategy (string). Boolean field must be true or false. | |
resilience_assessment.vendor_outage_impact | object | Must contain fields: severity (string enum: minor, major, critical), affected_user_journeys (array of strings), estimated_recovery_time (string). Missing severity triggers human review flag. | |
resilience_assessment.missing_defaults | array of strings | List of missing timeout defaults, retry configurations, or circuit breaker settings. Empty array is valid. Each entry must be a non-empty string. | |
resilience_assessment.undocumented_failure_modes | array of strings | List of failure modes not covered by vendor documentation. Empty array is valid. Each entry must be a non-empty string. Null array triggers retry. |
Common Failure Modes
What breaks first when the Third-Party API Resilience Contract Prompt runs in production and how to guard against each failure.
Missing or Stale SLA Documentation
What to watch: The prompt produces a weak review because the input lacks the vendor's current SLA, error code reference, or rate limit policy. The model fills gaps with plausible but incorrect defaults. Guardrail: Require a [VENDOR_DOCS] input field with a timestamp. If the document is older than 90 days, flag the output with a 'stale source' warning and block automated downstream actions.
Undocumented Failure Modes in Vendor API
What to watch: The prompt correctly analyzes documented error codes but misses real-world failure modes like 5-second TCP hangs before a 503, or inconsistent rate limit headers. The contract review passes while production integrations still break. Guardrail: Pair this prompt with a runtime evidence harness. Feed production error logs into a follow-up review step that compares documented behavior against observed behavior and flags discrepancies.
Timeout and Retry Misconfiguration
What to watch: The prompt identifies missing timeout defaults in the vendor contract but the reviewer accepts generic recommendations like 'set a reasonable timeout.' The integration ships with a 30-second default against an API that p95s at 28 seconds. Guardrail: Require the output to include concrete timeout values derived from documented SLA percentiles. Add a validator that rejects any recommendation containing the word 'reasonable' without a specific number and unit.
Rate Limit Misinterpretation
What to watch: The prompt misreads rate limit scope—confusing per-endpoint limits with account-wide limits, or per-second windows with per-minute windows. The integration either over-throttles and wastes capacity or under-throttles and gets blocked. Guardrail: Add a structured [RATE_LIMIT_SCHEMA] output field that forces explicit scope, window size, and concurrency limit. Validate that every limit has a confirmed unit and scope before the review is considered complete.
Overconfidence on Vendor Uptime Guarantees
What to watch: The prompt treats a vendor's 99.9% uptime SLA as a reliability guarantee and recommends no client-side resilience. The vendor has a history of silent partial outages that don't breach the SLA but break dependent workflows. Guardrail: Require the output to include a 'SLA gap analysis' section that explicitly lists what the SLA does not cover—partial failures, degraded performance, data staleness. If this section is empty, fail the review.
Error Response Parsing Assumptions
What to watch: The prompt assumes the vendor follows standard error response conventions (RFC 7807, JSON API) but the vendor returns HTML error pages for 5xx or plain text for 429s. The generated error-handling code breaks on unparseable responses. Guardrail: Add a mandatory [ERROR_RESPONSE_SAMPLES] input containing real response bodies for each documented error code. The prompt must verify that every error code has a parseable, machine-readable response example before recommending handling logic.
Evaluation Rubric
Score each output dimension before shipping this prompt into a production API review workflow. Each row defines a pass standard, a failure signal, and a concrete test method.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
SLA Term Extraction Completeness | All SLA terms (uptime, latency, support response, credit) present in the output contract | Missing SLA dimension or placeholder text like 'not specified' without explicit flag | Diff output fields against a golden SLA checklist; flag any missing dimension |
Error Response Mode Coverage | Every documented HTTP error code mapped to a retryable, non-retryable, or escalation classification | Error code listed without classification or missing codes present in API docs | Parse output for error code table; cross-reference with API reference docs using grep or schema diff |
Rate Limit Rule Accuracy | Rate limit header names, window units, and burst allowances match vendor documentation exactly | Mismatched header name, incorrect window unit, or missing burst allowance | Automated field comparison against vendor rate limit docs; fail on any mismatch |
Timeout Default Detection | Explicit timeout values extracted for connect, read, and request; missing defaults flagged with severity | Timeout field null without a 'missing default' warning annotation | Schema validation: timeout fields must be non-null or accompanied by a warning flag |
Undocumented Failure Mode Flagging | At least one undocumented failure mode identified per dependency when vendor docs are incomplete | Output states 'no undocumented failure modes found' when vendor docs lack error scenarios | Human review of vendor docs completeness score; if score < 0.8, require at least one flagged gap |
Vendor Outage Impact Scoring | Each dependency scored for blast radius (low/medium/high/critical) with affected user journeys listed | Impact score present but no affected user journeys enumerated | Check output for impact_score field and non-empty affected_journeys array; fail if array empty |
Mitigation Recommendation Actionability | Every recommended mitigation includes a specific implementation step, not generic advice | Mitigation contains phrases like 'consider implementing' or 'monitor closely' without concrete action | Keyword scan for vague phrases; human spot-check 20% of mitigations for actionability |
Citation Grounding | Every factual claim about vendor behavior linked to a specific documentation section or version | Claim about API behavior present without source reference | Parse citations array; verify each claim in output has a corresponding citation entry with doc URL and section |
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
Use the base prompt with a single API dependency and lighter validation. Remove the structured output schema and ask for a plain-text summary first. Focus on getting the right categories of concern (SLA, error handling, rate limits, outage impact) before enforcing strict JSON.
Watch for
- Missing schema checks leading to inconsistent field naming
- Overly broad instructions that produce generic advice instead of API-specific findings
- No retry or fallback logic in the harness

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