Inferensys

Prompt

Slot-Filling Clarification Prompt for Structured Data

A practical prompt playbook for building progress-aware form-filling agents that request only the next missing critical field, validate incremental slot collection, and handle early termination without losing collected data.
Developer reviewing multi-agent chat interface on laptop, agent conversation logs visible, casual coding session at WeWork desk.
PROMPT PLAYBOOK

When to Use This Prompt

A practical guide for deciding when to deploy a slot-filling clarification prompt in a conversational AI agent and when to choose a different pattern.

This prompt is designed for AI agents that must collect multiple structured fields from a user across several conversational turns. The core job-to-be-done is incremental, validated data intake for a known schema. Ideal users are developers building form-filling assistants, onboarding bots, data-intake agents for CRMs, or any workflow where a user provides information piece by piece in a chat. The required context is a predefined, ordered list of critical fields (a schema) and a mechanism to track which slots have been successfully filled. The prompt's primary value is its progress-awareness: it requests only the next unfilled critical field, validates the user's response against the field's constraints, and then moves on, rather than overwhelming the user with a wall of questions or silently hallucinating defaults for missing data.

You should use this prompt when the user's goal is to complete a known form or record, and the interaction is a cooperative, turn-by-turn dialogue. For example, an IT support bot collecting details for a ticket (e.g., [SEVERITY], [SYSTEM], [SUMMARY]) or an HR onboarding agent gathering new-hire information. The implementation must include a state manager outside the prompt to track filled slots and a validator for each incoming piece of data. A critical constraint is that the agent must never guess or assume a value for a missing field. If a user provides information for multiple fields in one turn, the harness should validate and fill all applicable slots before prompting for the next missing one. The prompt is not suitable when all required fields are available upfront in a single user message, when the schema is dynamic and cannot be defined ahead of time, or when the user expects to provide information in a freeform, unstructured manner without guided prompts.

Do not use this prompt for open-ended conversations, for collecting a single piece of data, or when the cost of a wrong field is low enough that a batch confirmation at the end is sufficient. If the workflow involves high-risk data (e.g., personally identifiable information, financial details, or healthcare data), the harness must include a human review step before the collected data is written to a system of record. The next step after reading this section is to define your exact field schema and failure modes before adapting the prompt template in the following section.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Slot-Filling Clarification Prompt works well and where it introduces risk. Use these cards to decide if this pattern fits your workflow before you integrate it.

01

Good Fit: Multi-Field Data Entry Agents

Use when: your agent must collect several structured fields (e.g., name, date, policy number) before executing an action. Guardrail: The prompt requests only the next missing critical field, preventing overwhelming the user with a long form in natural language.

02

Bad Fit: Single-Question Chat Interactions

Avoid when: the user's request can be fulfilled in one turn without collecting multiple data points. Guardrail: Adding a slot-filling loop to a simple Q&A flow introduces unnecessary friction and makes the system feel bureaucratic rather than helpful.

03

Required Inputs: A Defined Schema with Required Flags

What to watch: The prompt cannot function without a clear list of required fields, their descriptions, and example values. Guardrail: Maintain a machine-readable schema (JSON Schema or equivalent) that the harness uses to track which slots are filled, not just a natural language list in the prompt.

04

Operational Risk: Infinite Clarification Loops

What to watch: A user who repeatedly provides invalid or incomplete data can get stuck in a loop of clarification requests. Guardrail: Implement a maximum retry count (e.g., 3 attempts per slot) in the application harness, after which the system escalates to a human agent with the collected context.

05

Operational Risk: Early Termination Without Cleanup

What to watch: Users may abandon the flow mid-collection, leaving partial, unvalidated data in your system. Guardrail: The harness must detect session abandonment and either discard the incomplete record or flag it for manual review, never treating a partially filled form as a completed transaction.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable system prompt that tracks filled slots, identifies the next missing critical field, and asks for exactly that field with an example and a reason.

This prompt template implements a progress-aware slot-filling agent. Instead of overwhelming the user with a request for all missing fields at once, the agent maintains an internal state of collected fields, identifies the single highest-priority unfilled slot, and asks a targeted clarification question. This reduces user friction, prevents partial submissions, and ensures that the agent never hallucinates default values for required fields. The template uses square-bracket placeholders that you replace with your specific schema, field priorities, and output format before deployment.

text
You are a structured data collection agent. Your job is to collect the required fields defined in [SCHEMA_DEFINITION] from the user through a series of targeted questions. You must never invent, guess, or assume values for any field.

## Current State
- Fields already collected: [COLLECTED_FIELDS_JSON]
- Fields still needed: [REMAINING_FIELDS_LIST]
- Conversation history summary: [CONVERSATION_SUMMARY]

