This prompt is designed for a single, high-stakes job: refusing to answer a user's query when the available evidence is insufficient, while simultaneously preserving the full context of the interaction and generating a structured handoff payload for a human domain expert. The ideal user is an AI application builder integrating a model into a product where an incorrect or speculative answer carries significant cost—such as in clinical review, legal analysis, or financial audit workflows. The core assumption is that your application already has a defined expert routing path (e.g., a ticket queue, an escalation API, or a review dashboard). If that path does not exist, this prompt will generate a referral that leads nowhere, damaging user trust.
Prompt
Refusal with Domain Expert Referral Prompt

When to Use This Prompt
Defines the high-stakes job-to-be-done, the required infrastructure, and the boundaries for using a refusal prompt that routes users to a domain expert.
You should use this prompt when the cost of a wrong answer is unacceptably high and your system can actually deliver on the promise of a human follow-up. For example, in a healthcare setting, if a model cannot ground a treatment-related answer in provided clinical guidelines, it should not guess. Instead, it must refuse, explain that the evidence is insufficient, and format a handoff that includes the patient's original question, relevant context, and the specific evidence gap. This prompt is not for low-stakes chitchat, general knowledge Q&A where a simple 'I don't know' suffices, or systems that lack an operational expert escalation capability. Using it in those scenarios will create a frustrating user experience by promising a human review that will never happen.
Before implementing this prompt, you must confirm three prerequisites. First, you need a defined evidence sufficiency threshold; the prompt should only trigger when your retrieval or grounding system scores confidence below this bar. Second, you must have a downstream integration point, such as a webhook or API, that can receive the structured handoff payload and create a ticket. Third, you must establish a monitoring loop to track the rate of refusals and expert referrals, as a sudden spike can indicate a retrieval pipeline failure or a knowledge base gap. The next step is to adapt the prompt template in the following section, replacing placeholders with your specific domain taxonomy, routing instructions, and output schema.
Use Case Fit
Where the Refusal with Domain Expert Referral Prompt works, where it breaks, and what you must provide before deploying it.
Good Fit: High-Stakes Domain Applications
Use when: The AI operates in medical, legal, financial, or safety-critical domains where a wrong answer has real consequences. Why: Honest refusal with a structured handoff preserves trust and liability boundaries better than a speculative answer. Guardrail: Define the exact evidence threshold below which referral is mandatory.
Bad Fit: General-Purpose Chatbots
Avoid when: The application is a casual Q&A bot or creative assistant where users expect low-friction answers and expert referral would feel like a broken experience. Risk: Over-referral in low-stakes contexts frustrates users and drives abandonment. Guardrail: Gate the referral prompt behind a domain classifier or risk tier.
Required Inputs: Structured Context Packet
What you need: The prompt requires the original user query, retrieved evidence passages, a confidence score, and a pre-configured expert routing target. Risk: Missing or incomplete context causes vague referrals that waste the expert's time. Guardrail: Validate that all input fields are populated before invoking the referral prompt.
Operational Risk: Expert Queue Overload
What to watch: A poorly calibrated evidence threshold can route too many cases to human experts, overwhelming review queues. Guardrail: Monitor referral volume and tune the sufficiency threshold. Implement a feedback loop where experts flag unnecessary referrals to improve the gate.
Operational Risk: Context Loss in Handoff
What to watch: The referral message omits critical context the expert needs, forcing them to re-ask questions the user already answered. Guardrail: Include a structured handoff summary with the original query, evidence gaps identified, and any relevant user history. Test handoff completeness with expert reviewers.
Operational Risk: Referral Target Drift
What to watch: The prompt routes to a generic expert category when a specific specialist is needed, causing re-triaging delays. Guardrail: Maintain a current routing taxonomy and validate that the prompt's routing instructions produce the correct specialist for a golden set of test cases.
Copy-Ready Prompt Template
A reusable prompt for generating a refusal that explains evidence limitations and provides a structured handoff to a domain expert.
This prompt template is designed to be wired into your application immediately after an evidence sufficiency gate returns a low-confidence result. Its job is not to answer the user's question, but to produce a transparent, actionable refusal that preserves context for a human expert. The template uses square-bracket placeholders for all dynamic inputs, making it straightforward to integrate into a prompt assembly pipeline. Before using this template, ensure you have already run your retrieval step and have a concrete set of evidence passages, even if they are insufficient.
textYou are an AI assistant operating in a high-stakes domain where accuracy is critical. Your primary directive is to refuse to answer when evidence is insufficient and to facilitate a smooth handoff to a qualified human expert. ## User Query [USER_QUERY] ## Retrieved Evidence [RETRIEVED_EVIDENCE] ## Evidence Sufficiency Assessment [SUFFICIENCY_ASSESSMENT] ## Constraints - Do not speculate, infer, or synthesize an answer beyond what is directly stated in the provided evidence. - Do not fabricate citations or sources. - Your response must be a single JSON object conforming to the output schema. ## Output Schema { "decision": "refuse_and_refer", "refusal_summary": "A concise, plain-language explanation of why the question cannot be answered from the available evidence. Mention specific gaps.", "preserved_context": { "original_query": "[USER_QUERY]", "key_entities": ["List of key entities, terms, or constraints extracted from the query"], "evidence_searched": "Brief description of the sources or knowledge base searched." }, "expert_handoff": { "recommended_expertise": "The specific domain or role required (e.g., 'Senior Tax Accountant', 'Clinical Oncologist').", "priority": "routine | urgent | critical", "briefing_for_expert": "A concise summary of the user's situation, what was searched, and the specific gap preventing an AI answer. This should allow the expert to pick up the case without re-asking basic questions.", "suggested_next_steps": ["Actionable steps the expert or a triage system might take, e.g., 'Review patient history for prior authorization', 'Check updated regulatory filing from Q3'."] }, "user_facing_message": "A polite, empathetic message to the user explaining the referral and setting expectations for follow-up." }
To adapt this template, replace each bracketed placeholder with data from your application context. The [SUFFICIENCY_ASSESSMENT] should be the structured output from your upstream evidence gate, including its confidence score and identified gaps. The [RETRIEVED_EVIDENCE] should be the raw text of the top-k passages, as this allows the model to reference specific gaps in its refusal summary. For high-risk domains like healthcare or legal, always route the final user_facing_message through a human review step before delivery to ensure tone and accuracy. Test this prompt with cases where evidence is completely absent, partially relevant, and just below the confidence threshold to calibrate the priority field and the specificity of the briefing_for_expert.
Prompt Variables
Required and optional inputs for the Refusal with Domain Expert Referral Prompt. Validate each variable before assembly to prevent malformed handoffs or missing context in production.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[USER_QUERY] | The original question or request that triggered the refusal | What is the recommended dosage for off-label use of Drug X in pediatric patients? | Must be non-empty string. Check for PII redaction before logging. Truncate if >2000 chars to avoid prompt overflow. |
[RETRIEVED_EVIDENCE] | The set of passages, documents, or data returned by the retrieval system | Passage 1: Drug X is approved for adult use only... Passage 2: Pediatric clinical trials are ongoing... | Must be array or concatenated string. If empty or null, route to Retrieval Failure Refusal Prompt instead. Validate that each passage has a source identifier. |
[EVIDENCE_GAP_DESCRIPTION] | A structured explanation of what information is missing from the retrieved evidence | No pediatric dosing data found. Only adult Phase III trial results available. No off-label guidance in current formulary. | Must be generated by Evidence Sufficiency Gate Prompt before this prompt runs. If null, abort and run sufficiency check first. Max 500 chars. |
[DOMAIN_EXPERT_POOL] | The list or description of available human experts, teams, or escalation paths | Pediatric Clinical Pharmacology Team (peds-pharm@hospital.org), On-Call Pharmacist (pager 555-0123) | Must be non-empty. Validate against current on-call schedule if real-time routing is used. If pool is empty, fall back to generic referral language. |
[HANDOFF_CONTEXT] | Preserved conversation context, prior turns, or structured summary for the human expert | User: Nurse Practitioner in NICU. Prior turns: asked about dosing, was told no pediatric data. Current query is follow-up. | Must include session ID, user role if known, and last 3 turns. Validate that no PHI is included unless system is HIPAA-compliant. Max 1500 chars. |
[CONFIDENCE_SCORE] | Numerical score (0.0-1.0) indicating evidence sufficiency for the query | 0.15 | Must be float between 0.0 and 1.0. If >0.5, question may be answerable—re-route to answer generation instead. Source from Evidence Sufficiency Gate Prompt output. |
[OUTPUT_FORMAT] | The expected structure for the refusal response | JSON with fields: refusal_statement, evidence_summary, gap_explanation, expert_referral, handoff_package | Must be valid JSON schema. Validate against schema before prompt assembly. Reject if schema includes fields not supported by downstream consumer. |
[ESCALATION_POLICY] | Rules for when and how to escalate, including urgency flags and SLA tiers | Urgent: if query mentions 'emergency' or 'critical'. Routine: all other refusals. SLA: urgent <5min, routine <60min. | Must be non-empty. Validate that urgency keywords are defined. If policy is null, default to routine escalation only. Check for conflicts with [DOMAIN_EXPERT_POOL] availability. |
Implementation Harness Notes
How to wire the Refusal with Domain Expert Referral Prompt into an application with validation, logging, and human-in-the-loop routing.
This prompt is not a standalone chatbot response; it is a decision gate inside a production workflow. The application must first execute retrieval, pass the retrieved context and the user query to the model, and then parse the structured refusal output. The model's decision to refuse and refer should trigger a downstream action: creating a ticket in a human review queue, sending a notification to a domain expert, or logging the handoff for audit purposes. The prompt template expects [QUERY], [RETRIEVED_CONTEXT], [DOMAIN], [EXPERT_TEAM_NAME], [HANDOFF_INSTRUCTIONS], and [OUTPUT_SCHEMA] as inputs. The application layer is responsible for populating these placeholders with live data before inference.
Validation and routing logic: The prompt instructs the model to output a JSON object with decision (must be REFUSE_AND_REFER), evidence_gap_summary, handoff_package, and user_facing_message fields. After generation, the application must validate that decision matches the expected refusal value. If the model incorrectly returns ANSWER or malformed JSON, the response should be discarded, and the system should either retry with a stricter temperature setting or escalate directly to a human operator with a VALIDATION_FAILURE flag. On successful validation, extract the handoff_package and attach it to a ticket in your internal queue (e.g., Jira, ServiceNow, Zendesk). The handoff_package must include the original query, the insufficient evidence summary, and any context the expert needs to avoid rework. Do not display the raw JSON to the end user; render only the user_facing_message field in the chat interface.
Model choice and guardrails: Use a model with strong instruction-following and JSON mode capabilities (e.g., GPT-4o, Claude 3.5 Sonnet) and set temperature to 0 or a very low value (0.1) to prevent creative refusals that drift from the schema. Implement a retry budget of 2 attempts: if the first call fails schema validation, retry with the validation error injected as an additional [CONSTRAINTS] note. If the second call also fails, log the full prompt and raw output for debugging and route the interaction to a human triage queue. For high-stakes domains like healthcare or legal, add a human-in-the-loop confirmation step before the handoff ticket is created; a human reviewer should verify that the evidence gap is genuine and that referral is appropriate, preventing both over-refusal and under-refusal.
Observability and audit trail: Log every refusal event with a unique interaction_id, the full prompt payload, the validated model output, the routing decision, and the final handoff ticket ID. This log serves as an audit trail for compliance reviews and helps you monitor the refusal rate over time. Set up a dashboard alert if the refusal rate spikes suddenly, as this may indicate a retrieval pipeline failure or a knowledge base gap rather than a genuine increase in unanswerable questions. Finally, periodically review a sample of handoff packages with domain experts to ensure the context preservation is sufficient and that experts are not receiving incomplete or misleading summaries.
Expected Output Contract
Defines the required fields, types, and validation rules for the structured refusal with domain expert referral output. Use this contract to build a parser, validator, and downstream routing logic.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
refusal_statement | string | Must contain a clear, non-hedging statement that the AI cannot answer. Must not contain speculative or fabricated information. Check via substring exclusion for speculative keywords ('might be', 'could be', 'I think'). | |
evidence_gap_summary | string | Must describe the specific evidence limitation preventing an answer. Must reference the provided [CONTEXT] or retrieval set. Validate by checking for at least one explicit reference to a source gap or missing information type. | |
handoff_context | object | Must be a valid JSON object containing the preserved context for the human expert. Schema: { original_query: string, retrieved_evidence_summary: string, gap_analysis: string, user_intent: string | null }. Validate strict schema compliance. | |
expert_routing | object | Must specify the target expert role and routing priority. Schema: { domain: string, role: string, priority: 'standard' | 'urgent' | 'critical' }. Validate enum membership for priority. Domain and role must be non-empty strings. | |
alternative_suggestions | array of strings | If present, each element must be a non-empty string suggesting a related question the evidence can answer or a reformulation. Validate array type and non-empty string elements. Null or empty array is acceptable. | |
confidence_score | number | If present, must be a float between 0.0 and 1.0 representing the system's confidence in the refusal decision itself. Validate range and type. Null is acceptable if confidence scoring is not implemented. | |
escalation_id | string | A unique identifier for this handoff instance. Must match the regex pattern ^[a-zA-Z0-9-_]+$ and be between 8 and 64 characters. Validate format and length. Used for tracking and audit. | |
generated_at | string (ISO 8601) | Timestamp of refusal generation in UTC. Must parse as a valid ISO 8601 datetime string. Validate via Date.parse() or equivalent. Must not be a future date. |
Common Failure Modes
What breaks first when generating refusals with domain expert referral and how to guard against it.
Over-Refusal on Answerable Queries
What to watch: The model refuses and refers to an expert even when sufficient evidence exists in the provided context, frustrating users and creating unnecessary human review load. Guardrail: Implement a pre-refusal evidence sufficiency gate that scores retrieved passages before the refusal prompt runs. If the sufficiency score exceeds the threshold, route to answer generation instead.
Vague or Unactionable Referral
What to watch: The refusal mentions 'contact an expert' without specifying which expert, why they are needed, or what context they will require, leaving the user with no clear next step. Guardrail: Require the output schema to include expert_role, reason_for_referral, and context_summary_for_handoff fields. Validate that all three are non-empty and specific before the response is sent.
Context Leakage in Handoff Summary
What to watch: The generated handoff summary includes raw PII, sensitive business data, or full source documents that should not be passed to a human reviewer without redaction. Guardrail: Apply a PII redaction filter to the context_summary_for_handoff field before it is stored or forwarded. Log the redaction event for audit trails.
Hallucinated Expert Credentials or Routing
What to watch: The model invents a specific department name, expert title, or contact method that does not exist in the organization, sending the user on a dead-end path. Guardrail: Constrain the expert_role and routing_instructions fields to a pre-defined enum or lookup table of actual internal teams and escalation paths. Reject outputs that do not match the allowed list.
Failure to Preserve Original Query Intent
What to watch: The handoff summary paraphrases or sanitizes the user's original question, stripping out critical nuance, urgency markers, or domain-specific terminology the expert needs. Guardrail: Include the user's verbatim query as a separate, immutable field in the handoff payload. Use a validator to confirm the original text is present and unmodified.
Tone Mismatch in High-Stakes Scenarios
What to watch: The refusal language is overly casual, apologetic, or defensive when the user is facing an urgent, safety-critical, or emotionally charged situation, eroding trust. Guardrail: Implement a tone calibration check that scores the refusal against a rubric for empathy, professionalism, and directness. Escalate for human review if the tone score falls below the threshold for the classified urgency tier.
Evaluation Rubric
Use this rubric to test the Refusal with Domain Expert Referral Prompt before shipping. Each criterion targets a specific failure mode observed in production handoff scenarios. Run these checks against a golden set of 20-30 test cases covering clear refusals, borderline sufficiency, and cases where the model should answer.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Refusal Trigger Accuracy | Refusal fires only when [EVIDENCE] is insufficient to answer [QUERY] with high confidence | Model refuses when evidence is sufficient OR answers when evidence is insufficient | Binary classification test: 50 cases with known-sufficient and known-insufficient evidence; measure precision and recall of refusal decision |
Domain Expert Identification | Output specifies a concrete domain expert role relevant to [QUERY] (e.g., 'board-certified cardiologist' not 'doctor') | Vague referral ('consult a professional'), wrong domain, or missing expert specification | LLM-as-judge evaluation: does the referred expert match the domain of [QUERY]? Human audit on 20 samples for calibration |
Context Preservation Completeness | Handoff summary includes [QUERY], key evidence gaps, and any relevant [CONTEXT] without fabricating details | Missing query elements, hallucinated context, or omission of critical evidence gaps that would force the expert to re-ask | Schema check: verify handoff contains query_summary, evidence_gap_list, context_snapshot fields; spot-check 10 outputs for hallucinated context via source comparison |
Evidence Limitation Explanation | Output explains what evidence was searched and why it was insufficient, citing specific gaps from [EVIDENCE] | Generic refusal ('I cannot answer') without referencing the provided evidence or explaining what's missing | Groundedness check: every stated gap must map to a specific passage or absence in [EVIDENCE]; flag unsupported gap claims |
Tone and Trust Preservation | Refusal is respectful, transparent, and maintains user trust; no condescension or over-apology | Dismissive tone, excessive hedging that erodes confidence in the system, or false reassurance | Tone classifier eval: rate outputs on respect, transparency, trust-preservation scales (1-5); threshold: all scores >= 4 |
No Speculative Answer Leakage | Output contains zero partial answers, hypotheses, or 'I think' statements about the query substance | Model provides a caveated answer, suggests possibilities, or embeds speculative content before or after the referral | Keyword and pattern scan for speculative markers; manual review of borderline cases where model might embed an answer in the refusal rationale |
Handoff Actionability | Output provides a clear next step for the user: how to engage the expert, what to share, expected process | Referral is a dead end with no actionable path ('consult an expert' without context on how or what to bring) | Actionability checklist: does output include what to share, suggested expert type, and how to proceed? Binary pass/fail per case |
Structured Output Compliance | Output strictly follows [OUTPUT_SCHEMA] with all required fields present and correctly typed | Missing fields, extra fields, wrong types, or narrative text outside the schema structure | JSON Schema validation against [OUTPUT_SCHEMA]; parse error or schema violation = automatic fail; measure schema compliance rate across 100 runs |
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
Start with the base refusal template and a simple evidence sufficiency check. Use a single [EVIDENCE_SUMMARY] placeholder rather than full passage ranking. Route to a generic [EXPERT_TEAM] placeholder instead of a specific routing system.
codeYou are a cautious assistant. When [EVIDENCE_SUMMARY] is insufficient to answer [USER_QUERY], refuse and refer to [EXPERT_TEAM]. Your refusal must include: - What was searched - Why evidence is insufficient - Handoff context: [QUERY_CONTEXT]
Watch for
- Over-refusal on borderline cases where partial evidence exists
- Missing handoff context that leaves the expert with no starting point
- Tone that sounds like a generic error message rather than a helpful referral

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