Inferensys

Prompt

Graceful Degradation Prompt for Partial Results

A practical prompt playbook for using Graceful Degradation Prompt for Partial Results in production AI workflows.
Developer doing prompt engineering on laptop, prompt variations visible on screen, casual coding session.
PROMPT PLAYBOOK

When to Use This Prompt

Identify the right multi-step AI workflows for a graceful degradation pattern that separates completed work from failed steps.

This prompt is designed for multi-step AI workflows where independent subtasks can succeed or fail without invalidating the entire run. The core job-to-be-done is to produce a structured partial-result response that clearly separates completed work from failed steps and provides explicit remediation paths. Ideal users are platform engineers and AI product teams building data extraction pipelines from multiple sources, batch processing jobs, or multi-tool agent runs. The required context includes a list of subtasks with their statuses, any partial outputs generated, and the specific errors encountered. The prompt's value is in preventing silent data loss and enabling downstream systems or users to act on what succeeded immediately, rather than blocking on a full retry.

Do not use this prompt for single-step tasks where the concept of partial success is meaningless. If your workflow requires atomic all-or-nothing completion with rollback semantics—such as a database transaction or a compliance filing—this pattern is inappropriate and could create an inconsistent state. Similarly, avoid this prompt when the subtasks are tightly coupled and the failure of one step makes the output of successful steps unusable. In those cases, a simple failure response with a full retry mechanism is safer and less confusing for the end user.

Before implementing, map your workflow's dependency graph. Identify which steps are truly independent and can be reported separately. For each step, define a clear success criterion and a structured error object that includes an error code, a human-readable message, and a suggested remediation. This preparation ensures the prompt template's placeholders for [COMPLETED_STEPS], [FAILED_STEPS], and [REMEDIATION_PATHS] are populated with actionable data, not just raw logs. The next section provides the copy-ready template you will wire into your application's error-handling layer.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Graceful Degradation Prompt for Partial Results delivers value and where it introduces risk. Use these cards to decide if this prompt pattern fits your workflow before embedding it in production.

01

Good Fit: Multi-Step Agent Workflows

Use when: your system executes a sequence of independent or loosely coupled steps where partial success is meaningful. Guardrail: design step boundaries so that a failure in step three does not invalidate the completed output of steps one and two. The prompt must receive a clear list of step statuses to summarize.

02

Bad Fit: Atomic Transactions

Avoid when: all steps must succeed or the entire result must be rolled back. Partial results in an atomic workflow create dangerous false confidence. Guardrail: if your system cannot safely expose intermediate state, use a binary success/failure prompt instead and log partial progress internally for debugging only.

03

Required Inputs

What you must provide: a structured list of completed steps with their outputs, a list of failed steps with error reasons, and any remediation options the system can offer. Guardrail: never pass raw stack traces or internal system state to the degradation prompt. Sanitize and summarize failure reasons before the model sees them.

04

Operational Risk: Silent Data Loss

What to watch: the model may omit a failed step from the response, making it appear as though nothing was attempted. Guardrail: include an explicit instruction in the prompt to list every step, even those that failed, and add an eval that checks for the presence of all step IDs in the output. Never let the model decide which failures to disclose.

05

Operational Risk: Over-Promising Remediation

What to watch: the model may invent remediation paths that do not exist in your system, such as suggesting a retry when the failure is permanent. Guardrail: provide a closed list of allowed remediation options in the prompt and instruct the model to select only from that list. Add a validator that rejects any remediation text not matching an allowed option.

06

Operational Risk: Confidence Mismatch

What to watch: the model may present partial results with the same confident tone as complete results, misleading the user about reliability. Guardrail: require the prompt to label the overall response with a completeness indicator such as 'PARTIAL' or 'COMPLETE' and surface that label prominently in the UI. Test with evals that verify the label matches the actual step completion ratio.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A copy-ready system prompt that instructs the model to produce a structured partial-result response when some steps succeed and others fail, with clear separation of completed work, failed steps, and remediation paths.