## Behavior Rules
1. Identify the single highest-priority unfilled field from [REMAINING_FIELDS_LIST] according to the priority order in [FIELD_PRIORITY_ORDER].
2. Ask the user for exactly that field. Your response must contain:
   - A brief acknowledgment of what has been collected so far.
   - The specific question for the next field.
   - A concrete example of a valid value.
   - A one-sentence explanation of why this field is needed.
3. If the user provides a value that does not match the expected type or constraints in [SCHEMA_DEFINITION], respond with the validation error and ask again with the example.
4. If the user asks to skip a non-critical field (marked `required: false` in [SCHEMA_DEFINITION]), mark it as skipped and move to the next field.
5. If the user asks to skip a critical field (marked `required: true`), explain that the field is required and cannot be skipped, then re-ask with the reason.
6. If the user provides multiple field values in one message, accept all valid ones, update [COLLECTED_FIELDS_JSON], and ask for the next unfilled field.
7. When all required fields are collected, output a summary of all collected fields in [OUTPUT_FORMAT] and ask the user to confirm before proceeding.
8. If the user indicates they want to stop or cancel, output the partially collected fields in [OUTPUT_FORMAT] with a `status: cancelled` flag and stop asking questions.

## Constraints
- Never ask for more than one field at a time.
- Never fabricate field values.
- If the user's input is ambiguous for the current field, ask a clarifying sub-question before accepting the value.
- Respect the validation rules in [SCHEMA_DEFINITION] for each field.

Adaptation guidance: Replace [SCHEMA_DEFINITION] with your full field schema including field names, types, required flags, validation rules, and descriptions. Replace [COLLECTED_FIELDS_JSON] with the current state object from your application's session store. Replace [REMAINING_FIELDS_LIST] with the computed list of unfilled fields. Replace [FIELD_PRIORITY_ORDER] with an ordered list of field names indicating which fields to collect first. Replace [CONVERSATION_SUMMARY] with a brief summary of prior turns. Replace [OUTPUT_FORMAT] with your desired output schema, such as a JSON structure or a formatted text block. Wire the prompt into your application so that [COLLECTED_FIELDS_JSON] and [REMAINING_FIELDS_LIST] are updated after every user turn and fed back into the system prompt on the next invocation. Validate every collected value against your schema in application code before marking it as collected. If the agent produces a final summary, route it to a confirmation step or a human review queue before any downstream action is taken.

IMPLEMENTATION TABLE

Prompt Variables

Provide these variables at runtime from your application state. The slot-filling engine uses them to track progress, identify the next missing field, and generate a targeted clarification question.

PlaceholderPurposeExampleValidation Notes

[REQUIRED_SCHEMA]

JSON Schema defining all fields to collect, their types, descriptions, and required status

{"type":"object","properties":{"name":{"type":"string","description":"Full name"},"email":{"type":"string","format":"email"}},"required":["name","email"]}

Must parse as valid JSON Schema. Required array must be non-empty. Each property must have a description field for clarification generation.

[COLLECTED_VALUES]

Object containing field-value pairs already successfully collected from the user

{"name":"Jane Doe"}

Keys must match property names in [REQUIRED_SCHEMA]. Values must conform to the type and format constraints of the corresponding schema property. Null allowed for fields not yet collected.

[CONVERSATION_HISTORY]

Array of prior user and assistant turns for context-aware clarification

[{"role":"user","content":"I need to register"},{"role":"assistant","content":"I can help with that. What is your full name?"}]

Must be a valid array of message objects with role and content. Include at minimum the current turn. Truncate to fit context window if needed.

[MAX_CLARIFICATION_ATTEMPTS]

Integer limit on how many times the system can ask for the same field before escalating

3

Must be a positive integer. When exceeded, the harness must trigger the escalation path defined in [ESCALATION_HANDLER] rather than re-prompting.

[ESCALATION_HANDLER]

Function or endpoint reference for when slot-filling fails or user requests to cancel

humanReviewQueue.submit

Must be a callable reference in the application harness. Harness must verify the handler is reachable before starting the slot-filling loop. Return type must include a confirmation of receipt.

[TERMINATION_PHRASES]

List of user phrases that signal intent to stop or cancel the slot-filling process

["cancel","never mind","stop","I changed my mind"]

Must be a non-empty array of strings. Harness should perform case-insensitive substring matching. False positives on common words like 'stop' should be logged for review.

[CLARIFICATION_STYLE]

Enum controlling the verbosity and tone of the generated clarification question

"concise"

Must be one of: "concise", "friendly", "formal". Harness should validate the enum value before prompt assembly. Default to "concise" if not provided.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the slot-filling clarification prompt into an application with validation, state management, and termination handling.

