## TL;DR
A clarifying loop happens when the agent needs a slot filled, the user doesn't provide it, and the agent asks again instead of moving on. The fix is an exit condition: after two failed attempts, the agent must do something else. Ask twice, then escalate, assume a default, or proceed with what's known. Never ask a third time.

## The query

```text
support agent looped asking the same clarifying question: exit condition
```

## Use this when

- An AI support agent repeats the same clarifying question
- Conversations stall in endless clarification
- You're designing agent prompts and need loop guards


## Not for

- Agents looping on wrong answers (different fix)
- Tool calls retrying in a loop
- Training human agents on questioning


## Steps

### 1. Count the asks and cap them

Track how many times the agent has asked for the same slot in one conversation. Set the cap at two. On the third need, the exit condition fires instead of another question.

Expected output: a counter on repeat questions with a cap of two.

### 2. Define what happens at the cap

Write the exit explicitly in the instructions: after two unanswered asks, either escalate to a human with the partial context, proceed with the most likely value and say so, or ask one broader question instead. Pick per slot; don't leave it vague.

Expected output: a written exit action for every required slot.

### 3. Detect the loop from conversation history

Before asking, have the agent check whether it already asked this. A simple 'was this question asked before' check in the prompt, or a asked-slots list in state, breaks most loops mechanically.

Expected output: no question repeated verbatim within a conversation.

### 4. Log loop exits as a metric

Every exit-condition firing is useful signal about which slots users won't provide, which questions confuse people. Review the log weekly and fix the worst slots by making them optional or better explained.

Expected output: a loop-exit log reviewed on a schedule.

## Variant phrasings

### ai agent keeps asking same question

Steps 1 and 2: cap the asks, define the exit.

### chatbot clarification loop fix

Step 3's history check is the mechanical backstop.

## Why it happens

Agents loop because asking is their default action and nothing tells them to stop. The prompt says 'gather the needed information' without saying what to do when gathering fails, so the agent does the only thing it knows: ask again. The exit condition is the missing instruction, and it has to be explicit because 'use your judgment' doesn't survive the loop.

## Edge cases

- Some slots genuinely need an answer (account identity). Those escalate; they don't get defaults.
- Sarcastic or frustrated users trigger loops faster. Detect frustration and escalate early.
- The cap counts per slot, not per conversation. Two different questions are fine; the same one twice is not.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_eEcjVmD20wwAu8zTOfli8Q