This template is designed to be pasted directly into your system prompt or task-level instruction block. It forces the model to compartmentalize a multi-step workflow into discrete outcomes, preventing the common failure mode where a single error causes the entire response to be discarded or, worse, where the model silently omits failed steps. Replace every square-bracket placeholder with values specific to your application's workflow, output schema, and risk tolerance before deployment.

text
You are an assistant that executes multi-step workflows and reports results with strict separation of completed and failed steps. You must never silently drop a failed step or fabricate a success.

## WORKFLOW STEPS
[STEP_DEFINITIONS]

## OUTPUT SCHEMA
Return a single JSON object with this exact structure:
{
  "overall_status": "partial_success" | "complete_success" | "complete_failure",
  "completed_steps": [
    {
      "step_id": "string",
      "step_name": "string",
      "result": "object | string",
      "evidence": "string (optional, cite sources or data used)"
    }
  ],
  "failed_steps": [
    {
      "step_id": "string",
      "step_name": "string",
      "failure_reason": "string (specific, actionable, no speculation)",
      "partial_output": "object | string | null (any usable intermediate result)",
      "remediation": "string (concrete next step the user or system can take)"
    }
  ],
  "unattempted_steps": [
    {
      "step_id": "string",
      "step_name": "string",
      "reason_skipped": "string (e.g., dependency failed, blocked by policy)"
    }
  ],
  "summary": "string (one-sentence overall status for logging and user display)"
}

## CONSTRAINTS
- If a step fails, you MUST include it in `failed_steps`. Never move a failed step into `completed_steps`.
- If a step cannot be attempted because a dependency failed, list it in `unattempted_steps` with the blocking step referenced.
- `failure_reason` must describe what went wrong, not why you think it went wrong. Do not guess root causes.
- `remediation` must be a single, actionable instruction. Do not list multiple options unless they are ordered by likelihood of success.
- If all steps succeed, `failed_steps` and `unattempted_steps` must be empty arrays.
- If all steps fail, `completed_steps` must be an empty array.
- Do not include a step in both `completed_steps` and `failed_steps`.

## EXAMPLES
[FEW_SHOT_EXAMPLES]

## TOOLS
[AVAILABLE_TOOLS]

## RISK LEVEL
[RISK_LEVEL: low | medium | high | critical]

## ESCALATION RULES
[ESCALATION_RULES]

To adapt this template, start by replacing [STEP_DEFINITIONS] with a numbered or bulleted list of the discrete steps your workflow performs. Each step must have a stable step_id that your application code can map to a known operation. Next, populate [FEW_SHOT_EXAMPLES] with at least two examples: one showing a partial success with a clear failure reason, and one showing a complete success. If your workflow uses tools, define them in [AVAILABLE_TOOLS] using the exact function signatures your model expects. Set [RISK_LEVEL] to high or critical for workflows where a missed failure could cause downstream data corruption, financial impact, or safety issues—this should trigger additional validation in your harness. Finally, define [ESCALATION_RULES] to specify when the system should stop retrying and request human review, such as when a failed_step has a failure_reason matching a known unrecoverable error pattern.

Before shipping, validate that your application harness can parse this exact JSON structure and that your eval suite checks for the three silent-failure modes this prompt is designed to prevent: a failed step appearing in completed_steps, a failed step being omitted entirely, and an unattempted step being reported as failed rather than skipped. Run adversarial test cases where every step fails, where a middle step fails, and where the input is malformed, and confirm the output schema holds. If your risk level is high or critical, add a human-review gate that surfaces any response where overall_status is not complete_success and the failed_steps array is non-empty.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the Graceful Degradation Prompt. Each placeholder must be populated before the prompt is assembled and sent to the model. Validation notes describe how to check the input at runtime before injection.

PlaceholderPurposeExampleValidation Notes

[ORIGINAL_USER_REQUEST]

The full user request that initiated the multi-step workflow. Preserves original intent for the degradation summary.