The slot-filling clarification prompt is not a standalone chat message; it is a stateful component inside a structured data collection loop. The application must maintain a session state object that tracks which slots are filled, which are missing, and which are critical versus optional. Before each call to the model, the harness assembles the prompt by injecting the current state: the list of filled slots with their values, the list of remaining required slots with their descriptions, and any optional slots the user may choose to provide. The model receives this context and returns a targeted clarification question for the next missing critical field—never a request for all fields at once. The harness then parses the model's output, validates that it asks for exactly one missing field, and presents that question to the user.

Validation and state updates are the core of the harness. After the user responds to a clarification question, the application must extract the provided value and update the session state. A strict validator should confirm that the user's response actually addresses the field that was requested—not a different field, and not a refusal to answer. If the user provides a value for a different slot, the harness should accept it and update that slot as well, but it must still re-evaluate which field is the next missing critical slot. If the user's response is empty, a refusal, or an 'I don't know,' the harness should mark that slot as explicitly declined (not missing) and move to the next required field. This prevents infinite loops where the model repeatedly asks for the same information. The harness should also enforce a maximum clarification round limit (e.g., 5 rounds) after which it terminates the collection and returns whatever partial data has been gathered, along with a warning about incomplete fields.

Early termination and escalation must be handled explicitly. The prompt template includes a [TERMINATION_CONDITIONS] placeholder where you inject rules such as: if the user says 'cancel,' 'stop,' or 'never mind,' the agent must immediately stop asking questions and return a summary of collected data. The harness should scan user responses for these termination signals before forwarding them to the model. When termination is detected, the harness bypasses the model entirely and returns the partial state with a terminated: true flag. For high-stakes data collection (e.g., healthcare intake, financial onboarding, legal forms), the harness should also log every clarification round—the question asked, the user's raw response, the extracted value, and the validator result—to an audit trail. This log enables human review if the collected data is later found to be incomplete or incorrect. Do not rely on the model to enforce termination or audit logging; these are application-layer responsibilities.

Model choice and retry logic matter for reliability. This prompt works well with instruction-following models (GPT-4, Claude 3.5, Gemini 1.5 Pro) but can drift with smaller models that may ask for multiple fields at once or hallucinate slot descriptions. Implement a structural validator that checks the model's output before showing it to the user: the output must contain exactly one question, must reference a field that is actually in the missing-slots list, and must not ask for fields already filled. If validation fails, retry once with an error message injected into the prompt context (e.g., 'Your previous response asked for multiple fields. Ask for only the next missing field.'). If the retry also fails, fall back to a template-based question generated directly from the slot schema, bypassing the model. This ensures the collection loop never stalls on a model formatting error. For production systems, consider caching the prompt prefix with the slot schema and state structure to reduce token costs across repeated calls in the same session.

IMPLEMENTATION TABLE

Expected Output Contract

Validation rules for the slot-filling clarification response. Every field must pass these checks before the harness allows the agent to proceed or present the clarification to the user.

Field or ElementType or FormatRequiredValidation Rule

clarification_type

string enum: ["missing_slot", "ambiguous_value", "validation_failed", "none"]

Must match exactly one enum value. If "none", all other fields except [COLLECTED_SLOTS] must be null.

target_slot

string matching a key in [SLOT_SCHEMA]

true if clarification_type != "none"

Must be a valid key from the provided slot schema. Null only when clarification_type is "none".

clarification_question

string

true if clarification_type != "none"

Must be a single, specific question asking for the missing or ambiguous value. Must not ask for multiple slots at once. Must not exceed 150 characters.

suggested_values

array of strings

If present, must contain 2-5 concrete example values valid for the target_slot. Must not include placeholder text like "example_value".

collected_slots

object mapping slot keys to collected values

Must be a valid JSON object. Keys must match [SLOT_SCHEMA]. Values must pass the schema's per-slot validation rules. Must include all slots collected so far, even if empty.

missing_slots

array of strings

Must list all slot keys from [SLOT_SCHEMA] that are not yet collected. Must include the target_slot if clarification is active. Must be empty when clarification_type is "none".

confidence

number between 0.0 and 1.0

Must be a float. If confidence < 0.7 for any collected slot value, clarification_type must not be "none" for that slot.

halt_instruction

string enum: ["ask_user", "proceed", "escalate"]

Must be "ask_user" when clarification_type is not "none". Must be "proceed" only when all slots are collected and validated. Must be "escalate" if retry count exceeds [MAX_CLARIFICATION_RETRIES].

PRACTICAL GUARDRAILS

Common Failure Modes

Slot-filling prompts break in predictable ways when deployed. These are the most common failure modes and the operational guardrails that prevent them.

01

Asking for All Missing Slots at Once

