Inferensys

Prompt

Voice Assistant Barge-In Recovery Prompt

A practical prompt playbook for using Voice Assistant Barge-In Recovery 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

Defines the precise conditions, required inputs, and failure boundaries for the Voice Assistant Barge-In Recovery Prompt.

This prompt is designed for a specific moment in a voice assistant pipeline: the system has detected a barge-in event, meaning the user began speaking while the assistant's text-to-speech (TTS) output was still playing. The core job is not to detect the interruption itself—your audio stack must already provide the barge-in signal and a partial ASR transcript of the overlapping speech. Instead, this prompt reconstructs what the user likely heard before they interrupted, extracts their new intent from the overlapping audio, and produces a structured recovery decision: continue the original response, restart it, or abandon it entirely. The ideal user is a developer or AI engineer integrating this prompt into a voice agent's turn-management logic, where losing context across an interruption leads to confusing, repetitive, or contradictory assistant behavior.

To use this prompt effectively, you must supply three critical inputs: the full text of the in-progress TTS response that was playing when the interruption occurred, the partial ASR transcript captured during the barge-in window, and a precise timestamp or word-index marker indicating how much of the TTS response had been spoken before the interruption. Without this temporal alignment, the model cannot reliably determine what the user heard versus what was queued but never vocalized. The prompt also expects a structured output schema, typically including fields for heard_segment (the reconstructed portion of the TTS response the user likely heard), barge_in_intent (the classified intent of the interrupting speech), recovery_action (one of continue, restart, or abandon), and rationale (a concise explanation linking the evidence to the decision).

Do not use this prompt when the interruption is a false positive—such as background noise, coughs, or cross-talk that does not contain a genuine user intent. It is also inappropriate for scenarios where the ASR transcript is empty or entirely unintelligible; in those cases, a simpler heuristic like 'ignore and continue' or 'reprompt the user' is more reliable and cost-effective. This prompt assumes the barge-in contains a meaningful user utterance that should change the assistant's behavior. If your system cannot distinguish between a true barge-in and ambient noise at the audio level, invest in that upstream classification before wiring in this recovery logic. Finally, avoid using this prompt for long-running agent tasks where the interruption invalidates multiple completed steps; that scenario requires a more complex state-checkpointing workflow covered by the Interrupted Agent Workflow Resume Prompt Template.

PRACTICAL GUARDRAILS

Use Case Fit

Where this prompt works in production voice pipelines and where it introduces more risk than it resolves.

01

Good Fit: ASR-Integrated Voice Assistants

Use when: your pipeline has access to both the partial ASR transcript of the barge-in utterance and a timestamped log of the TTS output that was playing at interruption time. Guardrail: feed the prompt the exact TTS text segment active during the overlap window, not the full prior response.

02

Bad Fit: Text-Only Chat Without Streaming

Avoid when: the system has no concept of in-progress output or real-time interruption. Text-based chat with discrete turn boundaries does not produce barge-in events. Guardrail: use turn-level correction prompts instead of barge-in recovery for async messaging.

03

Required Input: Overlap Window Evidence

What to watch: the prompt cannot recover intent without knowing what the user likely heard. Guardrail: always supply the TTS segment active during the barge-in window, the partial ASR transcript, and the pre-interruption dialogue state. Missing any of these produces hallucinated recovery plans.

04

Operational Risk: Cascading Recovery Failures

What to watch: a low-confidence barge-in recovery that restarts the wrong response can trigger a second interruption, creating a loop. Guardrail: if the recovery confidence score falls below your calibrated threshold, default to a safe restart prompt that asks the user to repeat their request rather than guessing.

05

Latency Risk: Real-Time Deadline Miss

What to watch: barge-in recovery must complete within the voice interaction latency budget, typically under 200ms for natural turn-taking. Guardrail: set a hard timeout on the recovery inference. If the model does not return a recovery plan within the deadline, fall back to a static continuation prompt and log the timeout for observability.

06

Model Fit: Requires Strong Instruction Following