Generate a Q3 financial summary, identify top 3 risks, and draft mitigation recommendations.

Non-empty string. Must be logged for traceability. Null or empty triggers an immediate input-validation error before prompt assembly.

[WORKFLOW_STEPS]

An ordered list of all steps in the workflow, each with a unique step ID, description, and expected output type.

[{"step_id":"step-1","description":"Pull Q3 revenue data from data warehouse","output_type":"table"}, {"step_id":"step-2","description":"Calculate quarter-over-quarter growth","output_type":"metrics"}]

Must be a valid JSON array with at least one step. Each step object requires step_id (string), description (string), and output_type (string). Schema check required before injection.

[COMPLETED_STEPS]

A list of steps that succeeded, each containing the step ID, a summary of the result, and the output data.

[{"step_id":"step-1","summary":"Q3 revenue data retrieved. 12,450 rows returned.","output":{"total_revenue":"$4.2M"}}]

Must be a valid JSON array. Can be empty if no steps completed. Each entry requires step_id matching a step in [WORKFLOW_STEPS]. Output field can be null if the step produced no data. Cross-reference step IDs against [WORKFLOW_STEPS].

[FAILED_STEPS]

A list of steps that failed, each containing the step ID, failure reason, and any partial output or error code.

[{"step_id":"step-2","failure_reason":"Data warehouse query timed out after 30s.","error_code":"TIMEOUT","partial_output":null}]

Must be a valid JSON array. Can be empty if no failures. Each entry requires step_id matching a step in [WORKFLOW_STEPS]. failure_reason must be a non-empty string. error_code is optional but recommended for downstream routing.

[REMEDIATION_OPTIONS]

A list of possible next actions the user can take, each with a label and a description of what the action does.

[{"label":"Retry failed steps","description":"Re-run only the failed steps with the same parameters."}, {"label":"Export partial results","description":"Download completed steps as a CSV report."}]

Must be a valid JSON array with at least one option. Each option requires label (string) and description (string). Null or empty array triggers a fallback to a generic 'contact support' option. Validate array length >= 1.

[OUTPUT_SCHEMA]

The expected JSON schema for the degradation response. Defines the structure the model must follow.

{"type":"object","properties":{"status":{"type":"string","enum":["partial_success","complete_failure"]},"completed_summary":{"type":"string"},"failed_summary":{"type":"string"},"remediation":{"type":"array"}},"required":["status","completed_summary","failed_summary","remediation"]}

Must be a valid JSON Schema (draft-07 or later). Required fields must include status, completed_summary, failed_summary, and remediation. Schema parse check required. Invalid schema triggers a pre-flight error.

[CONFIDENCE_THRESHOLD]

The minimum confidence score (0.0 to 1.0) the model must have in its degradation classification. Below this threshold, the response should escalate to human review.

0.85

Must be a float between 0.0 and 1.0. Default to 0.8 if not provided. Values below 0.5 should log a warning. Values above 0.95 may cause excessive escalation. Range check required.

[MAX_REMEDIATION_OPTIONS]

The maximum number of remediation options to present to the user. Prevents overwhelming the user with too many choices.

3

Must be a positive integer. Default to 5 if not provided. Values above 10 should log a warning. Integer parse check required. If [REMEDIATION_OPTIONS] length exceeds this value, the prompt should instruct the model to select the top N most relevant options.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Graceful Degradation Prompt into a multi-step AI application or agent workflow.

This prompt is designed to be called after a multi-step workflow has partially failed. It should not be the primary orchestrator of the workflow itself. Instead, your application code should execute the steps, collect their individual success/failure states and outputs, and then pass that structured summary into this prompt as the [PARTIAL_RESULTS] input. The prompt's job is to format a user-facing message that honestly separates completed work from failed steps and provides clear remediation paths. It is a presentation-layer prompt, not an execution-layer prompt.

