Inferensys

Prompt

Read-Write Ambiguity Resolution Prompt

A practical prompt playbook for using Read-Write Ambiguity Resolution Prompt in production AI workflows.
Developer doing prompt engineering on laptop, prompt variations visible on screen, casual coding session.
PROMPT PLAYBOOK

When to Use This Prompt

Learn when to deploy the Read-Write Ambiguity Resolution Prompt to safely disambiguate user intent before any tool selection occurs.

This prompt is designed for a specific and dangerous failure mode in AI copilots and agents: a user request is underspecified, and the system must decide whether to retrieve data or modify it. Guessing wrong can corrupt state, expose sensitive information, or violate compliance boundaries. The job-to-be-done is not tool selection or execution. It is the generation of ranked, neutral clarification questions that help a downstream system or UI resolve the ambiguity without leading the user toward a write operation. The ideal user is a product team building a copilot where the default user phrasing is ambiguous, and where the cost of a mistaken write is high.

Use this prompt when a user's natural language request could reasonably map to either a read-only tool (e.g., get_customer_record) or a write tool (e.g., update_customer_address). Common triggers include verbs like 'handle,' 'take care of,' 'fix,' or 'update' when the object of the action is unclear, or when the user references a record without specifying whether they want to view or change it. The prompt expects [USER_REQUEST] and [AVAILABLE_TOOL_DESCRIPTIONS] as inputs, and it produces a ranked list of clarification options. It does not select a tool, execute a call, or enforce authorization. Its only output is the clarification structure that a UI can render as buttons, quick replies, or a follow-up message.

Do not use this prompt when the user's intent is already unambiguous, when the system has a hard policy to always default to read-only and inform the user, or when latency constraints require immediate tool selection without a clarification round-trip. It is also inappropriate for systems where all tools are read-only or where write operations are fully reversible and low-risk. In high-risk domains such as healthcare, finance, or infrastructure control, this prompt should be paired with a human approval step before any write operation executes, even after intent is clarified. The clarification questions themselves must be audited for bias: a question like 'Would you like to delete this record?' leads the user, while 'Would you like to view this record or delete it?' preserves neutrality. Build eval checks that measure whether clarification options are balanced in their presentation of read and write paths.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Read-Write Ambiguity Resolution Prompt works, where it fails, and what you must provide before deploying it into a production tool-selection pipeline.

01

Good Fit: Underspecified User Requests

Use when: a user query such as 'update my account' or 'handle the report' could map to either a read-only lookup or a state-mutating write. Guardrail: the prompt must produce ranked clarification options, never default to a write tool when confidence is below threshold.

02

Bad Fit: Fully Specified Tool Calls

Avoid when: the user intent is explicit and the required tool, arguments, and side effects are unambiguous. Adding an ambiguity check here adds latency and risks over-clarification. Guardrail: route fully specified calls directly to argument construction and pre-execution validation.

03

Required Inputs

Must provide: the user request text, a catalog of available tools with declared read/write profiles, and any conversation context that could shift intent. Guardrail: if tool schemas lack explicit side-effect labels, run the Side-Effect Detection Prompt first to classify each tool before disambiguation.

04

Operational Risk: Biased Clarification

What to watch: the model generating clarification questions that subtly favor write operations, such as 'Would you like me to delete that for you?' before offering a read-only alternative. Guardrail: require the prompt to produce at least one read-only clarification option for every ambiguous request and log clarification rankings for audit.

05

Operational Risk: Clarification Fatigue

What to watch: the model asking for clarification on every request, even when context makes intent clear, frustrating users and increasing time-to-resolution. Guardrail: set a confidence threshold below which clarification triggers; above the threshold, proceed with the highest-ranked tool and log the decision for review.

06

Pre-Deployment Test

Before shipping: run a golden set of ambiguous requests where the correct resolution is known. Measure whether the prompt's top-ranked clarification option matches the expected intent in at least 95% of cases. Guardrail: include adversarial examples designed to trick the model into selecting a write tool when a read-only path exists.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A copy-ready system prompt that resolves read-write ambiguity by generating ranked, non-leading clarification questions before any tool is selected.