What to watch: smaller or older models may conflate the interrupted response with the user's new intent, producing a blended output. Guardrail: test with your target model using recorded barge-in samples. If the model cannot cleanly separate the TTS context from the user's new utterance in eval, route barge-in recovery to a more capable model or use a simpler restart strategy.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt with square-bracket placeholders that reconstructs user intent after a barge-in interruption and decides whether to continue, restart, or abandon the prior assistant response.

This template is designed to be injected into your voice assistant's dialogue manager immediately after the speech endpointing layer detects a barge-in event. It receives the assistant's interrupted text, the user's overlapping utterance, and the prior turn context. The prompt's job is not to generate a new response directly, but to produce a structured recovery decision that your application harness can act on: determining what the user likely heard, what they intended, and whether the prior response track is still viable. Replace every square-bracket placeholder with live data from your ASR output, text-to-speech buffer, and dialogue state store before sending this to the model.

text
You are a voice assistant dialogue recovery module. Your task is to analyze a barge-in event where the user began speaking while the assistant was mid-response. You must reconstruct what the user likely heard, extract their barge-in intent, and recommend a recovery action.

## INPUTS

[PRIOR_TURN_SUMMARY]
Summary of the conversation before the assistant's interrupted response began. Include active intents, filled slots, and pending questions.

[ASSISTANT_RESPONSE_FULL_TEXT]
The complete text of the assistant response that was playing when the interruption occurred.

[ASSISTANT_WORDS_PLAYED_BEFORE_INTERRUPTION]
The prefix of the assistant response that was actually spoken before the user's speech overlapped. This is the portion the user likely heard.

[USER_BARGE_IN_UTTERANCE]
The user's overlapping speech, as transcribed by ASR. May be partial or noisy.

[USER_BARGE_IN_START_OFFSET_MS]
Milliseconds into the assistant response when the user began speaking.

[CONVERSATION_STATE_JSON]
Current dialogue state object including active slots, pending confirmations, and unresolved questions.

## OUTPUT SCHEMA

Return a valid JSON object with exactly these fields:

{
  "heard_prefix_summary": "String. What the user most likely heard before interrupting. Be conservative; note if the interruption point makes the heard content ambiguous.",
  "barge_in_intent": "String. Classify as one of: 'correction' (user is fixing something the assistant said or is about to say), 'answer_anticipation' (user is answering a question before it was fully asked), 'topic_shift' (user is changing the subject entirely), 'interjection' (user is adding a brief acknowledgment or filler), 'unclear' (insufficient signal to classify).",
  "intent_confidence": "Float between 0.0 and 1.0. Your confidence in the barge_in_intent classification.",
  "extracted_slots": "Object. Any slot values extractable from the user's barge-in utterance that update or add to the conversation state.",
  "recovery_action": "String. One of: 'continue' (the prior response track remains valid; resume from the interruption point or slightly before), 'restart' (the prior response is invalidated; generate a new response addressing the barge-in intent), 'abandon' (the prior response topic is no longer relevant; treat the barge-in as a new turn and discard the interrupted response), 'clarify' (insufficient information to decide; ask the user to repeat or clarify).",
  "restart_context": "String or null. If recovery_action is 'restart' or 'abandon', provide the key context the response generator needs. If 'continue' or 'clarify', set to null.",
  "requires_confirmation": "Boolean. True if the assistant should confirm its understanding with the user before proceeding, such as when extracted_slots are low-confidence or the barge-in intent is unclear.",
  "rationale": "String. Brief explanation of your recovery decision, referencing what the user heard and why the chosen action is appropriate."
}

## CONSTRAINTS

- Do not invent facts the user did not say. If the barge-in utterance is noisy or partial, reflect that in your confidence and prefer 'clarify' over guessing.
- If the user interrupted very early in the assistant response (first few words), they likely did not hear enough context. Consider whether the barge-in is a correction to the prior turn rather than the interrupted response.
- If the user's utterance is an acknowledgment ('ok', 'got it', 'thanks'), prefer 'continue' or 'abandon' based on whether the assistant was mid-information or mid-question.
- Preserve any confirmed slots from [CONVERSATION_STATE_JSON] unless the user's barge-in explicitly contradicts them.
- If recovery_action is 'continue', the response generator will need to know where to resume. Include enough detail in heard_prefix_summary to support that.

