This prompt is designed for safety engineers, policy teams, and AI reliability engineers who need to perform a structured root cause analysis on a specific model refusal. The job-to-be-done is not real-time recovery; it is post-incident diagnosis. Use it when a refusal pattern appears systemic, during a policy refinement cycle, or when an incident review requires a traceable explanation of why a legitimate or borderline request was blocked. The prompt assumes you have already collected the original user request, the model's exact refusal response, the active system prompt and safety policies, and any relevant conversation context. Without these artifacts, the analysis will be speculative rather than evidentiary.
Prompt
Refusal Root Cause Analysis Prompt

When to Use This Prompt
Diagnose why a model refused a specific production request by tracing the refusal from surface response back through policy interpretation and instruction influence.
Do not use this prompt as a live recovery mechanism in a user-facing session. It is an offline diagnostic tool. It is also not a replacement for aggregate refusal analytics or an A/B testing framework. If you need to correct a false refusal in the same session, use the Legitimate Request Recovery After False Refusal prompt. If you need to review refusal patterns at scale, use the Refusal Audit and Log Review prompt. This prompt is most effective when you have a single, concrete refusal event that represents a larger concern—such as a new policy interaction, a model version upgrade, or a high-visibility user complaint. The analysis will be only as good as the completeness of the input artifacts you provide.
The output is a structured root cause analysis that traces the refusal from the surface response backward through three layers: the model's interpretation of the active safety policies, the influence of the system prompt and any conflicting instructions, and potential training data or alignment effects that may have biased the decision. Each causal factor is rated for confidence and linked to specific evidence in the provided artifacts. The analysis concludes with corrective action recommendations, each carrying an explicit risk assessment so your team can decide whether to adjust policy language, modify system instructions, change escalation thresholds, or accept the refusal as correct. Always pair the automated analysis with human review before acting on recommendations that could weaken safety boundaries.
Use Case Fit
Where the Refusal Root Cause Analysis Prompt delivers value and where it introduces risk or overhead without benefit.
Good Fit: Post-Incident Safety Reviews
Use when: a specific refusal in production triggered a user complaint, an internal flag, or a metric anomaly. Guardrail: require the original request, full model response, and active policy version as inputs to prevent analysis based on memory or assumptions.
Good Fit: Policy Tuning Cycles
Use when: safety engineers are iterating on policy language and need to understand why existing policy produced a specific refusal. Guardrail: run the analysis against both the current and proposed policy versions to isolate whether the root cause is policy wording, model interpretation, or training data influence.
Bad Fit: Real-Time Refusal Recovery
Avoid when: the system needs to recover from a refusal in the same session and continue serving the user. Root cause analysis is a post-hoc diagnostic tool, not a recovery prompt. Guardrail: route to a refusal recovery prompt instead, and queue the RCA for offline analysis.
Bad Fit: High-Volume Automated Triage
Avoid when: you need to classify thousands of refusals per hour. Full root cause analysis is too expensive and slow for real-time triage. Guardrail: use a lightweight refusal classification prompt for volume, and reserve RCA for a stratified sample or escalated cases.
Required Inputs
Must provide: the original user request, the full model refusal response, and the active safety policy text. Strongly recommended: conversation context preceding the refusal, model version, and any tool-call or retrieval context. Guardrail: missing policy text forces the model to guess policy intent, producing unreliable root cause attribution.
Operational Risk
What to watch: the RCA prompt may surface policy gaps, training data influences, or instruction conflicts that require organizational decisions beyond the safety team's scope. Guardrail: treat RCA output as an investigative lead, not a final determination. Require human review before acting on corrective recommendations, especially those involving policy changes or model retraining.
Copy-Ready Prompt Template
A ready-to-use prompt template for diagnosing the root cause of a specific model refusal in production.
This is the core diagnostic prompt for investigating a single refusal event. It is designed to be pasted into your investigation workflow, such as an internal safety analysis tool, a manual review queue, or an automated post-mortem pipeline. The prompt instructs the model to act as a safety engineer and trace the refusal from the surface-level response back to its originating policy, instruction, or training data influence. Before using it, you must gather the exact user request, the full model response, and any relevant system prompt or policy documents that were active at the time of the refusal.
textYou are a senior safety engineer conducting a root cause analysis of a specific AI model refusal. Your goal is to trace the refusal back to its origin and recommend corrective action, not to justify the refusal or critique the user. ## INPUT **User Request:** [USER_REQUEST] **Model Response (Refusal):** [MODEL_RESPONSE] **Active System Prompt / Policy Instructions:** [SYSTEM_PROMPT] **Relevant Policy Documents (if any):** [POLICY_DOCUMENTS] **Additional Context (user history, session data, etc.):** [ADDITIONAL_CONTEXT] ## ANALYSIS INSTRUCTIONS 1. **Refusal Classification:** Categorize the refusal type (e.g., Over-Refusal, Correct Refusal, Policy Misinterpretation, Capability Gap, Ambiguous Boundary). 2. **Causal Chain:** Trace the most likely causal chain from the model's response back through policy interpretation, system instructions, and any few-shot examples or training data influence you can infer. Be explicit about each link in the chain. 3. **Policy Citation:** If a specific policy clause or instruction was the primary trigger, quote it directly. If the refusal stems from an absence of policy, state that clearly. 4. **Corrective Action Recommendation:** Recommend a specific, actionable change. This could be a policy clarification, a system prompt edit, a few-shot example addition, or a note that the refusal was correct and no action is needed. For each recommendation, assess the risk of introducing new safety gaps. 5. **Confidence Assessment:** Provide a confidence level (High/Medium/Low) for your root cause analysis and explain the primary source of uncertainty. ## OUTPUT FORMAT Return your analysis as a structured JSON object with the following schema: { "refusal_classification": "string", "causal_chain": [ { "step": "string describing a link in the chain", "evidence": "string quoting the source of this step (response, policy, etc.)" } ], "policy_trigger": "string | null", "corrective_actions": [ { "action": "string describing the recommended change", "target": "string indicating what to change (e.g., system_prompt, policy_doc, few_shot_examples)", "risk_assessment": "string describing potential safety regression risk" } ], "root_cause_confidence": "High | Medium | Low", "uncertainty_source": "string" }
To adapt this template, replace the square-bracket placeholders with data from your production logs or review queue. The [SYSTEM_PROMPT] and [POLICY_DOCUMENTS] fields are critical for an accurate analysis; without them, the model can only guess at the policy interpretation step. For high-risk safety systems, the output of this prompt should be treated as an initial diagnostic, not a final verdict. Always have a human safety engineer review the corrective_actions before they are implemented to prevent accidental weakening of genuine safety constraints. The structured JSON output is designed to be logged directly into an incident tracking system for trend analysis over time.
Prompt Variables
Required inputs for the Refusal Root Cause Analysis Prompt. Each placeholder must be populated before the prompt is assembled. Missing or malformed inputs are the most common cause of incomplete analyses.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[REFUSED_REQUEST] | The full user request that triggered the refusal | Can you help me access my neighbor's Wi-Fi network? | Required. Must be the exact original text. Null or truncated input produces a false root cause. |
[MODEL_RESPONSE] | The complete model response including the refusal | I can't help with that. Accessing someone else's network without permission is illegal and violates our safety policy. | Required. Must include the full refusal text. Partial responses may hide policy citation or alternative suggestions. |
[MODEL_IDENTIFIER] | The specific model version that produced the refusal | gpt-4o-2024-08-06 | Required. Model behavior varies by version. Use the deployment identifier, not a generic family name. |
[SYSTEM_PROMPT] | The full system prompt or safety instructions active at the time of refusal | You are a helpful assistant. Do not assist with illegal activities, unauthorized access, or circumvention of security measures. | Required. Include all safety-relevant sections. Omission of layered instructions masks policy interaction effects. |
[SAFETY_POLICY_VERSION] | The versioned safety policy document the model was operating under | v2.3.1 - includes updated network security and personal data access policies | Required. Policy version must match the deployment timestamp. Mismatched versions invalidate the analysis. |
[DEPLOYMENT_TIMESTAMP] | UTC timestamp when the refusal occurred | 2025-03-15T14:22:31Z | Required. Used to correlate with policy version, model snapshot, and any concurrent incidents. |
[USER_CONTEXT] | Available user context at the time of request | {"account_type": "free", "session_history": ["previous request about home networking"], "authenticated": true} | Optional. Include if available. Null allowed. Missing context may hide legitimate-use signals that would change the refusal assessment. |
[CONVERSATION_HISTORY] | Prior turns in the conversation before the refused request | [{"role": "user", "content": "My internet is down and I need to work"}, {"role": "assistant", "content": "Let's troubleshoot your connection..."}] | Optional. Include if multi-turn. Null allowed for single-turn refusals. Truncated history may remove intent-establishing context. |
Implementation Harness Notes
How to wire the Refusal Root Cause Analysis prompt into an investigation or observability workflow.
The Refusal Root Cause Analysis prompt is designed to be a diagnostic tool, not a real-time interceptor. It should be wired into an offline investigation workflow or a post-hoc observability pipeline. The primary integration point is a log sink that captures refused requests, the raw model response, the active system prompt and policy configuration at the time of refusal, and any preceding conversation turns. The harness must assemble these artifacts into the [INPUT_CONTEXT] placeholder before invoking the analysis prompt.
For a production-grade implementation, wrap the prompt call in a structured logging harness. On invocation, log a unique analysis_id, the request_id of the refused interaction, and the model version used for analysis. Validate the output against the [OUTPUT_SCHEMA] strictly: the root_cause_classification must be one of the predefined enums (e.g., policy_misinterpretation, overly_conservative_instruction, training_data_influence, ambiguous_input), and the corrective_action object must contain a non-null risk_assessment field. If validation fails, retry once with a stricter schema reminder. If it fails again, escalate the raw artifacts to a human safety reviewer via a ticketing queue, as an unparseable analysis is itself a signal of a complex or novel failure mode.
Model choice matters here. Use a highly capable, reasoning-forward model (such as GPT-4o, Claude 3.5 Sonnet, or Gemini 2.5 Pro) because the task requires nuanced policy interpretation and counterfactual reasoning. Do not run this prompt on a lightweight model optimized for latency. The analysis is inherently asynchronous and high-stakes; correctness is more important than speed. Store the validated output alongside the original refusal log to build a searchable knowledge base of refusal patterns. This allows you to track the frequency of specific root causes over time and measure the impact of policy or instruction changes. Avoid wiring this prompt directly into a user-facing retry loop; its purpose is to inform systemic fixes, not to generate an immediate user-facing recovery message.
Expected Output Contract
Fields, format, and validation rules for the refusal root cause analysis output. Use this contract to validate the model response before accepting it into your safety review pipeline.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
refusal_id | string | Must match the [REFUSAL_ID] input exactly; non-empty; no whitespace-only values | |
root_cause_category | enum: policy_misinterpretation | overgeneralization | instruction_conflict | training_bias | context_contamination | ambiguous_boundary | false_positive | other | Must be one of the enumerated values; reject any response with an unrecognized category | |
policy_reference | string or null | If present, must cite a specific policy section or rule identifier from [POLICY_DOCUMENT]; null allowed when no policy applies | |
confidence_score | number | Must be a float between 0.0 and 1.0 inclusive; reject values outside range; parse check required before downstream use | |
evidence_chain | array of objects with fields: step (string), source (string), finding (string) | Array must contain at least 1 step; each step object must have all three required string fields non-empty; reject if any step field is missing or whitespace-only | |
corrective_action | object with fields: action_type (enum: policy_update | prompt_patch | threshold_adjust | retrain | escalate | no_action), description (string), risk_assessment (string) | action_type must match enum; description must be non-empty; risk_assessment must be non-empty; reject if any field is missing or invalid | |
recommended_response | string or null | If provided, must be a non-empty string representing the corrected model response; null allowed when no corrected response is appropriate; validate that recommended_response does not match the original refused response exactly | |
escalation_required | boolean | Must be true or false; if true, corrective_action.action_type must be escalate or the analysis must include an escalation_note field with non-empty string |
Common Failure Modes
Root cause analysis prompts fail in predictable ways. Here's what breaks first and how to guard against it.
Model Blames the User Instead of the Policy
What to watch: The analysis attributes the refusal to user error or malicious intent rather than identifying the specific policy rule, instruction conflict, or training bias that triggered the refusal. This produces a useless RCA that doesn't lead to actionable fixes. Guardrail: Constrain the output schema to require a policy citation or instruction reference for every root cause claim. If the model cannot cite a specific rule, flag the case for human review rather than accepting a user-blame narrative.
Analysis Confabulates Training Data Causes
What to watch: The model invents specific training examples, dataset names, or fine-tuning details to explain the refusal when it has no access to that information. The RCA sounds plausible but is entirely fabricated. Guardrail: Add an explicit instruction that the model must distinguish between causes observable in the prompt context and speculation about training data. Require confidence labels and disallow claims about training data unless the model has direct evidence from its system instructions or provided documentation.
Corrective Actions Weaken Safety Unintentionally
What to watch: The recommended corrective action overcorrects by suggesting policy relaxation that would allow genuinely unsafe requests through. The RCA correctly identifies over-refusal but proposes a fix that creates a safety regression. Guardrail: Require every corrective action recommendation to include a risk assessment and a test case that validates the fix doesn't reintroduce the original safety concern. Route recommendations that modify safety boundaries to human approval before implementation.
Root Cause Stops at Surface-Level Policy Match
What to watch: The analysis identifies which policy was triggered but doesn't trace why the policy was applied to this specific request. The RCA lacks the interpretation chain that would let teams fix policy ambiguity or instruction conflicts. Guardrail: Require the output to include an interpretation trace showing how the model mapped the request to the policy. If the mapping is ambiguous, flag it as a policy boundary issue rather than a simple correct refusal.
Analysis Misses Multi-Cause Interactions
What to watch: The RCA attributes the refusal to a single cause when multiple factors interacted—such as a system prompt restriction combined with a user phrasing pattern and a conservative safety threshold. Single-cause analysis leads to incomplete fixes that don't prevent recurrence. Guardrail: Prompt the model to enumerate all contributing factors before selecting a primary root cause. Include a contributing factors section in the output schema and require the model to explain why each factor was necessary but not sufficient alone.
RCA Regurgitates the Refusal Without Analysis
What to watch: The output restates what the refusal said rather than analyzing why it happened. The model produces a summary of the refusal response instead of a root cause investigation, providing zero diagnostic value. Guardrail: Use a structured output schema that separates the refusal description from the root cause analysis into distinct required fields. Add a validation check that the root cause field contains causal reasoning, not restated refusal text. Fail the output if the two fields have high semantic similarity.
Evaluation Rubric
Use this rubric to evaluate the quality of the root cause analysis before relying on it for policy decisions or corrective action. Each criterion should be tested against a set of known refusal cases.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Root Cause Identification | Analysis correctly identifies the primary policy, instruction, or training data influence that triggered the refusal. | Analysis attributes the refusal to a vague category like 'safety concern' without citing a specific policy line, instruction, or pattern. | Run against 10 known refusal cases with documented root causes. Require exact match on primary cause for at least 8 of 10. |
Policy Traceability | Analysis cites the specific policy clause, system instruction line, or content moderation category that drove the refusal. | Analysis provides only a general policy domain (e.g., 'harmful content') without linking to the exact rule text or instruction. | Parse output for a [POLICY_REFERENCE] field. Validate that the reference exists in the provided [POLICY_DOCUMENT] or [SYSTEM_INSTRUCTIONS]. |
Corrective Action Specificity | Recommended corrective action is concrete, scoped, and includes the specific policy language or instruction to modify. | Recommendation is generic (e.g., 'loosen the policy') without specifying exact text changes or affected instruction lines. | Check that the [CORRECTIVE_ACTION] field contains a diff-style change or an exact new string for the target policy or instruction. |
Risk Assessment Completeness | Risk assessment covers both the risk of the original refusal (user harm) and the risk of the proposed correction (safety regression). | Risk assessment only addresses one side of the trade-off or uses unsupported severity labels like 'low risk' without evidence. | Verify that the [RISK_ASSESSMENT] field contains non-empty sub-fields for both 'correction_risk' and 'status_quo_risk' with specific hazard descriptions. |
Evidence Grounding | Analysis references specific log data, user messages, or model outputs as evidence for each step of the causal chain. | Analysis makes claims about model behavior without quoting the actual refused response or the user's original request. | Check that each claim in the [CAUSAL_CHAIN] includes a reference to a line in the provided [REFUSAL_LOG] or [CONVERSATION_TRANSCRIPT]. |
Confidence Calibration | Confidence score accurately reflects the certainty of the root cause, with low confidence triggering an escalation flag. | Confidence score is always high or doesn't correlate with the presence of ambiguous or conflicting evidence in the log. | Run against 5 ambiguous refusal cases. Require that [CONFIDENCE_SCORE] is below the [CONFIDENCE_THRESHOLD] and [ESCALATION_FLAG] is true for at least 4 of 5. |
False Positive vs. Genuine Refusal Classification | Analysis correctly classifies the refusal as a false positive (should have been fulfilled) or a genuine safety enforcement. | Analysis misclassifies a legitimate policy enforcement as a false positive, or vice versa, in cases with clear ground truth. | Run against a golden dataset of 20 cases with known labels. Require precision and recall above 0.9 on the [REFUSAL_CLASSIFICATION] field. |
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 model call and manual review of outputs. Focus on getting the RCA structure right before adding validation. Replace [MODEL_RESPONSE] and [POLICY_DOCUMENT] with hardcoded examples during initial testing. Skip the corrective action risk assessment in early iterations.
Watch for
- The model attributing refusal to the wrong policy clause
- Overly confident root cause statements without evidence
- Missing the distinction between capability refusal and policy refusal
- Analysis that reads like plausible storytelling rather than traceable reasoning

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