Recovery · By Vrittara
What should you do when an AI agent fails halfway through?
When an AI agent fails halfway through a task, the work before the failure is usually still valid, so the fix is to diagnose the failed step and resume from it rather than starting the task again. Restarting from a blank prompt throws away the sources already found and the context that made the first half useful.
Published November 17, 2026 · 2 min read · Part of Reliability
Find the last good step
Read backwards until a step produced something you would still accept. Everything before that point is work you do not have to pay for twice, and everything after it is the part to redo.
Note what the step was given and what came back. A step that failed because its input was wrong will fail again the same way, and a step that failed on a timeout may simply need another attempt.
Separate the work from the failure
The common mistake is treating a failed run as a failed task. They are different: the task may be three steps from finished, and the failure may be one permission, one expired link or one malformed request.
Write the two down separately. A task described as failed cannot be approved or resumed; a step described as failed can be fixed in minutes.
Resume with the reason attached
When the work resumes, say why it stopped and what changed. An agent told only to continue tends to repeat the step that failed, because nothing in its view suggests the cause was addressed.
If the cause was missing information, attach it. If it was a bad assumption, correct it in the brief so the next run inherits the correction rather than rediscovering it.
Decide what would have prevented it
After the work is finished, answer one question honestly: what check, source or permission would have stopped this before it cost an hour? Then add that thing, once, in the place the next run reads.
Keep reading
- What to do when an AI agent gets something wrong
How to handle an AI agent mistake: stop the run, find the step that introduced it, keep what is sound, and fix the cause rather than the sentence.
- Why AI agents get stuck in loops, and how to stop them
An AI agent repeats work when it cannot tell whether it is making progress. How to spot a loop early, what causes it, and how to break it without starting over.
- How to hand off an AI agent session to a teammate
AI agent handoff means passing a running agent session to a teammate or another agent with a brief of where it stands. Here is what a good one needs.
- Who is responsible when an AI agent gets something wrong?
Responsibility for an AI agent's mistake stays with the people who deployed it. The three roles that carry the risk, and what to name before the first run.
- What happens when an AI agent runs out of context?
When an AI agent runs out of context it loses the brief and the earliest sources first. Why a written plan and a short state beat a bigger window.
- 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.
- When is an AI agent not worth it?
An AI agent is not worth it for rare tasks, unclear definitions of done, review that costs more than the work, or mistakes that cannot be undone.
- What an AI agent audit trail should record
An AI agent audit trail records the objective, plan, sources read, actions taken, instructions given and who approved the result, written as the work happens.
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
- Should a failed run be deleted?
- Usually not. Keep it with a note of why it stopped, because the record is what lets the next person resume quickly and what shows whether the same step keeps failing.
- Is it faster to start the task again?
- Rarely. A restart costs the research and drafting already done, and it usually reproduces the same failure where the cause was environmental rather than in the prompt.
- What if the failure is a wrong result rather than an error?
- Then the run finished but the result is not acceptable, which is a review decision rather than a recovery one: send it back a step with the reason, or correct it in review if the error is local. Keep the earlier steps either way.