This prompt template is for conversational AI builders who need a system to manage a multi-turn clarification loop. Use it when an initial user input is ambiguous, underspecified, or contains conflicting signals that prevent confident routing or task execution. The prompt instructs the model to act as a clarification agent that asks targeted questions, interprets user responses, updates its internal confidence, and decides when sufficient clarity is achieved to proceed. This is not a single-turn classification prompt. It is a dialogue manager designed to be called repeatedly within a stateful conversation loop.
Prompt
Disambiguation Dialogue Prompt Template

When to Use This Prompt
Defines the ideal operating conditions, required infrastructure, and critical limitations for deploying a multi-turn disambiguation dialogue manager.
The ideal deployment environment is a stateful application that maintains a conversation_history array and a clarity_state object across turns. Your application must inject the original ambiguous input, the history of questions and answers, and the current confidence assessment into each call. The prompt expects to receive a structured [CLARITY_STATE] containing the original intent hypotheses, their confidence scores, and a list of unresolved ambiguities. It returns a decision object: either a clarification_question to ask the user or a resolved_intent payload ready for downstream routing. Do not use this for one-shot disambiguation where no follow-up is possible, or for high-stakes decisions where a wrong interpretation before clarification would cause irreversible harm—those scenarios require a hard escalation to a human reviewer before any automated action is taken.
Before implementing this prompt, ensure you have defined a maximum turn limit and a terminal escalation path. A clarification loop that never converges degrades user experience and wastes inference costs. Your application harness should enforce a hard stop after a configurable number of turns (typically 3-5), at which point the system must escalate to a human or route to a general fallback queue with a note that clarification was exhausted. Additionally, instrument the loop with logging that captures each turn's confidence delta, the specific question asked, and the user's response. This trace data is essential for evaluating the prompt's resolution efficiency and identifying patterns where the model asks redundant or unhelpful questions. The companion eval checks in this playbook will help you measure resolution rate, average turns to clarity, and escalation frequency.
Use Case Fit
Where the Disambiguation Dialogue Prompt Template works well, where it creates risk, and the operational prerequisites for safe deployment.
Good Fit: Multi-Turn Interactive Systems
Use when: The system can sustain a multi-turn conversation and the cost of a wrong answer is higher than the cost of asking a question. Ideal for customer-facing copilots, support triage, or internal tooling where the user is available to clarify. Guardrail: Implement a maximum question limit (e.g., 3 turns) to prevent infinite clarification loops that degrade user experience.
Bad Fit: High-Volume Async or Batch Processing
Avoid when: Inputs are processed asynchronously in bulk, such as overnight ticket triage or streaming log analysis. Waiting for a user response breaks the processing pipeline and introduces unbounded latency. Guardrail: Route ambiguous inputs to a low-confidence fallback queue for human review instead of attempting a dialogue loop.
Required Inputs: Structured Uncertainty Context
Risk: The prompt cannot generate a useful clarification question without knowing why the input is ambiguous. Passing only the raw user input leads to generic, unhelpful questions. Guardrail: Always provide the upstream classification attempt, its low-confidence score, and the specific conflicting or missing information as input variables.
Operational Risk: Dialogue State Drift
Risk: The model loses track of the original goal over multiple turns, turning a clarification into an unrelated tangent or forgetting the user's first answer. Guardrail: Inject a running dialogue state summary into the prompt context at each turn, explicitly listing the original intent, questions asked, and answers received so far.
Operational Risk: Premature Resolution
Risk: The model declares sufficient clarity after only one turn to appear efficient, even when critical ambiguities remain unresolved, leading to a downstream misroute.
Guardrail: Require the model to output an explicit resolution_confidence score and a list of resolved_ambiguities before exiting the dialogue loop. Gate the exit on a configurable threshold.
Bad Fit: Regulated or High-Stakes Autonomous Decisions
Avoid when: The clarified intent will trigger an irreversible action like a financial transaction, a medical order, or a legal filing without a human in the loop. A misinterpreted clarification is a liability. Guardrail: The dialogue loop should only resolve the intent. A separate human-approval gate must still intercept the final action, even after successful disambiguation.
Copy-Ready Prompt Template
A reusable, stateful prompt for managing a multi-turn clarification dialogue to resolve ambiguous user inputs before routing.
This prompt template is the core instruction set for a disambiguation agent. It is designed to be called on every turn of a clarification dialogue, with the conversation history and current state injected at runtime. The agent's job is not to answer the user's underlying request, but to ask the minimum number of targeted questions needed to resolve ambiguity, update its internal confidence, and decide when sufficient clarity has been achieved to hand off to a downstream routing or execution system. The template uses square-bracket placeholders for all dynamic inputs, making it ready for direct integration into an application harness.
markdownYou are a clarification agent. Your only job is to resolve ambiguity in user requests before they are routed to a specialist. You do not fulfill the request yourself. ## Current State - Ambiguity Type: [AMBIGUITY_TYPE] - Ambiguous Spans: [AMBIGUOUS_SPANS] - Current Confidence Score: [CONFIDENCE_SCORE] - Questions Asked So Far: [QUESTIONS_ASKED_COUNT] - Max Questions Allowed: [MAX_QUESTIONS] ## Conversation History [HISTORY] ## Instructions 1. Analyze the conversation history and the latest user input to determine if the ambiguity has been resolved. 2. If the ambiguity is resolved, output a final structured object with `status: "resolved"`, a clear `resolved_intent`, and your final `confidence_score`. 3. If the ambiguity is not resolved and you have not exceeded [MAX_QUESTIONS], generate exactly one targeted, concise clarification question designed to resolve the specific uncertainty in [AMBIGUOUS_SPANS]. Output `status: "clarifying"`. 4. If the ambiguity is not resolved and you have reached [MAX_QUESTIONS], do not ask another question. Output `status: "max_turns_reached"` with your best-effort `resolved_intent` and a low `confidence_score`. 5. Never repeat a question you have already asked. 6. Do not answer the user's underlying request or provide any information beyond the clarification dialogue. ## Output Schema You must respond with a valid JSON object matching this schema: { "status": "clarifying" | "resolved" | "max_turns_reached", "clarification_question": "string | null", "resolved_intent": "string | null", "confidence_score": 0.0-1.0, "reasoning": "string" }
To adapt this template, replace the placeholders with live data from your application state. [AMBIGUITY_TYPE] and [AMBIGUOUS_SPANS] should be populated by an upstream ambiguity detection prompt. [CONFIDENCE_SCORE] should be updated after each user response by re-evaluating the dialogue. [MAX_QUESTIONS] is a critical safety parameter—set it based on your user experience tolerance (typically 2-4) to prevent infinite loops. The [HISTORY] placeholder should be injected as a formatted transcript of the dialogue so far. For high-stakes domains, ensure the final resolved_intent and confidence_score are logged and, if below a defined threshold, trigger a human review workflow before any action is taken.
Prompt Variables
Inputs the disambiguation dialogue prompt needs to work reliably. These must be populated by the application layer before each call. Missing or malformed variables will cause the clarification loop to fail silently or produce irrelevant questions.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[USER_INPUT] | The ambiguous or underspecified user message that triggered the clarification loop | I need help with my account | Must be a non-empty string. Reject null or whitespace-only inputs before prompt assembly. Log original input for audit trail. |
[CONVERSATION_HISTORY] | Prior turns in the clarification dialogue, including previous questions and user responses | ASSISTANT: Which account type did you mean: billing or technical? USER: billing | Must be a valid JSON array of message objects with role and content fields. If first turn, pass an empty array. Max 10 turns to prevent context drift. |
[INTENT_CANDIDATES] | The top-k possible intents with confidence scores that the classifier could not disambiguate | [{"intent": "billing_inquiry", "confidence": 0.45}, {"intent": "account_recovery", "confidence": 0.42}] | Must be a valid JSON array with 2-5 objects, each containing intent (string) and confidence (float 0-1). Reject if only one candidate or if all confidences are below 0.1. |
[AMBIGUITY_SPANS] | Specific text spans in the user input that caused classification uncertainty | [{"span": "account", "reason": "ambiguous domain reference"}] | Must be a valid JSON array of objects with span (string) and reason (string). Can be empty if ambiguity is structural rather than lexical. Validate span exists in [USER_INPUT]. |
[MAX_CLARIFICATION_TURNS] | Hard limit on how many clarification questions the system can ask before escalating | 3 | Must be an integer between 1 and 5. Application layer must enforce this limit and trigger escalation prompt when exceeded. Do not rely on model self-enforcement. |
[RESOLUTION_THRESHOLD] | Minimum confidence required to exit the clarification loop and route the request | 0.85 | Must be a float between 0.5 and 0.99. Lower values risk misrouting. Higher values cause excessive clarification. Tune against held-out ambiguous examples. |
[DOMAIN_TAXONOMY] | The full set of valid intent labels and their descriptions for the system | [{"label": "billing_inquiry", "description": "Questions about charges, invoices, or payment methods"}] | Must be a valid JSON array of objects with label (string) and description (string). Must contain all intents in [INTENT_CANDIDATES]. Reject if taxonomy is empty or missing candidates. |
[ESCALATION_REASON_TEMPLATE] | Pre-defined reason codes for when clarification fails or exceeds turn limit | ["max_turns_exceeded", "user_requested_agent", "confidence_stalled"] | Must be a valid JSON array of strings. At least one reason must be defined. Application layer must map these to downstream routing actions. |
Implementation Harness Notes
How to wire the disambiguation dialogue prompt into a stateful application loop with validation, retries, and termination guards.
This prompt is not a single API call. It is the core instruction set for a stateful dialogue loop managed by your application. The application owns the conversation state, turn counter, confidence history, and termination logic. The model's job is to decide the next action—ask a clarifying question, update confidence, or declare resolution—based on the accumulated dialogue context you provide. Your harness must enforce the loop boundaries: maximum turns, minimum confidence thresholds, and escalation timeouts. Without these guardrails, the dialogue can drift into unproductive cycles or premature routing.
Implement the loop as a finite state machine with four states: INIT, CLARIFY, RESOLVE, and ESCALATE. On first input, assemble the prompt with the user's original request in [USER_INPUT], an empty [DIALOGUE_HISTORY], and the current [CONFIDENCE_SCORE] set to 0.0. Parse the model's JSON response to extract action, clarification_question, updated_confidence, and resolution. If action is ask, append the question to dialogue history, present it to the user, capture their response, and loop back to CLARIFY with the updated history. If action is resolve and updated_confidence exceeds your configured threshold (typically 0.85 for high-stakes routing, 0.70 for general triage), transition to RESOLVE and route the clarified intent downstream. If action is escalate or the turn counter exceeds your maximum (start with 3 turns and tune from production data), transition to ESCALATE and hand off to a human queue with the full dialogue transcript. Validate every model response against your expected JSON schema before acting on it. A malformed response should trigger a retry with the same context, not a silent fallback.
Log every turn with a structured event: session_id, turn_number, model_action, confidence_before, confidence_after, user_response, and latency_ms. This trace data is essential for tuning your confidence thresholds and turn limits. Common failure modes to monitor: the model asking redundant questions already answered in prior turns, confidence scores that oscillate without converging, and premature resolution when critical disambiguation remains. Wire these metrics into your observability dashboard alongside an eval harness that replays production dialogues against your golden set of ambiguous inputs to measure resolution accuracy and average turns-to-resolve. Start with a fast, cost-effective model for the dialogue loop and reserve a more capable model for the final classification step once disambiguation is complete.
Expected Output Contract
Schema contract for the disambiguation dialogue manager. Every turn must return this JSON structure so the application layer can decide whether to ask another question, route the intent, or escalate.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
dialogue_state | string enum: clarifying | resolved | escalated | Must be exactly one of the three allowed values. Reject any other string. | |
resolved_intent | string | null | Required when dialogue_state is resolved. Must match an intent label from [INTENT_CATALOG]. Null otherwise. | |
confidence_score | number 0.0-1.0 | Must be a float between 0 and 1 inclusive. When dialogue_state is resolved, must be >= [CONFIDENCE_THRESHOLD]. | |
clarification_question | string | null | Required when dialogue_state is clarifying. Must be a single, targeted question addressing one specific ambiguity. Null otherwise. | |
ambiguity_span | string | null | Required when dialogue_state is clarifying. Must be a verbatim substring from [USER_INPUT] that is ambiguous. Null otherwise. | |
escalation_reason | string | null | Required when dialogue_state is escalated. Must cite a specific reason from [ESCALATION_REASONS]. Null otherwise. | |
turn_count | integer >= 1 | Must equal the number of user-assistant exchanges in the current dialogue. Increment by 1 each turn. | |
max_turns_reached | boolean | Must be true when turn_count >= [MAX_CLARIFICATION_TURNS], false otherwise. Triggers forced resolution or escalation. |
Common Failure Modes
Disambiguation dialogues fail in predictable ways. These are the most common failure modes when a model is asked to clarify ambiguity, and how to guard against them before they reach production.
Endless Clarification Loops
What to watch: The model asks follow-up questions indefinitely because it never reaches the confidence threshold. Each answer reveals a new edge case, and the conversation drifts without resolution. Guardrail: Set a hard maximum on clarification turns (e.g., 3). After the limit, force a best-guess routing decision with an explicit low-confidence flag and escalate to a human queue.
Leading or Assumptive Questions
What to watch: The model asks questions that assume facts not yet confirmed by the user, such as 'Which premium tier are you on?' when the user never mentioned a paid plan. This biases the user's response and produces incorrect routing. Guardrail: Include an explicit instruction in the system prompt to only reference information the user has already provided. Validate generated questions against conversation state before displaying them.
Multi-Intent Collapse
What to watch: The user's input contains two distinct intents (e.g., 'cancel my subscription and refund the last charge'), but the disambiguation prompt focuses on one and ignores the other. The unresolved intent is lost. Guardrail: Run a multi-intent decomposition check before entering the clarification loop. If multiple intents are detected, clarify each one independently or confirm with the user that the secondary intent can be deferred.
Over-Clarification of Low-Impact Ambiguity
What to watch: The model asks for clarification on details that don't affect the routing decision, such as the user's preferred pronoun for a billing dispute. This wastes turns and frustrates users. Guardrail: Define a clarification budget tied to routing impact. Only ask questions whose answers would change the downstream queue, model, or handler. Silence questions that are conversational rather than operational.
Confidence Score Inflation
What to watch: After one or two clarification turns, the model reports high confidence even when critical information is still missing, because it has overfit to the partial answers it received. Guardrail: Require the model to list what information is still unknown alongside the confidence score. If any routing-critical field remains null, cap the confidence score and continue clarification or escalate.
Context Window Contamination
What to watch: In long clarification loops, earlier turns, corrections, and abandoned hypotheses accumulate in the context window and confuse the model's final routing decision. Guardrail: Summarize and compress the clarification history after each turn, keeping only confirmed facts, unresolved questions, and the current confidence state. Discard rejected hypotheses explicitly.
Evaluation Rubric
Run these checks against a curated test set of ambiguous inputs with known resolution paths. Each criterion targets a specific failure mode in disambiguation dialogue loops.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Clarification Question Relevance | Generated question directly addresses the specific ambiguity span identified in [AMBIGUOUS_INPUT] | Question targets a different topic than the flagged ambiguity or asks for already-provided information | For each test case, verify that the question's focus matches the ambiguity span in the ground-truth annotation |
Resolution Efficiency | Ambiguity is resolved in 2 or fewer clarification turns for 90% of test cases | Dialogue exceeds 3 turns without reaching [CONFIDENCE_THRESHOLD] or loops on the same question variant | Simulate user responses from test set and count turns until confidence exceeds threshold or escalation triggers |
Confidence Progression | Confidence score increases monotonically with each valid user response to clarification questions | Confidence decreases or remains flat after a relevant user answer is provided | Log confidence scores after each turn in the dialogue simulation and verify upward trend for cooperative user responses |
Escalation Trigger Accuracy | Escalation fires when [MAX_CLARIFICATION_TURNS] is reached or user explicitly declines to clarify | Escalation fires prematurely on resolvable ambiguity or fails to fire when user signals inability to clarify | Test boundary cases: user says 'I don't know', provides partial answer, or asks to skip clarification |
Multi-Intent Disambiguation | Each distinct intent from [MULTI_INTENT_INPUT] receives its own clarification path without cross-contamination | Clarification for one intent overwrites or ignores another unresolved intent in the same input | Feed compound inputs with 2-3 distinct ambiguous intents and verify all are addressed before routing |
Fallback Routing Correctness | When clarification fails, fallback routes to the queue specified in [FALLBACK_QUEUE_MAP] for the ambiguity category | Fallback sends to default queue ignoring ambiguity type or routes to a queue that cannot handle the request category | Force clarification failure on test cases and verify queue selection matches the configured fallback mapping |
Dialogue State Preservation | Previously clarified information is retained and not re-requested in subsequent turns | System asks a question that was already answered in an earlier turn of the same dialogue | Run multi-turn simulations and scan all generated questions for redundancy against prior user responses in the session |
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 simple turn counter and a maximum-clarification limit (e.g., 3 turns). Skip formal confidence scoring; rely on the model's natural language judgment to decide when to stop clarifying. Store dialogue state in a flat array of user-assistant turns.
code[SYSTEM] You are a clarification assistant. When the user's request is ambiguous, ask ONE targeted question to resolve the uncertainty. After [MAX_TURNS] exchanges, make your best determination and proceed.
Watch for
- Infinite clarification loops without a hard turn limit
- The model asking multiple questions in one turn instead of one focused question
- No tracking of what has already been asked, leading to repeated questions
- Ambiguity that cannot be resolved through dialogue being forced into a guess

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