This prompt is designed for trust and safety engineers, AI reliability engineers, and compliance reviewers who need to investigate a single production trace where a model unexpectedly refused a valid user request. The core job-to-be-done is not to rewrite your organization's safety policies, but to isolate the precise trigger: a system prompt rule, a safety classifier activation, an input misclassification, or a policy boundary decision. Use this prompt when a user reports a false-positive refusal, an audit flags an over-block, or a monitoring dashboard shows a refusal-rate spike that requires immediate diagnosis. The required context is a complete production trace containing the user input, the full system prompt, any safety classifier scores, and the final model output or refusal message.
Prompt
Unexpected Refusal Diagnosis Prompt

When to Use This Prompt
Isolate the exact trigger that caused a model to refuse a legitimate user request by inspecting a single production trace.
This prompt works by reconstructing the decision path that led to the refusal. It requires you to provide the raw trace data in the [TRACE_DATA] placeholder, which should include the user's original request, the active system prompt, any intermediate safety or policy evaluations, and the final refusal output. The prompt will produce a structured policy decision trace that maps the refusal to its root cause, enabling a concrete decision on whether to adjust the system prompt, tune a classifier threshold, or escalate to a formal policy review. Do not use this prompt for aggregate refusal trend analysis across thousands of sessions or for designing new safety policies from scratch—it is a surgical diagnostic tool for a single incident.
Before running this prompt, ensure you have the complete trace and not just the final user-facing refusal message. A refusal can originate from multiple layers: an explicit rule in the system prompt, a separate safety classifier model, a keyword blocklist, or a misinterpretation of the user's intent. The output will help you distinguish between a correct policy enforcement and a false positive. After diagnosis, the next step is to apply the finding: update the system prompt, adjust a classifier threshold, add the input to an allowlist, or escalate to a policy team if the refusal was correct but the policy itself needs revision. Avoid the temptation to immediately rewrite all safety rules based on a single trace; use this diagnosis as one data point in a broader review cycle.
Use Case Fit
Where the Unexpected Refusal Diagnosis Prompt works and where it introduces risk. Use these cards to decide if this prompt fits your trace review workflow before wiring it into a production harness.
Good Fit: Single-Trace Refusal Forensics
Use when: a trust and safety engineer needs to reconstruct exactly why a single production request was refused. The prompt inspects system instructions, safety filter activations, policy rules, and input classification in one trace. Guardrail: always pair the output with a harness that validates the refusal trigger against known policy rules before closing the incident.
Bad Fit: Aggregate Refusal Trend Analysis
Avoid when: the goal is to compute refusal rates, false-positive trends, or policy coverage across thousands of traces. This prompt is designed for isolated trace diagnosis, not batch aggregation. Guardrail: route aggregate analysis to a separate monitoring pipeline that samples traces and applies statistical thresholds before invoking per-trace review.
Required Inputs: Complete Trace Span Data
Risk: refusal diagnosis fails silently when trace spans are missing—such as redacted safety filter logs, truncated system prompts, or absent classification scores. Guardrail: validate span completeness with a pre-check harness before running the diagnosis prompt. Flag missing spans and refuse to produce a root-cause if critical evidence is absent.
Operational Risk: Over-Trusting the Diagnosis
Risk: engineers may treat the prompt's policy decision trace as authoritative without human review, especially for borderline refusals where the safety filter's classification is ambiguous. Guardrail: require human approval for any refusal diagnosis that changes a policy boundary, updates a safety rule, or reclassifies a previously blocked request as legitimate.
Variant: Policy Rule Change Impact Review
Use when: a policy rule was recently updated and the team needs to replay a previously refused trace against the new rules to determine if the refusal would still occur. Guardrail: run the diagnosis prompt twice—once against the old policy snapshot and once against the new rules—and diff the outputs to surface behavioral changes before deploying the updated policy.
Escalation Path: Unresolved Refusal Triggers
Risk: the prompt may identify a refusal trigger that does not match any documented policy rule, indicating either a model behavior anomaly or a policy gap. Guardrail: escalate unresolved triggers to a policy review queue with the full trace evidence attached. Do not allow the diagnosis to close without a matching policy rule or an explicit decision to create one.
Copy-Ready Prompt Template
A copy-paste prompt for diagnosing why a model refused a legitimate request in a single production trace.
This prompt template is the core diagnostic instrument for investigating an unexpected refusal event. It is designed to be pasted directly into your trace analysis tool, LLM interface, or an internal review harness. The template forces a structured, evidence-based analysis by requiring the model to isolate the refusal trigger, cite the specific policy or instruction that caused it, and recommend a corrective action. Before running, you must replace every square-bracket placeholder with actual trace data extracted from your observability platform. The prompt does not speculate; it works only with the evidence you provide.
textYou are a trust and safety trace auditor. Your task is to diagnose a single production trace where the model refused a request that should have been allowed. You must identify the exact refusal trigger, cite the governing policy or instruction, and recommend a corrective action. Do not speculate beyond the provided trace data. ## INPUT DATA ### SYSTEM PROMPT [SYSTEM_PROMPT] ### SAFETY AND POLICY INSTRUCTIONS [SAFETY_POLICY_INSTRUCTIONS] ### USER INPUT [USER_INPUT] ### RAW MODEL OUTPUT [MODEL_OUTPUT] ### SAFETY FILTER LOG [SAFETY_FILTER_LOG] ### INPUT CLASSIFICATION RESULT [INPUT_CLASSIFICATION] ### TOOL-CALL LOG (IF ANY) [TOOL_CALL_LOG] ## OUTPUT SCHEMA Produce a JSON object with the following structure: { "refusal_detected": true, "refusal_trigger": { "source": "system_prompt | safety_filter | policy_instruction | input_classification | model_self_censorship | unknown", "evidence": "Exact quote or log entry that triggered the refusal.", "policy_rule_cited": "The specific rule, instruction, or filter category that was activated." }, "legitimacy_assessment": { "request_was_legitimate": true, "justification": "Explain why the request should have been allowed, referencing the system prompt's scope and the absence of policy violations." }, "root_cause_analysis": "A concise explanation of the causal chain from input to refusal.", "recommended_action": { "immediate_fix": "e.g., update safety filter rule, rewrite system prompt clause, adjust classification threshold", "target_component": "system_prompt | safety_filter | policy_instructions | input_classifier", "revised_instruction_suggestion": "A draft of the corrected instruction or rule." }, "confidence_score": 0.95 } ## CONSTRAINTS - Base your analysis ONLY on the provided trace data. Do not invent or assume missing information. - If the evidence is ambiguous, set the confidence score accordingly and explain the ambiguity. - The `revised_instruction_suggestion` must be a concrete, actionable change.
To adapt this template, start by extracting the required fields from your production trace. The [SYSTEM_PROMPT] and [SAFETY_POLICY_INSTRUCTIONS] are often found in the request metadata or your prompt management system. The [SAFETY_FILTER_LOG] and [INPUT_CLASSIFICATION] typically come from your model gateway or safety stack logs. If your system does not generate a specific field, replace it with 'NOT AVAILABLE' to signal the gap to the model. After pasting the populated prompt, validate the output by checking that the evidence field contains an exact string match from your input data. If the model's confidence score is below 0.85, treat the diagnosis as inconclusive and escalate for human review. This prompt is a diagnostic tool, not an automated decision-maker; always verify its output against your own policy intent before implementing the recommended action.
Prompt Variables
Each placeholder required by the Unexpected Refusal Diagnosis Prompt, its purpose, a concrete example, and validation rules to ensure the trace analysis is grounded and reproducible.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[TRACE_JSON] | Raw production trace containing user input, system prompt, safety filter activations, policy rules, and model output for a single session. | {"spans": [{"type": "safety_filter", "score": 0.98, "label": "harmful_content"}], "input": "How do I reset my password?"} | Must be valid JSON. Parse check required. Must contain at least one safety filter span or refusal signal. Reject if empty or missing input field. |
[SAFETY_POLICY_DOC] | The current safety policy document defining refusal categories, thresholds, and allowed overrides. | "Refuse requests classified as harmful_content with score > 0.9. Allow password reset assistance." | Must be non-empty string. Human review required before use. Policy version must match trace timestamp. Null allowed only if policy is embedded in system prompt. |
[SYSTEM_PROMPT] | The system prompt active during the traced session, including safety instructions and refusal guidelines. | "You are a helpful assistant. Refuse harmful requests. Assist with account recovery." | Must be non-empty string. Must match the system prompt recorded in [TRACE_JSON]. Version mismatch triggers retry with corrected prompt. |
[REFUSAL_CLASSIFICATION_THRESHOLD] | The minimum safety filter score that triggers an automatic refusal in the production system. | 0.9 | Must be a float between 0.0 and 1.0. Schema check required. Must match the threshold configured in the production environment at trace time. Mismatch invalidates diagnosis. |
[EXPECTED_BEHAVIOR] | The correct system behavior for the user's request category, as defined by policy. | "Assist with account recovery requests. Do not refuse password reset questions." | Must be non-empty string. Must be derived from [SAFETY_POLICY_DOC]. Human approval required for ambiguous categories. Null not allowed. |
[OVERRIDE_RULES] | Rules defining when a human reviewer can override an automated refusal decision. | "Override allowed if refusal category is false_positive and user request is account_recovery." | Must be non-empty string. Must reference categories present in [SAFETY_POLICY_DOC]. Null allowed if no override mechanism exists. Approval required before applying override logic to diagnosis. |
[CONFIDENCE_THRESHOLD] | Minimum confidence score for the diagnosis output to be considered actionable without human review. | 0.85 | Must be a float between 0.0 and 1.0. Schema check required. Diagnosis with confidence below this threshold must be flagged for human review. Retry condition: if confidence < threshold, escalate. |
Implementation Harness Notes
How to wire the Unexpected Refusal Diagnosis Prompt into a production trace analysis workflow.
This prompt is designed to be the first step in a structured triage process, not a standalone report. When a trust and safety engineer flags a trace for review, the application layer should fetch the full trace payload—including the system prompt, user input, safety filter metadata, and any policy evaluation logs—and inject them into the [TRACE_JSON] placeholder. The prompt's output is a structured policy decision trace, which your harness should validate before it reaches a human reviewer or an automated escalation queue.
The implementation harness must enforce three validation gates. First, validate that the output JSON strictly conforms to the expected schema: the refusal_trigger field must be one of the enumerated categories (safety_filter, system_prompt_policy, input_classifier, tool_policy, unknown), and the evidence array must contain at least one trace span ID that can be resolved back to the raw trace data. Second, implement a grounding check: for each evidence span ID, verify that the referenced span exists in the original trace and that its content supports the cited trigger. If the model hallucinates a span ID or misinterprets a policy rule, flag the trace for human review and log the discrepancy. Third, route the validated output based on the refusal_trigger field: safety_filter activations go to the safety engineering queue, system_prompt_policy refusals go to the prompt architecture team, and unknown triggers are escalated with high priority for manual investigation.
For model selection, prefer a model with strong instruction-following and JSON-mode reliability, such as gpt-4o or claude-3-5-sonnet, because the task requires precise extraction over creative generation. Run the prompt with temperature=0 and enable structured output mode if your provider supports it. Log every invocation—including the raw trace input, the model's structured output, and the validation results—to an audit table so that refusal patterns can be aggregated across sessions. Do not use this prompt to automatically override a refusal decision; its purpose is diagnosis and routing, not policy enforcement. The final determination of whether a refusal was correct must remain with a human reviewer who has access to the full trace, the prompt's output, and the validation flags your harness produced.
Expected Output Contract
Fields, types, validation rules, and pass/fail conditions for the Unexpected Refusal Diagnosis Prompt output. Use this contract to parse, validate, and route the model's diagnosis before presenting it to a reviewer or logging it to an observability system.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
refusal_decision | object | Must contain 'classification' (enum: TRUE_POSITIVE | FALSE_POSITIVE | UNCLEAR) and 'confidence' (float 0.0-1.0). Parse check: valid JSON object with both keys present. | |
trigger_attribution | array of objects | Each object must have 'source' (enum: SYSTEM_PROMPT | SAFETY_FILTER | POLICY_RULE | INPUT_CLASSIFIER | UNKNOWN), 'rule_id' (string or null), and 'evidence' (string, non-empty). Array length >= 1. Schema check: no missing required keys. | |
input_classification | object | Must contain 'intent' (string), 'risk_tier' (enum: LOW | MEDIUM | HIGH | CRITICAL), and 'policy_tags' (array of strings). Null allowed for 'policy_tags' only if empty array. Parse check: valid JSON with correct enum values. | |
safety_filter_trace | object | Must contain 'filter_name' (string), 'activation_score' (float 0.0-1.0), 'blocked_output_preview' (string or null), and 'policy_rule_matched' (string or null). Null allowed for 'blocked_output_preview' and 'policy_rule_matched'. Schema check: all keys present, types match. | |
system_prompt_excerpt | string | Non-empty string containing the relevant excerpt from the system prompt that influenced the refusal. Citation check: excerpt must be verifiable against the trace's recorded system prompt version. Length <= 500 characters. | |
refusal_correctness | object | Must contain 'assessment' (enum: CORRECT_REFUSAL | INCORRECT_REFUSAL | UNCERTAIN), 'reasoning' (string, non-empty), and 'recommended_action' (enum: NO_CHANGE | UPDATE_POLICY | ADJUST_THRESHOLD | REVIEW_MANUALLY | ESCALATE). Approval required if 'assessment' is UNCERTAIN or 'recommended_action' is ESCALATE. | |
trace_metadata | object | Must contain 'trace_id' (string, non-empty), 'session_id' (string, non-empty), 'timestamp' (ISO 8601 string), and 'model_version' (string, non-empty). Parse check: valid ISO 8601 timestamp. Retry condition: if 'trace_id' or 'session_id' is missing, do not accept output. |
Common Failure Modes
What breaks first when diagnosing unexpected refusals and how to guard against it.
False Attribution to Safety Policy
What to watch: The model refused due to a benign content classifier mismatch, not a true policy violation. The trace shows a safety filter activation, but the input was misclassified. Guardrail: Always cross-reference the safety classifier's label against the actual input text. Implement a human review step for refusals on low-confidence classifications.
Incomplete Trace Reconstruction
What to watch: The diagnosis prompt receives a partial trace missing the system prompt, safety filter metadata, or input preprocessing steps. The root cause is invisible. Guardrail: Validate trace completeness before running the diagnosis. Require span IDs for system prompt injection, input classification, and policy evaluation steps. Flag missing spans as 'insufficient data' rather than guessing.
Over-Indexing on a Single Signal
What to watch: The prompt latches onto the first safety flag it finds and ignores other contributing factors like ambiguous user phrasing or conflicting system instructions. Guardrail: Structure the output to require a differential diagnosis. Force the prompt to list all candidate triggers, rank them by confidence, and explain why the leading candidate is more likely than alternatives.
Ignoring Instruction Hierarchy Conflicts
What to watch: The refusal was caused by a conflict between the system prompt's behavioral rules and a user's jailbreak attempt, but the trace only logs the final refusal. The diagnosis misses the adversarial pressure. Guardrail: Include instruction hierarchy analysis in the prompt. Require the output to note if the user input attempted to override system-level constraints, even if the refusal was correct.
Normalizing Refusal Without Impact Analysis
What to watch: The diagnosis correctly identifies the refusal trigger but fails to assess whether the refusal was appropriate for the user's legitimate workflow. A technically correct refusal can still be a product failure. Guardrail: Add a 'business impact' field to the output schema. Require the prompt to distinguish between 'policy-correct refusal' and 'false-positive refusal that blocked a valid use case.'
Drift in Refusal Justification Language
What to watch: The model generates a plausible-sounding but factually incorrect explanation for the refusal, hallucinating policy rules that don't exist in the system prompt. Guardrail: Constrain the output to cite specific policy rules or system prompt lines. If no explicit rule matches, the output must state 'No matching policy rule found' rather than inventing one.
Evaluation Rubric
Criteria for testing the quality of the Unexpected Refusal Diagnosis Prompt output before relying on it in production. Each criterion maps to a pass standard, a failure signal, and a test method.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Refusal Trigger Identification | Output correctly identifies the specific policy rule, safety filter, or instruction that caused the refusal. | Output attributes refusal to a generic reason or hallucinates a non-existent policy. | Prepare 10 golden traces with known refusal triggers and measure exact-match accuracy of the trigger field. |
Policy Decision Trace Completeness | Output includes a step-by-step trace from input classification to final refusal decision, with no missing steps. | Trace skips intermediate steps, such as input classification or policy rule evaluation. | Validate trace structure against a defined schema; assert that all required trace nodes are present and non-null. |
False Positive vs. False Negative Classification | Output correctly labels the refusal as a false positive (legitimate request refused) or true positive (correct refusal). | Output labels a true positive as a false positive, or vice versa. | Use a labeled test set of 20 traces with known refusal correctness; measure F1 score for the classification field. |
Evidence Grounding for Trigger | Output cites the exact log line, policy rule ID, or safety filter name that triggered the refusal. | Output provides a trigger explanation without referencing a specific, traceable source from the trace data. | Parse the output for a source citation field; verify that the cited source exists in the input trace and matches the trigger. |
Input Classification Accuracy | Output correctly classifies the user's intent and risk level before the refusal decision. | Output misclassifies the user's intent, leading to an incorrect diagnosis of the refusal reason. | Compare the output's intent label against a pre-labeled intent taxonomy for 15 traces; measure accuracy. |
Safety Filter Activation Justification | If a safety filter activated, the output explains the filter's category, score, and threshold that was breached. | Output mentions a safety filter but fails to provide the category, score, or threshold from the trace. | Assert that the output contains a filter_details object with non-null category, score, and threshold fields when a filter activation is present in the trace. |
Diagnosis Confidence Calibration | Output includes a confidence score that is low for ambiguous traces and high for clear-cut refusal triggers. | Output assigns a high confidence score to an incorrect diagnosis or a uniformly high score regardless of trace complexity. | Calculate Expected Calibration Error (ECE) by binning confidence scores and comparing to actual accuracy on a 50-trace test set. |
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 trace and a lightweight policy description. Focus on getting a clear refusal trigger classification before adding schema enforcement. Replace [POLICY_RULES] with a short bullet list of allowed and disallowed request categories. Run against 5–10 known refusal traces and manually review the trigger classification.
Watch for
- The model inventing policy rules that don't exist
- Overly broad refusal explanations that don't pinpoint the trigger
- Missing input classification steps when the refusal is ambiguous

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