This prompt template is designed to be placed in your system instructions or used as a pre-tool-selection clarification step. When a user request could map to either a read-only data retrieval tool or a write tool that produces side effects, the model generates clarifying questions that disambiguate intent without nudging the user toward any particular action. The output is a ranked list of clarification options, each with a neutral phrasing score, so your application can present choices to the user or automatically select the highest-confidence clarification.

text
You are a clarification assistant that resolves ambiguity between read-only and write operations. Your job is to detect when a user request could be fulfilled by either a read tool or a write tool, and to generate neutral clarifying questions that help disambiguate intent.

## INPUT
User request: [USER_REQUEST]
Available tools with operation types:
[TOOL_CATALOG]

## TOOL CATALOG FORMAT
Each tool is described as:
- tool_name: string
- operation_type: "read" | "write" | "read_write"
- description: string
- parameters: list of parameter schemas

## CONSTRAINTS
1. Do NOT select a tool. Only generate clarification questions.
2. Questions must be neutral. Do not phrase questions that assume or nudge toward a write operation.
3. If the user request is unambiguously read-only, return an empty clarifications list and set "ambiguous": false.
4. If the user request is unambiguously a write, return an empty clarifications list and set "ambiguous": false.
5. If the request could map to both read and write tools, set "ambiguous": true and generate 1-3 clarification questions.
6. Each question must be self-contained and answerable with a short response.
7. Rank questions by how effectively they resolve the ambiguity. The first question should provide the most disambiguation value.
8. Do not ask questions that the user has already answered in their request.

## OUTPUT SCHEMA
Return a JSON object with this exact structure:
{
  "ambiguous": boolean,
  "reasoning": "Brief explanation of why the request is or is not ambiguous.",
  "clarifications": [
    {
      "rank": integer starting at 1,
      "question": "The neutral clarifying question.",
      "resolves_to": "read" | "write" | "either",
      "neutrality_check": "Explanation of why this question does not bias toward read or write."
    }
  ]
}

## EXAMPLES

Example 1: Ambiguous request
User request: "Show me the customer list"
Tools: [{"tool_name": "list_customers", "operation_type": "read"}, {"tool_name": "export_customers_csv", "operation_type": "write"}]
Output:
{
  "ambiguous": true,
  "reasoning": "The user asked to see a customer list. This could mean display on screen or export to a file.",
  "clarifications": [
    {
      "rank": 1,
      "question": "Would you like to view the customer list on screen or export it to a file?",
      "resolves_to": "either",
      "neutrality_check": "Both options are presented equally without favoring one."
    }
  ]
}

Example 2: Unambiguous read
User request: "How many customers signed up this week?"
Tools: [{"tool_name": "count_customers", "operation_type": "read"}, {"tool_name": "delete_customer", "operation_type": "write"}]
Output:
{
  "ambiguous": false,
  "reasoning": "The user is asking for a count, which is a read-only operation. No write tool matches this intent.",
  "clarifications": []
}

## RISK LEVEL
[RISK_LEVEL]

If RISK_LEVEL is "high", add an additional field "requires_human_approval": true to the output and include a note explaining why human review is recommended before presenting clarifications to the user.

To adapt this prompt, replace [USER_REQUEST] with the incoming user message, [TOOL_CATALOG] with your structured tool definitions including operation types, and [RISK_LEVEL] with either "low", "medium", or "high". For high-risk domains such as finance, healthcare, or destructive data operations, set [RISK_LEVEL] to "high" to enable the human-approval flag. The output schema is designed to be parsed by your application's clarification UI or fed into a downstream tool-selection step once the user responds. Before deploying, test this prompt against a golden set of ambiguous and unambiguous requests to verify that the neutrality check field correctly identifies biased phrasing.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the Read-Write Ambiguity Resolution Prompt. Each placeholder must be populated before the prompt is sent to the model. Missing or malformed inputs cause biased clarification questions or missed disambiguation opportunities.

PlaceholderPurposeExampleValidation Notes

[USER_REQUEST]

The underspecified user input that could map to either a read or write operation

show me my recent orders or cancel the last one

Must be non-empty string. Reject if null or whitespace-only. Log original text before any normalization.

[AVAILABLE_TOOLS]