To wire this in, build a post-execution handler that constructs the [PARTIAL_RESULTS] object. This object must be a structured list of steps, each containing a step_id, step_name, status (one of completed, failed, or timed_out), output_summary (for completed steps), and error_summary (for failed steps). Your application should never pass raw stack traces to the model; sanitize errors into user-readable summaries first. After the prompt returns, validate the output against a defined [OUTPUT_SCHEMA] that requires a completed_work array, a failed_work array, and a remediation_suggestions array. If validation fails, retry once with a repair prompt that includes the schema violation error. Log every instance of this prompt being triggered, including the input state and the final validated output, to monitor the frequency and types of partial failures in your system.

For high-stakes workflows where partial results could mislead users, insert a human review step before the final message is sent. Route outputs where the number of failed steps exceeds a threshold, or where a critical step has failed, to a review queue. Do not rely solely on this prompt to decide what constitutes a critical failure; that logic belongs in your application's orchestration layer. The model choice here favors models with strong instruction-following and formatting reliability, such as GPT-4o or Claude 3.5 Sonnet. Avoid using smaller, less reliable models for this task, as schema conformance and honest failure disclosure are paramount. The primary failure mode in production is the model omitting a failed step from the failed_work array, effectively hiding the error. Your eval harness must explicitly check that every step with a failed or timed_out status in the input appears in the output's failed_work array.

IMPLEMENTATION TABLE

Expected Output Contract

Defines the exact structure, types, and validation rules for the model's response when a multi-step workflow produces partial results. Use this contract to parse, validate, and route the output in your application harness.

Field or ElementType or FormatRequiredValidation Rule

status

string enum: 'partial_success' | 'full_failure'

Must match one of the allowed enum values exactly. Reject any other status string.

summary

string

Must be a non-empty string (length > 0). Must not contain only whitespace. Should concisely state the overall outcome.

completed_steps

array of objects

Must be a valid JSON array. If empty, must be an empty array [], not null or omitted. Each object must contain 'step_id' (string) and 'result' (any).

completed_steps[].step_id

string

Must be a non-empty string matching a step identifier from the input plan. No fabricated step IDs allowed.

completed_steps[].result

any (string, object, array, number, boolean, null)

Must be present. Use null explicitly if the step completed but produced no data. Do not omit the key.

failed_steps

array of objects

Must be a valid JSON array. If no steps failed, must be an empty array [], not null or omitted.

failed_steps[].step_id

string

Must be a non-empty string matching a step identifier from the input plan. No fabricated step IDs allowed.

failed_steps[].error_reason

string

Must be a non-empty string explaining why the step failed. Must not be a generic message like 'error' or 'failed'.

failed_steps[].remediation

string or null

If a known remediation path exists, provide a non-empty string. If no remediation is possible, use null explicitly. Do not omit the key.

unattempted_steps

array of strings

If present, must be an array of non-empty strings, each matching a step_id from the input plan. If all steps were attempted, this field can be omitted or an empty array.

warnings

array of strings

If present, must be an array of non-empty strings describing non-fatal issues, data quality concerns, or assumptions made. Omit or use empty array if none.

requires_human_review

boolean

Must be true or false. Set to true if any failed step involves high-risk action, data loss, or ambiguous remediation. Application layer should route to a review queue when true.

PRACTICAL GUARDRAILS

Common Failure Modes

When a multi-step workflow returns partial results, these are the most common ways the prompt or system breaks. Each card explains the failure and how to guard against it in production.

01

Silent Data Loss in Failed Steps

What to watch: The model omits failed steps entirely, reporting only successes. Users assume the task completed fully when critical work was dropped. Guardrail: Require an explicit failed_steps array in the output schema. Validate that every input step appears in either completed_steps or failed_steps. Reject responses with missing steps.

02

Fabricated Success for Unrecoverable Steps

What to watch: The model invents plausible results for steps it couldn't actually complete, especially when under pressure to produce a complete-looking response. Guardrail: Add an instruction that empty or null results are preferred over guesses. Use eval assertions that check for fabricated data when ground-truth failure conditions are known.

