This prompt is designed for conversational AI builders who need to route user messages to the correct handler, queue, or agent. It sits between the user input and the routing decision, acting as a gate that detects when intent is too ambiguous to route confidently. Use this prompt when your system must avoid silent misrouting, when multiple intents could match a single user turn, or when underspecified requests would cause downstream handlers to hallucinate or fail. This prompt does not perform the routing itself. It produces a structured ambiguity assessment that your application code uses to either proceed with routing or pause and ask the user a targeted clarification question.
Prompt
Ambiguous Intent Detection Prompt for Chat Routing

When to Use This Prompt
Determine if the Ambiguous Intent Detection Prompt is the right gate for your chat routing pipeline and understand its operational boundaries.
The ideal deployment scenario is a multi-skill chatbot, an agent mesh, or a support triage system where a single user message could reasonably map to several different workflows. For example, 'I can't access my account' could be a password reset, a permissions issue, or a billing hold. Routing this to the wrong handler creates a broken user experience and wastes downstream compute. This prompt forces the system to recognize that ambiguity and generate a specific, actionable clarification question rather than guessing. It is not a replacement for a well-designed intent classifier; it is a safety layer that catches the cases your classifier is least confident about. Wire it as a pre-routing check that runs after intent classification but before handler invocation, and only interrupt the user when the ambiguity score exceeds a configurable threshold.
Do not use this prompt for single-intent systems where only one action is possible, or for workflows where the cost of a wrong routing decision is negligible and can be corrected inline. It is also inappropriate for real-time, low-latency applications where a clarification round-trip would break the user experience contract—in those cases, prefer a default safe handler or a disambiguation UI element. When you deploy this prompt, pair it with an eval harness that measures two critical failure modes: false-positive interruptions that annoy users by asking for clarification when intent was actually clear, and false-negative passes that allow ambiguous requests to reach a handler that will fail silently. Track both rates in production and adjust your ambiguity threshold accordingly.
Use Case Fit
Where the Ambiguous Intent Detection Prompt for Chat Routing delivers value and where it introduces risk. Use these cards to decide if this prompt fits your production architecture.
Good Fit: Multi-Domain Chat Routing
Use when: your system routes user messages across many distinct handlers (billing, support, sales, technical) and misrouting carries a high cost. Guardrail: deploy this prompt as a pre-routing gate that blocks dispatch until intent confidence exceeds your threshold.
Bad Fit: Single-Intent Narrow Bots
Avoid when: your bot serves a single, well-defined purpose where every utterance maps to the same handler. Guardrail: skip ambiguity detection entirely; add a simple out-of-scope classifier instead to avoid unnecessary latency and user friction.
Required Inputs: Structured Intent Taxonomy
Risk: without a defined intent catalog, the model cannot reliably distinguish ambiguous from unambiguous requests. Guardrail: supply a closed list of valid intents with descriptions and example boundary cases in the prompt context. Validate that every detected intent maps to an existing handler.
Operational Risk: False-Positive Interruptions
Risk: the prompt flags clear requests as ambiguous, adding friction and slowing resolution. Guardrail: log every clarification event with the original message and detected intents. Run weekly reviews of clarification rate and adjust the ambiguity threshold or intent taxonomy based on patterns.
Operational Risk: Missed Ambiguity
Risk: the prompt routes a genuinely ambiguous message to the wrong handler, causing misrouting and rework. Guardrail: implement a post-routing confidence check. If the handler's own classification confidence is low, re-route to a human review queue with the original message and routing decision attached.
Scale Consideration: Clarification Loop Limits
Risk: a user stuck in a clarification loop degrades experience and wastes resources. Guardrail: enforce a maximum of two consecutive clarification turns before escalating to a human agent with full conversation context. Monitor loop rates as a key reliability metric.
Copy-Ready Prompt Template
A reusable system prompt that classifies user intent ambiguity and generates a structured clarification question when routing is uncertain.
This template is designed to be placed as a pre-routing classification step in your chat pipeline. Before any downstream handler receives the user message, this prompt forces the model to assess whether the intent is clear enough to route confidently. If the intent is ambiguous, underspecified, or contains multiple competing intents, the prompt produces a structured ambiguity report and a targeted clarification question instead of guessing a route. This prevents the costly downstream errors that occur when a support bot fires a refund workflow for a billing question or a coding agent modifies files for a vague request.
textYou are an intent classification and ambiguity detection system for a chat routing pipeline. Your job is to analyze the user's message and determine whether the intent is clear enough to route to a single handler. Do not execute any action. Do not answer the user's question. Only classify and, if necessary, request clarification. ## INPUT User message: [USER_MESSAGE] Conversation history (last 5 turns): [CONVERSATION_HISTORY] Available routing targets: [ROUTING_TARGETS] ## CLASSIFICATION RULES 1. Identify the primary intent of the user's message. 2. If the message contains multiple distinct intents that would route to different handlers, flag as MULTI_INTENT. 3. If the message is missing critical parameters needed to route correctly (e.g., no product category for a refund request, no environment name for a deployment request), flag as UNDERSPECIFIED. 4. If the message contains contradictory constraints (e.g., "urgent" and "no rush," or "delete" and "archive"), flag as CONTRADICTORY. 5. If the message uses vague references ("it," "that thing," "the last one") that could refer to multiple entities in the conversation history, flag as AMBIGUOUS_REFERENCE. 6. If the intent is clear and maps to exactly one routing target, flag as CLEAR and provide the target. ## OUTPUT SCHEMA Return a JSON object with the following structure: { "classification": "CLEAR" | "MULTI_INTENT" | "UNDERSPECIFIED" | "CONTRADICTORY" | "AMBIGUOUS_REFERENCE", "confidence": 0.0-1.0, "routing_target": "[TARGET_NAME]" | null, "detected_intents": ["intent_1", "intent_2"], "missing_parameters": ["param_1", "param_2"], "contradictions": [{"element_a": "...", "element_b": "...", "description": "..."}], "ambiguous_references": [{"reference": "...", "candidates": ["candidate_1", "candidate_2"]}], "clarification_question": "A single, concise question asking the user to resolve the ambiguity. Null if classification is CLEAR." } ## CONSTRAINTS - Never route to a target not listed in [ROUTING_TARGETS]. - If classification is not CLEAR, routing_target must be null. - clarification_question must be a single sentence that the user can answer in one turn. - Do not explain your reasoning in the output. Only return the JSON. - If confidence is below [CONFIDENCE_THRESHOLD], classify as UNDERSPECIFIED even if you suspect an intent. - For MULTI_INTENT, the clarification question must force a choice between the detected intents, not ask an open-ended question.
To adapt this template, replace the square-bracket placeholders with your application's specific values. [ROUTING_TARGETS] should be a list of handler names with brief descriptions so the model knows what each target does. [CONFIDENCE_THRESHOLD] should be a float between 0.0 and 1.0 that reflects your tolerance for routing errors—start at 0.85 and adjust based on production data. [CONVERSATION_HISTORY] should include the last 3-5 turns formatted as user: and assistant: pairs. If your system has no conversation history, pass an empty string. The output schema is intentionally strict: downstream code should validate that routing_target is non-null only when classification is CLEAR, and that clarification_question is non-null for all other classifications. Add a post-processing validator that rejects any response where these invariants are violated and retries the prompt once before escalating to a human review queue.
Prompt Variables
Required inputs for the Ambiguous Intent Detection Prompt. Each placeholder must be populated before the prompt is assembled. Validation notes describe how to verify the input is fit for purpose before runtime.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[USER_MESSAGE] | The raw user utterance to classify for ambiguity | I need help with my account and also want to cancel my subscription | Non-empty string. Must be the exact user text, not a summary. Reject if null or whitespace only. |
[INTENT_CATALOG] | The list of available intents the router can dispatch to | billing_inquiry, technical_support, account_cancellation, new_order, return_request | Valid JSON array of strings. Must contain at least 2 intents. Each intent must be a lowercase snake_case identifier. Reject if empty or contains duplicates. |
[ROUTING_POLICY] | Rules for how many intents can be active per turn and what constitutes ambiguity | Single intent per turn. Multi-intent is ambiguous. Underspecified intent is ambiguous. | Non-empty string. Must explicitly define the ambiguity criteria. Reject if policy is missing or contains only generic language like 'be smart'. |
[CLARIFICATION_STYLE] | Instructions for how the clarification question should be phrased | Ask one specific question. Offer 2-3 concrete options. Never ask open-ended 'what do you mean?' | Non-empty string. Must specify question format and option count. Reject if style allows open-ended clarification without narrowing. |
[CONFIDENCE_THRESHOLD] | Minimum confidence score below which intent is treated as ambiguous | 0.85 | Float between 0.0 and 1.0. Values below 0.7 produce excessive interruptions. Values above 0.95 risk missed ambiguity. Validate range and log threshold in trace. |
[MAX_CLARIFICATION_ROUNDS] | Maximum number of consecutive clarification turns before escalation to human | 2 | Integer >= 1. Must be enforced in application layer, not just prompt. Reject if null. Log a warning if set above 3 to prevent clarification loops. |
[ESCALATION_QUEUE] | Identifier for the human review queue when clarification fails or rounds are exhausted | triage_l2_human_review | Non-empty string matching a valid queue ID in the routing system. Validate against known queue registry at prompt assembly time. Reject if queue does not exist. |
[OUTPUT_SCHEMA] | The exact JSON schema the model must return | {"is_ambiguous": boolean, "detected_intents": string[], "confidence": float, "clarification_question": string | null, "rationale": string} | Valid JSON Schema object. Must include is_ambiguous, detected_intents, confidence, and clarification_question fields. Reject if schema allows clarification_question when is_ambiguous is false. |
Implementation Harness Notes
How to wire the ambiguous intent detection prompt into a chat routing pipeline with validation, retries, and escalation.
Integrating this prompt into a production chat router requires treating it as a deterministic gate, not a conversational suggestion. The prompt should be called synchronously after user input is received but before any downstream handler is invoked. The model's response must be parsed into a strict schema—typically a JSON object with fields for is_ambiguous, detected_intents, ambiguity_reason, and clarification_question. If the parser cannot extract these fields or the model returns an unexpected structure, the system should default to a safe fallback: either route to a generalist handler with a note that intent was unclear, or escalate to a human queue with the raw user input and the unparseable model output attached as diagnostic context.
The implementation should include a lightweight validation layer that checks the output before acting on it. If is_ambiguous is true, the clarification_question field must be non-empty and the ambiguity_reason must reference specific missing or conflicting information from the user's message. If is_ambiguous is false, the detected_intents array must contain at least one valid intent label from your system's known routing taxonomy. A validator that enforces these constraints prevents silent failures where the model marks something as ambiguous but provides no question, or claims clarity while producing an intent label that doesn't match any registered handler. When validation fails, increment a retry counter and re-invoke the prompt with the validation error appended as a corrective instruction. After two failed retries, log the full trace and escalate to a human reviewer rather than guessing.
Model choice matters here more than in many classification tasks. Use a model with strong instruction-following and structured output capabilities—GPT-4o, Claude 3.5 Sonnet, or Gemini 1.5 Pro are appropriate defaults. Avoid smaller or older models that may conflate ambiguity detection with refusal or produce inconsistent JSON under the schema constraints. Set temperature to 0 or a very low value (0.1 maximum) to minimize variance in the ambiguity decision. For high-throughput systems, consider caching the prompt prefix that contains the system instruction and routing taxonomy, as this portion is static across requests and can significantly reduce latency and cost when your provider supports prompt caching. Log every ambiguity decision with the user input, the model's output, the validator result, and the final routing action. This audit trail is essential for tuning the ambiguity threshold over time and for reviewing cases where the system interrupted a user who was actually clear, or failed to interrupt a user who was genuinely ambiguous.
Expected Output Contract
Fields, format, and validation rules for the JSON response produced by the Ambiguous Intent Detection Prompt for Chat Routing. Use this contract to parse, validate, and route the model's output before taking action.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
intent_decision | enum: clear | ambiguous | multi_intent | Must be exactly one of the three enum values. Reject any other string. | |
confidence_score | number (0.0 to 1.0) | Must be a float between 0.0 and 1.0 inclusive. If confidence_score < 0.6 and intent_decision is clear, flag for human review. | |
detected_intents | array of objects | Must be a non-empty array. Each object must contain intent_label (string) and confidence (number). If intent_decision is clear, array length must be 1. | |
detected_intents[].intent_label | string | Must match one of the predefined intent labels from [INTENT_CATALOG]. Reject unknown labels. | |
detected_intents[].confidence | number (0.0 to 1.0) | Must be a float between 0.0 and 1.0 inclusive. Sum of all confidences in the array must not exceed 1.0. | |
ambiguity_reason | string or null | Required if intent_decision is ambiguous or multi_intent. Must be a non-empty string explaining the conflict or underspecification. Null allowed only when intent_decision is clear. | |
clarification_question | string or null | Required if intent_decision is ambiguous or multi_intent. Must be a single, actionable question the system can surface to the user. Null allowed only when intent_decision is clear. | |
suggested_routing | string or null | If intent_decision is clear, must contain the target queue or handler name from [ROUTING_MAP]. If ambiguous or multi_intent, must be null or set to escalation_queue. |
Common Failure Modes
Ambiguous intent detection is a high-stakes classification task. When it fails, the system either interrupts users unnecessarily or executes the wrong action silently. These are the most common failure modes and how to guard against them.
Over-Triggering on Vague but Actionable Requests
What to watch: The prompt classifies a slightly vague but common request as ambiguous, generating a clarification question when the user's intent is actually clear in context. This creates friction and erodes trust. Guardrail: Include few-shot examples of requests that are underspecified but have a single dominant interpretation in your domain. Add a constraint that the model must not flag ambiguity if one intent has >90% confidence.
Silent Intent Selection for Multi-Intent Inputs
What to watch: The model detects multiple intents but picks one without asking, often defaulting to the most common or first-mentioned intent. The user's secondary request is silently dropped. Guardrail: Require the output schema to include a conflicting_intents array. Add a validator that blocks execution if more than one intent is detected and no clarification question was generated.
Clarification Questions That Are Too Broad
What to watch: The generated clarification question is generic ('Can you be more specific?') rather than targeted, forcing the user to re-explain their entire request. This is a second-order failure that doubles user friction. Guardrail: Constrain the prompt to require clarification questions that reference the specific ambiguous slot or conflicting constraint. Add an eval check that the question contains at least one concrete option or example.
Context Window Amnesia for Disambiguation History
What to watch: The user clarifies their intent, but the system treats the clarification as a new, standalone request, losing the original context and asking the same question again. Guardrail: The prompt must instruct the model to check conversation history for pending clarification states before classifying the current turn. Include a clarification_in_progress flag in the output schema that persists across turns.
False Negatives on Adversarial or Edge-Case Phrasing
What to watch: Users phrase requests in unusual ways, use domain jargon incorrectly, or combine unrelated tasks in a single sentence. The model misses the ambiguity and routes to the wrong handler. Guardrail: Include adversarial examples in your eval set: run-on sentences, misused terminology, and requests with contradictory emotional tone. Add a confidence score to every classification and escalate when confidence is below 0.7.
Clarification Loop Exhaustion
What to watch: The system asks for clarification, the user provides it, but the new information reveals another ambiguity, triggering a second clarification. This loops until the user abandons the interaction. Guardrail: Implement a maximum clarification depth (e.g., 2 rounds). After the limit is reached, escalate to a human agent with the full conversation history rather than asking again. Log every loop for prompt improvement.
Evaluation Rubric
Use this rubric to test the Ambiguous Intent Detection Prompt before shipping. Each criterion targets a known failure mode for chat routing systems, from false-positive interruptions to missed multi-intent signals.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Clear Single Intent Pass-Through | Output has [IS_AMBIGUOUS]: false and [ROUTING_TARGET] is a single valid handler with confidence >= 0.85 | [IS_AMBIGUOUS]: true on a well-specified single-intent message, or [ROUTING_TARGET] is null | Run 50 single-intent examples from production logs; assert pass-through rate >= 95% |
Genuine Ambiguity Detection | Output has [IS_AMBIGUOUS]: true and [CLARIFICATION_QUESTION] is a single, specific question addressing the ambiguity | [IS_AMBIGUOUS]: false on a message where two reasonable handlers could apply, or [CLARIFICATION_QUESTION] is generic | Run 30 ambiguous examples with two valid routing targets; assert detection rate >= 90% |
Multi-Intent Flagging | Output has [IS_AMBIGUOUS]: true and [DETECTED_INTENTS] contains at least two distinct intent labels | [DETECTED_INTENTS] contains only one intent when the user asked for two incompatible actions | Run 20 multi-intent examples; assert multi-intent flag rate >= 85% |
Underspecified Input Handling | Output has [IS_AMBIGUOUS]: true and [MISSING_SLOTS] lists the specific missing dimensions | [IS_AMBIGUOUS]: false on a message missing a required routing dimension like product area or urgency | Run 15 underspecified examples; assert interruption rate >= 90% and [MISSING_SLOTS] is non-empty |
Clarification Question Specificity | [CLARIFICATION_QUESTION] references a concrete choice the user must make, not a generic 'can you clarify?' | [CLARIFICATION_QUESTION] is a generic request for more information without naming the decision point | Human review of 20 clarification outputs; assert specificity score >= 4/5 on Likert scale |
Routing Target Validity | [ROUTING_TARGET] is a handler that exists in the [AVAILABLE_HANDLERS] list when [IS_AMBIGUOUS] is false | [ROUTING_TARGET] is a hallucinated handler name not present in [AVAILABLE_HANDLERS] | Schema validation against handler list; assert 100% match rate on non-ambiguous outputs |
Confidence Calibration | When [IS_AMBIGUOUS] is false, [CONFIDENCE_SCORE] is >= 0.80; when true, [CONFIDENCE_SCORE] reflects uncertainty below 0.80 | [IS_AMBIGUOUS]: false with [CONFIDENCE_SCORE] < 0.60, or [IS_AMBIGUOUS]: true with [CONFIDENCE_SCORE] > 0.90 | Run 100 mixed examples; assert confidence threshold alignment in >= 90% of cases |
Output Schema Compliance | Response parses as valid JSON matching the [OUTPUT_SCHEMA] with all required fields present | Missing [IS_AMBIGUOUS], [ROUTING_TARGET], or [CLARIFICATION_QUESTION] fields; malformed JSON | Automated schema validation on 200 outputs; assert 100% parse success and required field presence |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Use the base prompt with a frontier model (GPT-4o, Claude 3.5 Sonnet). Focus on getting the ambiguity classification and clarification question right before adding infrastructure. Keep the output schema simple: {"is_ambiguous": boolean, "clarification_question": string | null, "detected_intents": string[]}. Test with 20-30 hand-labeled examples covering clear intent, underspecified intent, and multi-intent cases.
Watch for
- Over-classifying slightly vague queries as ambiguous when a reasonable default exists
- Generating clarification questions that are longer than the original user message
- Missing multi-intent cases where two intents are compatible and could be served together

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