Adapt this template by tightening the barge_in_intent taxonomy to match your product's actual interruption patterns. If your voice assistant frequently encounters mid-question answers, add an answer_anticipation handler in your dialogue manager that skips the rest of the question and proceeds with the user's answer. If your ASR produces confidence scores, pass them alongside [USER_BARGE_IN_UTTERANCE] and add a [USER_ASR_CONFIDENCE] placeholder so the model can weigh transcription quality in its recovery decision. For high-stakes domains where incorrect slot extraction has real consequences, set requires_confirmation to true by default in your harness for any recovery action other than continue, overriding the model's judgment when safety matters more than latency.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the Voice Assistant Barge-In Recovery Prompt. Each variable must be populated before the prompt is assembled. Missing or malformed inputs will cause the recovery logic to fail silently or hallucinate context.

PlaceholderPurposeExampleValidation Notes

[PRIOR_RESPONSE_TEXT]

The full text of the assistant's in-progress response that was interrupted by the user's barge-in.

"Your upcoming flight UA 842 departs from Terminal C, Gate 12 at 4:30 PM. Boarding begins at 3:45 PM. Would you like me to..."

Must be a non-empty string. Truncate to last 500 tokens if longer. Null not allowed; if unavailable, set to empty string and flag for degraded mode.

[RESPONSE_PROGRESS_INDEX]

The estimated word or token index within [PRIOR_RESPONSE_TEXT] where the interruption occurred, indicating how much the user likely heard.

42

Must be an integer between 0 and length of [PRIOR_RESPONSE_TEXT]. If unknown, set to -1 to trigger full re-delivery. Validate range before prompt assembly.

[BARGE_IN_TRANSCRIPT]

The raw ASR transcript of the user's interrupting speech, including any partial or noisy recognition results.

"wait no not terminal C I need terminal"

Must be a non-empty string. If ASR confidence is below 0.6, prepend '[LOW_CONFIDENCE]' tag. Null not allowed; if unavailable, abort recovery and re-prompt user.

[SESSION_CONTEXT_SUMMARY]

A structured summary of the conversation state before the interruption, including confirmed slots, pending actions, and active intents.

"Intent: flight_status_check. Confirmed: flight_number=UA842, date=2025-03-15. Pending: terminal_confirmation, gate_confirmation."

Must be valid JSON with keys: intent, confirmed_slots, pending_slots. If session state is unavailable, pass empty JSON object {}. Validate parse before use.

[INTERRUPTION_TIMESTAMP_MS]

The relative or absolute timestamp in milliseconds when the barge-in began, used to correlate with audio overlap windows.

1742058000000

Must be a positive integer. If unknown, set to 0. Used for logging and eval trace alignment only; does not affect core recovery logic.

[ASR_CONFIDENCE_SCORE]

The confidence score from the speech recognition engine for the barge-in transcript segment.

0.82

Must be a float between 0.0 and 1.0. If below 0.5, the recovery prompt should request confirmation before acting. If null, default to 0.5 and flag for human review in high-stakes domains.

[ACTIVE_TOOL_CALLS]

A list of any function calls or tool invocations that were in progress when the interruption occurred, including their status.

[{"tool": "flight_status_lookup", "status": "in_progress", "args": {"flight": "UA842"}}]

Must be a valid JSON array. If no tools were active, pass empty array []. Validate schema: each object must have tool, status, and args keys. Null not allowed.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the barge-in recovery prompt into a voice pipeline with validation, retries, and state management.