03

Remediation Paths That Hallucinate Capabilities

What to watch: The model suggests next steps that the system cannot actually perform, such as 'click here to retry' when no retry endpoint exists. Guardrail: Provide a constrained list of valid remediation actions in the prompt. Validate that all suggested remediation paths match the allowed set before displaying to users.

04

Confidence Inflation on Partial Output

What to watch: The model expresses high confidence in the overall response despite individual step failures, misleading downstream systems or users. Guardrail: Require a top-level overall_status field with explicit values like complete, partial, or failed. Suppress confidence language when status is not complete.

05

Context Contamination Between Failed and Successful Steps

What to watch: Error details from a failed step leak into the output of a successful step, or the model conflates results across steps. Guardrail: Structure the output so each step's result is isolated in its own object. Use eval checks that verify step outputs don't contain error messages from other steps.

06

Incomplete Error Attribution

What to watch: The model reports that a step failed but doesn't explain why, leaving operators with no diagnostic information to fix the underlying issue. Guardrail: Require failure_reason and failure_type fields for every failed step. Validate that failure reasons are non-empty and contain actionable detail, not just 'an error occurred'.

IMPLEMENTATION TABLE

Evaluation Rubric

Run these checks on a golden dataset of at least 20 partial-failure scenarios to validate the Graceful Degradation Prompt before shipping.

CriterionPass StandardFailure SignalTest Method

Completed Work Separation

All successfully completed steps appear in the [COMPLETED] section with correct output references

Completed step missing from [COMPLETED] or incorrectly listed under [FAILED]

Parse output sections; diff completed step IDs against known-success inputs in golden dataset

Failed Step Attribution

Every failed step appears in [FAILED] with a specific, non-generic failure reason

Failed step omitted entirely or assigned a fabricated reason not matching the injected error

Inject known tool-call failures; verify each appears with error type matching the injected fault

No Silent Data Loss

No completed output is omitted, overwritten, or merged into a failed step without labeling

Partial result from a completed step appears unlabeled or is silently dropped from the response

Compare total output fields against expected completed-step outputs; flag any missing or unlabeled data

Remediation Path Completeness

Each failed step includes at least one actionable next step in [REMEDIATION] that references the specific failure

Remediation is empty, generic, or suggests retrying without addressing the root cause

Check that [REMEDIATION] contains one entry per failed step with step-specific guidance; reject generic retry-only suggestions

Schema Conformance

Output matches the expected partial-results schema with all required sections present

Missing [COMPLETED], [FAILED], or [REMEDIATION] section; extra fields outside schema; malformed JSON

Validate output against JSON Schema; reject any response missing a required top-level key

No Hallucinated Completions

No step is reported as completed when the injected test condition caused it to fail

Failed step incorrectly appears in [COMPLETED] with fabricated output

Inject deterministic failures; assert zero overlap between [COMPLETED] step IDs and known-failed step IDs

Tone Appropriateness Under Failure

Response maintains neutral, helpful tone without blame, panic, or over-apology

Response contains blame language toward user, system panic phrasing, or excessive apology exceeding one brief acknowledgment

Run tone classifier on failure responses; flag sentiment below neutral threshold or containing predefined blame patterns

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base prompt template and a simple JSON schema for the partial-result envelope. Use a single model call without retry logic. Accept the first valid response or log the failure for manual review.

code
You are handling a multi-step task. Some steps may fail.

[INPUT_STEPS]

Return a JSON object with:
- "completed": [list of completed step IDs and results]
- "failed": [list of failed step IDs, error reasons, and suggested remediation]
- "summary": one-sentence status

If all steps fail, still return the structure with an empty "completed" array.

Watch for

  • Missing schema validation: the model may return prose instead of JSON
  • Overly broad failure reasons that don't help the caller decide next steps
  • Silent data loss when the model omits completed steps to save tokens
  • No distinction between "step not attempted" and "step failed"
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.