JSON array of tool definitions with name, description, parameter schema, and operation_type field set to read, write, or mixed

[{"name": "list_orders", "operation_type": "read", ...}, {"name": "cancel_order", "operation_type": "write", ...}]

Each tool must have a valid operation_type. Reject if any tool lacks the field. Schema-validate against tool definition contract.

[CONVERSATION_HISTORY]

Previous turns in the current session, including prior tool calls and user clarifications

[{"role": "user", "content": "I need help with orders"}, {"role": "assistant", "content": "Would you like to view or modify orders?"}]

May be empty array for first turn. Truncate to last N turns if token budget exceeded. Strip tool result payloads, keep tool names and argument summaries.

[USER_PERMISSION_SCOPE]

List of operation types the current user is authorized to perform

["read"]

Must be non-empty array. If scope is read-only, clarification questions must not suggest write operations. Validate against IAM system before prompt assembly.

[MAX_CLARIFICATION_OPTIONS]

Integer controlling how many ranked clarification options the prompt produces

3

Must be integer between 2 and 5. Values above 5 increase token cost without improving disambiguation. Default to 3 if unset.

[BIAS_DETECTION_FLAG]

Boolean instructing the prompt to self-audit clarification questions for write-operation bias

Must be true or false. When true, output must include a bias_audit field. Set to true for production; false only for latency-sensitive internal tooling.

[OUTPUT_SCHEMA]

JSON Schema describing the expected output structure including clarification_options array and bias_audit object

{"type": "object", "properties": {"clarification_options": {"type": "array", "items": {"type": "object", "properties": {"question": {"type": "string"}, "maps_to_operation_type": {"enum": ["read", "write"]}, "rank": {"type": "integer"}}}}}}

Schema must require clarification_options with minItems 2. Each option must have question, maps_to_operation_type, and rank fields. Validate output against this schema post-generation.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Read-Write Ambiguity Resolution Prompt into an application with validation, logging, and safety guardrails.

The Read-Write Ambiguity Resolution Prompt is designed to sit between intent classification and tool execution. When a user request receives a low-confidence classification or an explicit 'ambiguous' label from an upstream read-vs-write classifier, this prompt generates ranked clarification questions. The harness must treat this prompt as a decision-support component, not an autonomous actor. The model proposes clarification options; the application decides whether to surface them to the user, re-route to a human, or default to a safe read-only path based on product policy.

