Recovery · By Vrittara
Why does an AI agent get stuck in a loop?
AI agents loop when the task has no visible definition of done, when a step keeps failing the same way, or when two instructions pull in opposite directions. The fix is a completion test the agent can check, a small cap on repeated attempts, and surfacing the conflict instead of letting the agent retry the same step forever.
Published November 13, 2026 · 3 min read · Part of Reliability
A loop is a missing finish line
An agent that keeps searching, refining or retrying is usually trying to satisfy a goal it cannot measure. “Research the market” has no end state. “List five competitors with pricing pages, and stop when each has a dated price” does.
This is why the same model can loop on one task and finish another cleanly. The difference is rarely intelligence and usually whether the brief says what finished looks like.
The three loops a team actually sees
Most repeated work falls into one of three shapes, and each has a different fix:
- The search loop: the agent keeps looking for a source that does not exist. Fix the brief by naming the acceptable sources, and let it report a gap rather than keep searching.
- The retry loop: a step fails the same deterministic way, such as a missing permission or a malformed request, and the agent tries again. Retries should be limited to failures that might clear on their own.
- The contradiction loop: two instructions disagree, so every attempt satisfies one and breaks the other. The run has to stop and ask rather than pick a side.
How to break a loop without losing the work
Pause at a step boundary rather than mid-step, so the state is one a person can read. Then look at the last few steps and ask which of the three shapes it is; that determines whether the fix is a source, a permission or a decision.
Resume from the step where progress stopped, and name the completion test that was missing. A loop usually ends because something outside the agent changed, so the restart has to carry that change rather than repeat the approach that looped.
Prevent the next one
Add the completion test to the brief, cap the attempts, and record the fix where the next run will inherit it. A loop that took an hour to diagnose should leave behind one sentence that stops the next agent repeating it.
If the same loop appears across tasks, the problem is upstream in the brief or the sources rather than in the agent, and adding another model will not fix it.
What Vrittara does
A Vrittara session writes a plan before the work starts, which gives every run a visible finish line and a step a person can pause at. Transient provider failures can be retried with a bounded backoff, permanent failures wait for a person, and two directions that conflict hold the session so the team decides rather than the agent.
Keep reading
- Running long AI agent tasks as a team
Long-running AI agents work on tasks for hours or days. What they need to survive failures, keep the team informed and let people catch up.
- How AI agent routing, retries, and fallbacks work
Understand AI agent routing and fallback: order configured providers, retry transient failures with limits, and stop for a person when retrying cannot help.
- How to redirect an AI agent while it is running
Steering an AI agent means changing its direction mid-task without starting over. How mid-run redirection works, and what happens when two people disagree.
Vrittara is the workspace a team and its AI agents share: one agent, a plan anyone can read, and a person who approves the result.
Common questions
- Why does an AI agent repeat the same action?
- Usually because nothing in the task tells it when to stop, or because the step keeps failing the same way. Give it a completion test and limit retries to failures that may clear on their own.
- Should you restart a looping agent?
- Rarely. Restarting throws away completed steps and the context that caused the loop in the first place. Pause, diagnose which step repeats, and resume from there.
- How many retries should an agent get?
- A small fixed number with backoff, then stop with a clear status. Unbounded retries cost money and time without changing the outcome of a deterministic failure.