The barge-in recovery prompt is not a standalone component; it sits inside a voice pipeline that must detect the interruption, capture the overlapping audio, transcribe the user's barge-in utterance, and then call this prompt to decide what to do next. The implementation harness must handle the full lifecycle: interruption detection from the voice activity detector (VAD) or stream endpoint, partial ASR on the overlapping segment, prompt assembly with pre-interruption context, and post-prompt action execution. Wire this prompt as a synchronous call after the ASR result for the barge-in segment is available, but before the system decides whether to replay, resume, or abandon the prior TTS output. The latency budget is tight—typically under 500ms end-to-end from end of barge-in speech to the system's next action—so keep the prompt concise and avoid unnecessary context bloat.

The harness requires four concrete inputs mapped to the prompt's placeholders. [PRIOR_RESPONSE_TEXT] is the exact text the system was speaking when the interruption occurred, truncated to the last N words actually sent to the TTS engine. [BARGE_IN_TRANSCRIPT] is the ASR output from the overlapping audio segment, which may be partial or noisy. [SESSION_CONTEXT] is a structured summary of the conversation state before the interruption, including active intents, filled slots, and pending actions. [INTERRUPTION_TIMING] captures the estimated word position or timestamp where the user began speaking relative to the prior response. Validate all four inputs before calling the model: if [BARGE_IN_TRANSCRIPT] is empty or below a confidence threshold, skip the prompt and execute a default clarification strategy (e.g., 'Sorry, I didn't catch that'). If [PRIOR_RESPONSE_TEXT] is missing, the prompt cannot reason about what the user heard, so fall back to treating the barge-in as a fresh turn.

Model choice matters. Use a fast, low-latency model for this prompt—GPT-4o-mini, Claude 3.5 Haiku, or Gemini 1.5 Flash are good candidates. Avoid large models that add hundreds of milliseconds of inference time. The output must be structured JSON with three fields: recovery_action (one of continue, restart, abandon, clarify), adjusted_response (the text to speak next, or null if abandoning), and rationale (a one-sentence explanation for logging). Validate the output schema strictly: if recovery_action is not in the allowed enum, default to clarify. If adjusted_response is provided for an abandon action, discard it. Log every prompt call with the inputs, outputs, latency, and the eventual user-facing action taken. This trace is essential for tuning interruption sensitivity and detecting false-positive barge-in triggers from background noise or self-talk.

Retries are rarely appropriate for this prompt because the latency cost of a second model call usually exceeds the user's patience. If the output fails schema validation, apply the default clarify action immediately rather than retrying. The exception is a malformed JSON response where a repair prompt can fix the structure in a single fast retry; implement a lightweight repair step that only corrects syntax, not semantics. For high-stakes voice applications—healthcare triage, financial transactions, emergency dispatch—add a human review flag when recovery_action is abandon and the prior response contained critical information. In these cases, log the full context for post-session review rather than silently dropping important content.

The prompt's output must feed directly into the TTS controller and dialogue state manager. If recovery_action is continue, send adjusted_response to TTS and update the dialogue state to reflect that the prior response was partially delivered. If restart, replay the full adjusted response from the beginning and reset the TTS cursor. If abandon, flush the TTS queue, acknowledge the user's interruption, and transition to processing the barge-in utterance as a new turn. If clarify, speak a clarification question and pause for user response. Wire the rationale field into your observability stack alongside VAD events, ASR confidence scores, and TTS playback timestamps. This end-to-end traceability is what separates a debuggable voice assistant from a black box that frustrates users with unpredictable interruption behavior.

IMPLEMENTATION TABLE

Expected Output Contract

Fields, format, and validation rules for the structured JSON object returned by the Voice Assistant Barge-In Recovery Prompt. Use this contract to parse, validate, and route the model's output in your application harness.

Field or ElementType or FormatRequiredValidation Rule

recovery_decision

enum: continue | restart | abandon | clarify

Must be exactly one of the four allowed enum values. Reject any other string.

heard_context

string (max 500 chars)

Must be a non-empty summary of what the user likely heard before interruption. Null or empty string triggers retry.

barge_in_intent

string (max 200 chars)

Must be a concise description of the user's interrupting intent. Reject if length exceeds 200 characters or contains only whitespace.

confidence_score

number (0.0 - 1.0)