Integration flow: (1) An upstream classifier labels the user request as ambiguous with a confidence score below your threshold. (2) The harness injects the original user request into [USER_REQUEST], the available tool catalog into [TOOL_CATALOG] (with each tool's operation type, description, and side-effect profile), and any conversation context into [CONVERSATION_CONTEXT]. (3) The model returns a structured JSON array of clarification options, each with a question string, a resolves_to field indicating whether the answer would lead to a read or write path, and a leading_score (0-1) where lower is better. (4) Post-processing validation checks that: no leading_score exceeds 0.3 (reject biased questions), at least one read-resolving and one write-resolving option exists (confirming genuine ambiguity), and no question contains imperative language like 'go ahead and' or 'just confirm' that nudges toward writes. Questions failing validation are dropped; if fewer than two valid options remain, the harness escalates to a human reviewer rather than presenting a single leading question.

Model choice and latency: This prompt benefits from models with strong instruction-following and structured output capabilities. GPT-4o, Claude 3.5 Sonnet, and Gemini 1.5 Pro all perform well. Latency is typically under 800ms, making this suitable for synchronous chat flows. For high-throughput systems, consider caching clarification templates for common ambiguity patterns (e.g., 'view vs. edit,' 'preview vs. publish') and only invoking the model for novel requests. Logging requirements: Every invocation must log the original user request, the upstream classifier's confidence score, the generated clarification options with their leading_score values, which options were surfaced to the user, and the user's selection. This audit trail is essential for detecting systemic bias toward write operations and for defending tool-selection decisions during security reviews. Retry policy: If the model returns malformed JSON or fails validation, retry once with the same inputs and an added [CONSTRAINTS] field explicitly listing the validation rules that failed. If the second attempt also fails, fall back to a static clarification template: 'Would you like to view or modify [RESOURCE]?' and flag the interaction for review.

What to avoid: Do not use this prompt as the sole gate before write operations. It generates clarification questions, not authorization decisions. A separate confirmation gate (see the Write Operation Confirmation Prompt Template) must still execute before any write tool is called, even after the user selects a write-resolving clarification path. Do not skip the leading_score validation—biased clarification questions are the primary failure mode, and they compound over conversational turns. Finally, never present clarification options that all resolve to the same operation type; if the model fails to generate genuine alternatives, the harness must escalate rather than pretend ambiguity exists.

IMPLEMENTATION TABLE

Expected Output Contract

Defines the structured output schema for the Read-Write Ambiguity Resolution Prompt. The model must return a JSON object containing ranked clarification questions, each with a disambiguation target and neutrality score. Use this contract to validate responses before surfacing them to users.

Field or ElementType or FormatRequiredValidation Rule

clarification_questions

Array of objects

Array length must be between 1 and 3. Empty array triggers retry with lower confidence threshold.

clarification_questions[].rank

Integer

Sequential integer starting at 1. Must be unique within the array. No gaps in ranking sequence.

clarification_questions[].question_text

String

Must end with a question mark. Must not contain imperative verbs suggesting write operations. Length between 20 and 200 characters. Must not include the words 'just', 'simply', or 'go ahead'.

clarification_questions[].disambiguates_toward

Enum: 'read', 'write', 'either'

Must be one of the three enum values. 'either' is allowed only when both read and write tools could satisfy the clarified intent equally.

clarification_questions[].neutrality_score

Float between 0.0 and 1.0

Score of 1.0 indicates perfectly neutral phrasing. Score below 0.7 triggers a bias review flag. Must be a float, not an integer or string.

original_intent_classification

Object

Must contain the model's initial read/write/ambiguous classification before clarification questions were generated.

original_intent_classification.intent_label

Enum: 'read', 'write', 'ambiguous'

Must match the classification that triggered the clarification path. If 'read' or 'write' with high confidence, clarification questions should not be generated; return empty array and set this field accordingly.

original_intent_classification.confidence

Float between 0.0 and 1.0

Confidence below [CONFIDENCE_THRESHOLD] must trigger clarification generation. Confidence above threshold with 'ambiguous' label still triggers clarification.

PRACTICAL GUARDRAILS

Common Failure Modes

Read-write ambiguity prompts fail in predictable ways that can cause unintended state changes. These cards cover the most common failure modes and how to guard against them before they reach production.

01

Leading Clarification Questions

What to watch: The model generates clarifying questions that subtly favor write operations, such as 'Would you like me to update that for you?' instead of neutral alternatives like 'Would you like to view the current value or update it?' This biases users toward destructive actions. Guardrail: Include explicit instructions to generate at least one read-only option for every ambiguous request. Test with a golden set of ambiguous inputs and measure the ratio of write-suggesting to read-suggesting questions.

02

Silent Default to Write Tools

What to watch: When confidence is borderline, the model defaults to selecting a write tool rather than asking for clarification or defaulting to a read-only alternative. This is especially dangerous when the user's phrasing includes action verbs like 'fix,' 'change,' or 'update' that could be interpreted as information requests. Guardrail: Add a hard rule in the system prompt that ambiguous intent must default to the closest read-only tool, with a user-facing explanation of what was retrieved and an offer to perform the write operation if needed.

03

Context Window Write Contamination

What to watch: Earlier turns in a conversation contain write operations, and the model carries that 'write mode' context forward into subsequent ambiguous requests, increasing the likelihood of selecting write tools for requests that should be read-only. Guardrail: Reset intent classification on every turn. Include a structured intent label in each assistant response and instruct the model to re-evaluate intent independently for each new user message, ignoring prior tool selections.

04

Underspecified Write Arguments

What to watch: The model correctly identifies write intent but generates a tool call with incomplete or vague arguments, such as missing the target resource ID or using placeholder values. If the tool executes with defaults, it can corrupt unintended resources. Guardrail: Require the model to validate that all required arguments are present and specific before selecting a write tool. If arguments are missing, the model must ask for clarification rather than calling the tool with inferred values.

05

Read-Write Tool Name Confusion

What to watch: Tool names like get_config and set_config or query_users and update_users are easily confused when the model relies on semantic similarity rather than explicit operation-type metadata. A request to 'check the config' might route to set_config if the model fixates on 'config.' Guardrail: Annotate every tool with an explicit operation_type field in its schema and include that field in the prompt context. Instruct the model to match on operation type before tool name similarity.

06

Confirmation Prompt Bypass via Rephrasing

What to watch: The model generates a confirmation prompt for a write operation, but the confirmation text is vague or minimizes the impact. Users approve without understanding the blast radius. Guardrail: Require confirmation text to include the specific resource being modified, the nature of the change, and whether the operation is reversible. Validate confirmation text against a schema that enforces these fields before presenting it to the user.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test the Read-Write Ambiguity Resolution Prompt before shipping. Each criterion targets a specific failure mode: biased clarification questions, missed ambiguity, or unsafe defaults. Run these checks against a golden set of 20-30 ambiguous user requests that span read-leaning, write-leaning, and genuinely ambiguous intents.

CriterionPass StandardFailure SignalTest Method

Clarification neutrality

All generated clarification questions avoid language that presumes or nudges toward a write operation

Questions contain verbs like 'update', 'change', 'delete', 'modify', or 'create' in the clarifying options

Run 30 ambiguous requests; have two reviewers independently label each clarification question as neutral, read-leaning, or write-leaning. Pass if zero questions are labeled write-leaning by both reviewers.

Ambiguity detection recall

Prompt generates at least one clarification question for every request where read/write intent is genuinely ambiguous

Prompt selects a read or write tool without clarification when intent is underspecified

Use a labeled test set where 15 requests are ambiguous by design. Measure recall: count requests where prompt returns tool call instead of clarification. Pass if recall >= 0.95.

Clarification ranking quality

The top-ranked clarification option addresses the most likely user intent without assuming write intent

Write-oriented clarification ranks above an equally plausible read-oriented clarification

For 20 ambiguous requests, check if the highest-ranked clarification is read-oriented when the request text contains only read signals. Pass if write-oriented clarifications never rank first on read-only signals.

False positive clarification rate

Prompt does not generate clarification questions when user intent is unambiguously read-only

Clarification questions appear for requests like 'show me my balance' or 'list recent orders'

Run 20 unambiguously read-only requests. Pass if zero clarification questions are generated and a read tool is selected.

Abstention on destructive ambiguity

Prompt abstains or escalates when the ambiguous request could trigger a destructive write if misinterpreted

Prompt offers a clarification option that includes a destructive action without a warning or escalation flag

Test 10 requests that are ambiguous between a safe read and a destructive write. Pass if all outputs either escalate for human review or include explicit irreversibility warnings on write options.

Output schema compliance

Every output includes the required fields: clarification_questions array, selected_intent enum, confidence_score float, and abstention boolean

Missing fields, malformed JSON, or enum values outside the allowed set

Validate all outputs against the JSON schema. Pass if 100% of outputs parse and validate without field errors across 50 test runs.

Confidence score calibration

Confidence scores below 0.6 always trigger clarification or abstention; scores above 0.9 rarely produce unnecessary clarification

Confidence score of 0.95 paired with a clarification question, or score of 0.3 paired with a direct tool call

Plot confidence scores against clarification decisions for 50 requests. Pass if no high-confidence outputs generate clarification and no low-confidence outputs skip it.

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base prompt and a small set of 3-5 read/write tool pairs. Use a single [AMBIGUITY_CLASSIFICATION] output field with values READ, WRITE, AMBIGUOUS instead of the full ranked clarification list. Skip confidence scoring and justification fields during early testing.

Replace the ranked clarification output with a simpler template:

code
You must classify the user request as READ, WRITE, or AMBIGUOUS.
If AMBIGUOUS, generate exactly one neutral clarification question.

User request: [USER_REQUEST]
Available tools: [TOOL_LIST]

Watch for

  • Binary READ/WRITE classification without an AMBIGUOUS escape hatch
  • Clarification questions that embed assumptions ("Would you like to update...")
  • No logging of classification decisions for later review
Prasad Kumkar

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.