This prompt is designed for technical writers and support engineers who need to produce a consistent, structured resolution procedure for a specific, known error code. The core job-to-be-done is transforming a defined error condition and its diagnostic surface area into a step-by-step guide that includes prerequisite checks, diagnostic commands, fix actions, and verification steps. It is ideal for teams maintaining a service catalog where every error code must map to a single, reviewable source of truth for remediation.
Prompt
Resolution Step Drafting Prompt for Troubleshooting Guides

When to Use This Prompt
Defines the ideal job-to-be-done, required context, and clear boundaries for using the resolution step drafting prompt.
Use this prompt when you have a well-defined error code, its triggering context, and knowledge of the system's diagnostic tools. The prompt template requires you to provide the error code, a description of the system context, and a list of available diagnostic commands or tools. It is not suitable for open-ended debugging sessions where the error surface is unknown, nor for generating runbooks that execute automated remediation scripts without human approval. The prompt includes explicit safety constraints to prevent the generation of destructive or irreversible instructions, such as database drops or filesystem wipes, without flagging them for mandatory human review.
Before using this prompt, ensure you have gathered the specific error code string, a clear description of the service or component where it occurs, and the approved set of diagnostic tools available to operators. The output will be a structured, markdown-formatted procedure that you should always review for technical accuracy and safety before publishing. Do not use this prompt to generate runbooks for fully automated remediation systems where no human is in the loop to approve high-risk actions.
Use Case Fit
Where the Resolution Step Drafting Prompt delivers reliable, actionable troubleshooting guides—and where it introduces operational risk that requires a different approach.
Good Fit: Structured Error Catalogs
Use when: you have a defined error code catalog with known causes, HTTP status codes, and diagnostic commands. The prompt excels at transforming structured error references into step-by-step resolution procedures with prerequisite checks and verification steps. Guardrail: validate that every generated step references a real diagnostic command or API endpoint that exists in your system.
Bad Fit: Undocumented or Novel Errors
Avoid when: the error condition is newly discovered, lacks root cause analysis, or has no established remediation path. The prompt will hallucinate plausible-sounding but untested fix actions. Guardrail: require human engineering review and reproduction of the error before allowing resolution steps to be published. Never draft steps for errors you cannot reproduce.
Required Inputs
Must provide: error code, full error body or message, HTTP status code, known common causes, available diagnostic commands or endpoints, and the target audience's technical level. Guardrail: if any required input is missing, the prompt should refuse to generate steps rather than invent plausible diagnostics. Build a pre-flight input validator that blocks generation when critical fields are null.
Operational Risk: Destructive Actions
Risk: generated steps may include database modifications, infrastructure changes, or data deletion commands that are irreversible. Guardrail: implement a destructive-action classifier that flags steps containing keywords like DROP, DELETE, rm -rf, or purge. Any flagged step must route to a human approval queue with a mandatory peer review before publication.
Operational Risk: Stale Procedures
Risk: resolution steps drift from reality as APIs, configs, and tooling change. A previously correct diagnostic command may break silently. Guardrail: attach a last_validated_date and source_commit_hash to every generated guide. Schedule automated re-validation that executes diagnostic commands in a sandbox and flags guides where commands fail or outputs differ from expected results.
Escalation Boundary
Risk: the prompt may generate steps that exceed the intended audience's permissions or expertise, leading to failed remediation or security incidents. Guardrail: define a maximum privilege level per audience tier in the prompt constraints. When a step requires elevated permissions, the prompt must insert an explicit escalation gate: 'If you lack [PERMISSION], escalate to [TEAM] before proceeding.'
Copy-Ready Prompt Template
A reusable prompt template for generating safe, step-by-step resolution procedures for a given error code.
This is the core prompt template for drafting a troubleshooting guide. It is designed to be copied directly into your prompt engineering environment or application code. The template uses square-bracket placeholders for all dynamic inputs, such as the error code, its technical description, and the target audience. Before using this prompt, you must have a clear understanding of the error's root cause and the system's architecture to populate the placeholders accurately. The prompt's primary directive is to generate actionable steps while enforcing strict safety checks to prevent the model from suggesting destructive or irreversible commands.
markdownYou are a senior technical writer and SRE creating a troubleshooting guide for an internal developer audience. Your task is to generate a step-by-step resolution procedure for the error code [ERROR_CODE]. ## Error Context - **Error Code:** [ERROR_CODE] - **Error Message:** [ERROR_MESSAGE] - **Technical Description:** [TECHNICAL_DESCRIPTION] - **Common Root Causes:** [COMMON_ROOT_CAUSES] - **Affected Service/Component:** [AFFECTED_COMPONENT] - **Target Audience:** [TARGET_AUDIENCE] (e.g., on-call SRE, support engineer, end-user) ## Safety Constraints (CRITICAL) You must adhere to the following rules. Violating them could cause a production outage. - **NEVER** suggest commands that are irreversible, destructive, or lead to data loss (e.g., `DROP TABLE`, `rm -rf`, `DELETE` without a `WHERE` clause, `purge` commands). - **ALWAYS** include a prerequisite step to verify the environment, context, or impact before any fix action. - **ALWAYS** recommend backing up relevant state or data before a state-changing action. - If a safe automated fix is not possible, explicitly state that manual intervention or escalation is required. - Prefix any command that changes state with a warning and a confirmation prompt. ## Output Structure Generate the resolution guide using the following strict structure: ### 1. Diagnostic Check [Provide a specific command, log query, or metric check to confirm the error's root cause.] ### 2. Prerequisites - [List any required permissions, tools, or access.] - [State any conditions that must be true before proceeding.] ### 3. Resolution Steps [Provide a numbered list of steps. For each step, include:] - **Action:** [What to do, with exact commands or UI navigation.] - **Expected Result:** [What the user should see if the action succeeds.] - **If Failure:** [What to do if the step fails, e.g., rollback, check a different path, or escalate.] ### 4. Verification [Provide a specific command, query, or check to confirm the issue is fully resolved and the system is stable.] ### 5. Escalation Path [If the above steps do not resolve the issue, specify the exact team, runbook link, or on-call rotation to contact.]
To adapt this template, replace each [PLACEHOLDER] with the specific details of the error you are documenting. The [COMMON_ROOT_CAUSES] placeholder is critical for guiding the model toward the correct diagnostic checks. For high-risk production environments, you should add a final validation step in your application harness that scans the generated output for forbidden destructive commands before it is published. The next section details how to wire this prompt into a reliable documentation generation pipeline.
Prompt Variables
Each variable must be populated before sending the prompt to the model. Validation checks ensure the prompt receives complete, safe, and well-scoped inputs for generating resolution steps.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[ERROR_CODE] | The specific error identifier to resolve | ERR_RATE_LIMIT_EXCEEDED | Must match the documented error catalog format. Reject if null or empty. Check against known error code taxonomy. |
[ERROR_DESCRIPTION] | The full error message or body returned to the user | {"error":"Too Many Requests","retry_after_ms":5000} | Must be a non-empty string or valid JSON object. Truncate if exceeds 2000 characters to avoid context pollution. |
[SYSTEM_CONTEXT] | Relevant infrastructure details: service name, environment, deployment region | payment-service, production, us-east-1 | Must include at minimum service name and environment. Reject if 'production' is missing when resolution steps include destructive actions; require human approval flag. |
[USER_ROLE] | The persona executing the steps: developer, support engineer, SRE, or end-user | support_engineer | Must be one of the allowed enum values. Determines tool access and command privilege level in generated steps. Default to 'developer' if unknown. |
[DIAGNOSTIC_TOOLS] | Available tools and commands the user can run | ["kubectl", "aws-cli", "curl", "internal-dashboard"] | Must be a non-empty array of strings. Generated steps must only reference tools in this list. Reject if list contains tools that could cause data loss without explicit approval. |
[KNOWN_CAUSES] | Pre-classified root cause categories for this error | ["upstream_timeout", "quota_exhausted", "invalid_scope"] | Optional array. If provided, resolution steps must address each cause or explicitly state when a cause requires escalation. Null allowed. |
[DESTRUCTIVE_ACTIONS_ALLOWED] | Whether the user is permitted to run commands that modify state or delete data | Must be boolean. If true, add a confirmation gate before any destructive step. If false or null, generated steps must be read-only diagnostic or configuration checks only. | |
[OUTPUT_FORMAT] | Desired structure for the resolution steps | numbered_list_with_prerequisites | Must be one of: 'numbered_list_with_prerequisites', 'decision_tree', 'runbook_markdown'. Default to 'numbered_list_with_prerequisites' if not specified. |
Implementation Harness Notes
How to wire the resolution step drafting prompt into a production documentation pipeline with validation, safety checks, and human review gates.
The resolution step drafting prompt is designed to be embedded in a documentation generation pipeline, not used as a standalone chat interface. The typical integration pattern places this prompt after error code extraction and classification stages, feeding it a structured error object that includes the error code, HTTP status, common causes, and any diagnostic context already gathered. The prompt produces a complete resolution procedure, which then passes through automated validation before reaching a human technical reviewer. This pipeline approach ensures that every resolution step is traceable to a specific error code and that no destructive or irreversible instructions reach end users without explicit approval.
The implementation harness should enforce several critical safety and quality checks. Pre-generation validation must verify that the input contains all required fields: [ERROR_CODE], [ERROR_CONTEXT], [SYSTEM_ARCHITECTURE], and [DESTRUCTIVE_ACTIONS_BLOCKLIST]. Missing fields should halt the pipeline and return a clear error to the upstream system. Post-generation validation must scan the output for any commands matching the blocklist (e.g., rm -rf, DROP TABLE, DELETE FROM, irreversible configuration changes) and flag them for mandatory human review. Additionally, a schema validator should confirm that each resolution step includes the required fields: step_number, action_description, expected_output, verification_command, and safety_level. Steps missing verification commands or marked as safety_level: destructive should be routed to a review queue rather than published directly. Logging should capture the prompt version, model used, input error code, and validation results for audit trails.
For model selection, use a capable instruction-following model with strong reasoning and safety awareness. The prompt works well with Claude 3.5 Sonnet or GPT-4o when structured output mode is enabled. Avoid smaller or older models that may hallucinate dangerous commands or skip verification steps. Implement a retry strategy with exponential backoff for transient failures, but cap retries at three attempts. If the model consistently produces outputs that fail validation, escalate to a human writer rather than silently accepting degraded quality. The final integration step should store validated resolution procedures in your documentation system with metadata linking them to the source error code, the prompt version used, the reviewer identity, and the approval timestamp. This creates an auditable chain from error code definition to published remediation guidance.
Expected Output Contract
Fields, format, and validation rules for the generated resolution procedure. Use this contract to parse, validate, and integrate the model output into a troubleshooting guide or runbook system.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
resolution_id | string (slug) | Must match pattern ^[a-z0-9]+(?:-[a-z0-9]+)*$. Must be unique within the error code catalog. | |
error_code | string | Must match a known error code from the input catalog. Reject if code is not in the provided [ERROR_CODE_LIST]. | |
title | string | Must be a single sentence under 120 characters. Must contain the error code and a brief outcome description. | |
prerequisites | array of objects | Each object must have 'description' (string) and 'verification_command' (string or null). Array must contain at least 1 item. Null verification_command allowed when check is manual. | |
diagnostic_steps | array of objects | Each object must have 'step_number' (integer), 'command' (string), 'expected_output' (string), and 'interpretation' (string). Array must contain at least 1 item. Step numbers must be sequential starting from 1. | |
fix_actions | array of objects | Each object must have 'action_type' (enum: reversible, irreversible, manual_approval_required), 'command' (string or null), 'description' (string), and 'rollback_command' (string or null). rollback_command is required when action_type is irreversible. Array must contain at least 1 item. | |
verification_steps | array of strings | Each string must describe a testable check. Array must contain at least 1 item. First step must verify the original error no longer occurs. | |
safety_warnings | array of strings | If present, each string must describe a specific risk. Required when any fix_action has action_type irreversible or manual_approval_required. |
Common Failure Modes
Resolution step drafting fails in predictable ways when the prompt lacks safety boundaries, context constraints, or verification checkpoints. These cards cover the most common failure modes and how to prevent them before a destructive instruction reaches a user.
Destructive or Irreversible Instructions
What to watch: The model generates resolution steps that include rm -rf, DROP TABLE, DELETE without backups, or irreversible config changes without confirmation gates. This happens when the prompt does not explicitly forbid destructive actions or require confirmation checkpoints. Guardrail: Add a hard constraint in the prompt: 'Before any destructive or irreversible step, insert a [CONFIRMATION REQUIRED] checkpoint describing the exact impact and asking for explicit user approval.' Validate output with a regex scan for known dangerous commands.
Environment Assumption Drift
What to watch: The model assumes a specific OS, shell, cloud provider, or version without being told, producing steps that fail or cause harm in the user's actual environment (e.g., apt-get on a RHEL system, or us-east-1 ARNs for an eu-west-1 deployment). Guardrail: Require the prompt to accept an [ENVIRONMENT_CONTEXT] input block specifying OS, runtime versions, cloud provider, and region. Instruct the model to refuse to generate steps when environment context is missing and to qualify every command with the target environment.
Missing Verification Steps
What to watch: The model produces a sequence of fix actions but never tells the user how to confirm the fix worked. Users apply changes blindly and cannot tell if the problem is resolved, partially fixed, or worsened. Guardrail: Structure the prompt to require a 'Verification' section after every resolution procedure. This section must include specific exit codes, expected output, or observable state changes that confirm success. Add an eval check that rejects outputs without a verification block.
Privilege Escalation Without Warning
What to watch: The model silently includes sudo, root, or --admin flags in commands without explaining why elevated privileges are needed or what the scope of access is. This normalizes risky behavior for users who may not understand the implications. Guardrail: Add a constraint: 'When any step requires elevated privileges, prefix it with a [PRIVILEGE REQUIRED] notice explaining exactly why elevated access is necessary and what system scope is affected.' Test outputs for privilege escalation without corresponding notices.
Hallucinated Error Codes or Log Patterns
What to watch: The model invents plausible-sounding error codes, log messages, or diagnostic output that do not exist in the actual system. Users waste time searching for fabricated strings. This is especially common when the prompt does not ground the model in real error catalogs. Guardrail: Provide a [KNOWN_ERROR_CATALOG] input with verified error codes and log patterns. Instruct the model to only reference errors from this catalog and to output [UNKNOWN ERROR] when a match cannot be found, rather than guessing.
Out-of-Order Dependency Execution
What to watch: The model lists resolution steps in an order that violates dependencies—checking a service's status after restarting it, or validating a config change before applying it. Users follow the steps sequentially and hit failures mid-procedure. Guardrail: Add a prompt instruction: 'Before finalizing the step sequence, verify that each step's prerequisites are satisfied by a prior step. If a step depends on an action not yet performed, reorder or insert the missing prerequisite.' Include a dependency-check eval that flags impossible orderings.
Evaluation Rubric
Score each generated resolution procedure against these criteria. A procedure must score 80 or above to pass automated gates and proceed to human review.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Actionability | Every step contains a concrete command, check, or action a user can execute | Vague instructions like 'check the configuration' without specifying which file or command | LLM Judge: binary pass/fail per step; aggregate score = (actionable steps / total steps) * 100 |
Safety Gate Presence | Destructive or irreversible steps (delete, drop, revoke, format) are preceded by an explicit confirmation gate and rollback instruction | A destructive command appears without a preceding warning, confirmation prompt, or backup step | Regex scan for destructive keywords; LLM Judge verifies each flagged step has a preceding safety sentence |
Prerequisite Completeness | All required permissions, tool versions, access levels, and system states are listed before the first action step | Step 1 assumes the user is root, has an API key, or is in a specific directory without stating it | Schema check: [PREREQUISITES] array must contain at least one entry for permission, tooling, and state |
Verification Step | Each resolution block ends with a concrete verification command and the expected success output | Procedure ends after the fix action with no way to confirm the problem is resolved | LLM Judge: checks that the final step in each [RESOLUTION_BLOCK] contains a verification command and expected result |
Error Code Alignment | The procedure addresses the exact error code and message specified in [ERROR_CODE] and [ERROR_MESSAGE] | Procedure describes a generic fix for the symptom but never references the specific error code | Keyword match: [ERROR_CODE] string must appear in the procedure; LLM Judge confirms semantic alignment |
Diagnostic Depth | Procedure includes at least one diagnostic command that gathers system state before suggesting a fix | Procedure jumps directly to a fix without any diagnostic or information-gathering step | Schema check: [DIAGNOSTIC_STEPS] array is non-empty and each entry has a command field |
Rollback Coverage | For any step that modifies state, a corresponding rollback or undo instruction is provided | A configuration change, database migration, or file edit is suggested with no way to revert | LLM Judge: for each state-mutating step, verify a paired rollback instruction exists in the same [RESOLUTION_BLOCK] |
Tone and Clarity | Language is calm, direct, and free of blame, jargon without explanation, or panic-inducing phrasing | Phrases like 'you broke this', 'urgent critical failure', or unexplained acronyms appear | LLM Judge: 1-5 Likert scale on professionalism and clarity; pass threshold >= 4 |
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 frontier model (GPT-4o, Claude 3.5 Sonnet) and minimal validation. Replace [ERROR_CODE] and [SYSTEM_CONTEXT] with hardcoded values for initial testing. Skip the schema enforcement wrapper and review the output manually.
Watch for
- Steps that skip prerequisite checks
- Commands that assume a specific OS or shell
- Missing verification steps at the end of the procedure

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