Must be a float between 0.0 and 1.0 inclusive. Values outside range trigger retry. Below [CONFIDENCE_THRESHOLD] should route to clarification.

updated_dialogue_state

object

Must be a valid JSON object containing at minimum active_intent, filled_slots, and pending_actions keys. Schema validation required.

resume_plan

string (max 1000 chars) or null

If recovery_decision is continue or restart, must be a non-null string describing next steps. If abandon or clarify, must be null.

stale_context_flags

array of strings

Must be a JSON array of slot or fact names invalidated by the interruption. Empty array is valid. Each element must be a non-empty string.

requires_user_confirmation

boolean

Must be true if confidence_score is below [CONFIDENCE_THRESHOLD] or if barge-in intent is ambiguous. False otherwise. Cross-field validation required.

PRACTICAL GUARDRAILS

Common Failure Modes

Voice barge-in recovery is inherently lossy. The model must reconstruct partial audio, infer user intent from fragments, and decide whether to continue or abandon a prior response. These are the most common failure modes and how to guard against them.

01

Hallucinated Overlap Reconstruction

What to watch: The model invents words the user never said to fill gaps in the partial audio transcript, creating a coherent but false reconstruction. This is most common when the ASR output is noisy or the interruption is very brief. Guardrail: Require the prompt to output a reconstruction_confidence score (0-1) and a missing_segments flag. If confidence is below 0.7 or segments are flagged, the system must request confirmation before acting on the reconstructed utterance.

02

Premature Response Abandonment

What to watch: The assistant misinterprets a backchannel acknowledgment (e.g., 'uh-huh', 'okay') or a side comment as a barge-in that cancels the in-progress response. This causes the assistant to drop its turn mid-sentence when the user was merely signaling continued attention. Guardrail: Classify the barge-in intent before acting. Distinguish INTERRUPT_AND_STOP, INTERRUPT_AND_RESTART, INTERRUPT_AND_CONTINUE, and BACKCHANNEL_IGNORE. Only abandon the response for explicit stop or restart intents.

03

Context Contamination After Recovery

What to watch: After recovering from a barge-in, the assistant carries forward stale facts or assumptions from the pre-interruption context that the user's interruption invalidated. For example, the user interrupts to correct a wrong date, but the assistant continues using the old date in the resumed response. Guardrail: The prompt must output a stale_context array listing specific slots, facts, or assumptions that the barge-in utterance contradicts or supersedes. Downstream turns must exclude or update these items.

04

False-Positive Barge-In Detection

What to watch: Background noise, cross-talk, or ASR endpointing errors trigger a barge-in recovery flow when the user did not actually intend to interrupt. The assistant apologizes, restarts, or asks for clarification unnecessarily, degrading the user experience. Guardrail: Gate the recovery prompt behind a VAD (voice activity detection) confidence threshold and a minimum utterance duration. Do not invoke the recovery prompt for sub-300ms audio segments or low-confidence speech detection.

05

Infinite Recovery Loop

What to watch: The assistant enters a cycle where it restarts a response, gets interrupted again, recovers, restarts, and repeats. This happens when the recovery prompt fails to resolve the underlying reason for the interruption (e.g., the user keeps interrupting because the response is too long or wrong). Guardrail: Track a recovery_attempt_count per turn. After 2 consecutive recovery attempts on the same response, abandon the prior response entirely and prompt the user with an open-ended clarification: 'I want to make sure I understand. Could you tell me what you need?'

06

Lost Pending Actions on Resume

What to watch: The assistant was mid-execution of a multi-step task (e.g., booking a flight, running a report) when interrupted. After recovery, it resumes the conversation but forgets to complete the pending action or re-executes already-completed steps. Guardrail: The recovery prompt must output a pending_actions array with completion status for each step. The resume logic must check this array and only re-execute steps marked INCOMPLETE or UNKNOWN, never steps marked COMPLETE.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to evaluate the quality of the Voice Assistant Barge-In Recovery Prompt's output before shipping. Each criterion targets a specific failure mode common in partial-audio overlap scenarios.

CriterionPass StandardFailure SignalTest Method