What to watch: The model requests every unfilled field in a single turn, overwhelming the user with a wall of questions. This happens when the prompt lacks explicit sequencing instructions. Guardrail: Add a hard constraint to request only the single highest-priority missing slot per turn. Validate output length and question count before surfacing to the user.

02

Silently Hallucinating Default Values

What to watch: The model fills empty slots with plausible but unconfirmed values instead of asking for clarification. Common with optional fields that have common defaults. Guardrail: Require explicit user confirmation for any slot value not directly extracted from user input. Log all auto-filled values for audit and flag any slot filled without source evidence.

03

Re-Asking for Already-Provided Information

What to watch: The model loses track of previously collected slots and asks the user to repeat information. This breaks user trust and stalls form completion. Guardrail: Maintain a structured slot state object across turns. Before generating any clarification question, validate that the target slot is genuinely unfilled by checking the current state.

04

Continuing Past Early Termination Signals

What to watch: The user signals they want to stop, cancel, or abandon the form, but the model continues asking for the next missing slot. Guardrail: Classify every user turn for termination intent before slot-filling logic runs. If termination confidence exceeds threshold, halt slot collection and confirm cancellation with a summary of what was collected.

05

Accepting Invalid or Nonsensical Slot Values

What to watch: The model accepts user-provided values that violate the slot's type, format, or domain constraints without challenging them. Guardrail: Run every collected slot value through a schema validator immediately. If validation fails, generate a targeted re-clarification that explains the constraint and asks for a corrected value.

06

Losing Slot State Across Model Calls

What to watch: In stateless architectures, the model has no memory of prior turns and either restarts slot collection or hallucinates prior values. Guardrail: Always inject the current slot state object into the prompt context. If state is empty or corrupted, explicitly acknowledge the reset and re-confirm any previously collected values before continuing.

IMPLEMENTATION TABLE

Evaluation Rubric

Run these checks against a golden dataset of 20-50 multi-turn slot-filling conversations. Each row defines a pass/fail criterion for the Slot-Filling Clarification Prompt before shipping.

CriterionPass StandardFailure SignalTest Method

Incremental Slot Request

Agent requests exactly one missing critical field per turn, not all missing fields at once.

Agent lists multiple missing fields or repeats already-filled slots in the clarification question.

Parse agent turn for field count. Assert count equals 1 and field is in [MISSING_SLOTS].

Progress State Accuracy

Agent correctly reports which slots are filled and which remain after each user turn.

Agent marks a slot as filled when the value was not provided or marks a slot as missing when a valid value was given.

Compare agent's internal state summary against ground-truth slot map for the conversation turn.

Early Termination Handling

Agent accepts a termination command (e.g., 'cancel', 'stop') and confirms exit without requesting more fields.

Agent ignores termination, requests another field, or continues the workflow after a stop command.

Inject termination command mid-flow. Assert agent response contains confirmation and no further slot requests.

Value Validation on Receipt

Agent validates a user-provided value against the slot's expected type or format and re-asks if invalid.

Agent accepts an invalid value (e.g., 'banana' for a date field) without challenge and marks the slot as filled.

Provide an invalid value for a typed slot. Assert agent response is a re-clarification, not a progress update.

No Hallucinated Defaults

Agent never fills a missing slot with an assumed or default value without explicit user confirmation.

Agent proceeds to the next slot or final summary with a value the user did not provide.

Audit final slot map. Assert no slot contains a value absent from the conversation transcript.

Context Retention Across Turns

Agent retains all previously collected slot values across the full multi-turn interaction.

Agent forgets an earlier slot value and re-asks for it, or produces a final summary with a missing value.

Run full conversation through harness. Assert final output contains all values from ground-truth slot map.

Clarification Specificity

Clarification question includes the field name, a brief description, and an example format.

Clarification is vague (e.g., 'Please provide more details') without naming the specific missing field.

Check clarification turn for presence of field name from schema and an example format string.

Final Output Schema Compliance

After all slots are filled, agent outputs a valid JSON object matching the target schema exactly.

Output is missing required fields, contains extra fields, or uses incorrect types for field values.

Validate final output against target JSON Schema. Assert strict validation passes with no errors.

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base prompt and a simple JSON schema for the target form. Use a single-turn conversation where the model receives the current filled slots and returns the next clarification question. Skip progress tracking and early termination for the first iteration.

code
You are collecting information for [FORM_NAME].

Required fields: [FIELD_LIST]
Already collected: [FILLED_SLOTS_JSON]

Ask the user for the next missing required field. Ask for only one field at a time.
Return JSON: {"question": string, "field_requested": string, "example": string}

Watch for

  • Model asking for multiple fields at once despite instructions
  • No validation that the returned field_requested is actually missing
  • Hallucinated example values that don't match the field type
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.