Heard Fragment Reconstruction

The [HEARD_FRAGMENT] output is a verbatim substring of the original [INTERRUPTED_RESPONSE] and correctly identifies the last complete sentence or phrase before the barge-in.

The fragment is hallucinated, contains words not in the original response, or identifies a point after the user began speaking.

Provide a set of 10 [INTERRUPTED_RESPONSE] and [BARGE_IN_TIMESTAMP] pairs. Assert that the output string is an exact substring of the input response.

Barge-In Intent Classification

The [BARGE_IN_INTENT] correctly maps to one of the predefined labels (e.g., 'correction', 'stop', 'repeat', 'new_topic') for a golden dataset of 20 barge-in utterances.

The intent is misclassified, especially confusing 'correction' with 'new_topic', or the model selects a catch-all label when a specific one applies.

Run the prompt against a golden dataset of 20 labeled barge-in utterances. Measure precision, recall, and F1-score for each intent class. Require a minimum F1-score of 0.85.

Recovery Action Appropriateness

The [RECOVERY_ACTION] ('continue', 'restart', 'abandon') is the correct choice for the given intent and context in a curated test set of 15 scenarios.

The model chooses 'continue' when the user's barge-in invalidates the prior response, or 'abandon' when a simple 'restart' would suffice.

Use a set of 15 scenario descriptions with ground-truth recovery actions. Assert exact match accuracy. Investigate any mismatches as potential prompt logic flaws.

Context Preservation

The [RECOVERY_CONTEXT] object correctly retains all key entities, slots, and facts from the pre-interruption dialogue state that are not contradicted by the barge-in.

A critical slot value from before the interruption is dropped or overwritten by a null value in the recovery context.

Serialize the pre-interruption dialogue state. After the prompt runs, diff the [RECOVERY_CONTEXT] against the original state. Flag any missing required keys or unexpected null values.

Hallucination Avoidance

The output introduces no new facts, entities, or user statements that were not present in the [PRIOR_DIALOGUE] or [USER_BARGE_IN_UTTERANCE].

The model invents a user preference or a system fact to explain the interruption, or adds a plausible but fabricated detail to the heard fragment.

Use an LLM-as-judge with a strict hallucination detection prompt. Provide the full input context and the output. The judge must return a hallucination_detected boolean. Require false on all test cases.

Output Schema Validity

The output is valid JSON that strictly conforms to the defined [OUTPUT_SCHEMA] with all required fields present and correctly typed.

The JSON is malformed, a required field like [RECOVERY_ACTION] is missing, or a field contains a string where a boolean is expected.

Parse the output with a JSON schema validator. The test passes only if the validator returns zero errors. This should be an automated gate in a CI/CD pipeline.

Low-Confidence Flagging

When the barge-in utterance is genuinely ambiguous or the ASR transcript is low-confidence, the [CONFIDENCE_SCORE] is below the defined threshold (e.g., 0.7) and the [RECOVERY_ACTION] is 'request_clarification'.

The model assigns a high confidence score (>0.9) to an uninterpretable barge-in or chooses a definitive action like 'continue' when it should ask for clarification.

Inject 5 test cases with garbled or semantically empty [USER_BARGE_IN_UTTERANCE] strings. Assert that the [CONFIDENCE_SCORE] is below 0.7 and the [RECOVERY_ACTION] is 'request_clarification'.

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base prompt and a simple JSON output schema. Use a single-turn simulation where you inject a truncated assistant response and the user's barge-in text. Skip audio overlap modeling—just pass text representations of what was spoken and what was interrupted.

code
[ASSISTANT_PARTIAL_RESPONSE]: "The forecast for Tuesday shows a high of 72 degrees with..."
[USER_BARGE_IN]: "No, what about Wednesday?"

Focus on getting the intent classification and continue/restart/abandon decision correct before adding production scaffolding.

Watch for

  • Model assuming it heard the full assistant response when only a prefix was provided
  • Over-eager continuation when the barge-in contradicts prior context
  • No confidence signal on reconstructed user hearing
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.