An AI agent loop is the cycle an agent repeats to get work done: observe the current state, decide what to do, act, check the result, then repeat or stop. The model sits in the decide step. Everything else is plumbing you design: what the agent can see, which tools it can touch, how it checks its own work, and what ends the run. That is why most agent failures are not model failures. They happen at the check, where nothing verifies the action worked, and at the stop, where nothing says enough. As of November 2026, this is the frame I use to review any agent before it gets access to anything that matters.
What is an AI agent loop?
An AI agent loop is the cycle an agent runs to get work done: observe the current state, decide what to do, act, check the result, then either repeat or stop. The model is one part of it. The loop also includes the tools it can call, the memory it carries, and the rule that ends the run.
The idea has a clear lineage. The ReAct paper by Yao and colleagues described language models alternating between reasoning and taking actions, and most agent designs since are variations on that rhythm. I'm naming it so you can find the original. I'm not leaning on it for any claim about what today's systems can do.
One thing nobody talks about is how ordinary this is. A thermostat runs a loop. So does a human debugging a failing test. What makes an agent different is that the decide step is flexible and the actions have real side effects.
The flexible part is the appeal. The side effects are the risk.
What are the steps of an AI agent loop?
There are five steps. Observe what is true now. Decide the next action. Act by calling a tool or producing output. Check whether the action did what was intended. Then continue, change course, or stop. Real systems add memory and permissions around these, but every agent failure still lands on one of the five.
Most teams spend their attention on the second step, because that's where the model is. Prompts, model choice and evaluation all live there.
The failures I'd worry about live elsewhere. Observation can be stale or incomplete. Action can do more than intended. Check can be missing entirely. Stop can be left to the model's mood.
This is an inference from how the pieces fit together, not a measurement. Treat it as a review checklist, not a finding.
Where does an agent loop break?
An agent loop breaks at one of five joints, and each one has a different symptom. Observation fails by being stale or partial. Decision fails by being plausible and wrong. Action fails by doing too much. Check fails by not existing. Stop fails by never firing. The table below pairs each with how you would notice and what bounds it.
| Joint | What breaks | How you'd notice | What bounds it |
|---|---|---|---|
| Observe | The agent acts on stale or partial information, such as an old file or a truncated log. | The action is reasonable for a state that no longer exists. | Read fresh state before each action. Log exactly what the agent saw. |
| Decide | The model picks a plausible action that is wrong for the goal. | The trace reads fine and the outcome is off. | Narrow the choices. Require a stated reason that a reviewer can read. |
| Act | A tool call does more than intended: it deletes, sends, spends or overwrites. | Side effects outside the task showing up in other systems. | Least-privilege permissions. Dry runs. Human approval for anything irreversible. |
| Check | The agent decides its own work succeeded without verifying it. | "Done" reports that fail when a person tries the result. | An outside check: a test, a diff, a validator. Never the model grading itself alone. |
| Stop | Nothing ends the run, or the wrong thing does. | Repeated identical actions, rising cost, a run that outlives its usefulness. | Step, time and spend limits set outside the model, plus an explicit failure exit. |
Read the Check and Stop rows twice. Those two are where I'd put most of the review time, and I'll say why below.
Why is the check step where most agents fail?
The check step fails because the easiest verifier to build is the model itself, and a model reviewing its own output tends to approve it. A real check is independent of the thing it checks: a test that runs, a validator that parses, a number compared to a number. Without one, "done" is just a claim.
Here is a worked example, written as a composite to show the pattern. It isn't from a real system.
An agent is asked to update a config value across a repository. It edits 14 files and reports success. The loop had no check step, so nobody learned that 2 of the files used a different key name and were never touched. The agent observed correctly and decided reasonably. It had no way to discover its own miss.
Add a check that searches for the old value after the run and fails if any remain. Now the loop finds the 2 files itself.
That check is cheap, and it's the same discipline I argued for in acceptance criteria: write down, before the work starts, what a failing result looks like. An agent loop without that is a loop with no way to be wrong on purpose.
What should the stop condition of an AI agent loop be?
A stop condition should be written outside the model and be checkable: a passing test, a finished checklist, a step limit, a spend cap, or a human approval. It needs both a success exit and a failure exit. If the only way out is the model deciding it is finished, you have not written one.
Teams usually write the success exit and forget the failure exit. The loop knows how to end when things go well. It has no plan for the run where the same action fails nine times in a row.
So I'd set three limits before anything else: a maximum number of steps, a maximum wall-clock time, and a maximum spend. Pick numbers that fit the task. Then decide what happens when a limit hits. The honest answer is usually "stop and hand it to a person with the trace attached."
A loop that stops early and says why is a feature. A loop that never stops is an incident.
Why do agents get stuck in infinite loops?
Agents loop forever when nothing in the system defines done. The model keeps deciding there is more to do, or keeps retrying an action that fails the same way. The fix is not a better prompt. It is a hard limit on steps, time and spend, plus a check that can say stop.
There are two common shapes. In the first, the agent retries a failing action without changing anything, so the loop repeats the same mistake at machine speed. In the second, the agent keeps finding adjacent work, so success keeps moving.
You can detect both cheaply. Compare each action to the last few. If the agent repeats itself, interrupt it. If the diff keeps growing past the task's size, interrupt that too.
Neither detector needs the model to be smarter. They need someone to have decided what a runaway looks like.
How do you review an agent using the loop?
Walk the five joints in order and ask one question at each: what happens here when it goes wrong? Where you have no answer, you've found the work. Start with Check and Stop, because they're the two joints a demo never exercises.
A short version I'd paste into a review:
- Observe: what can it see, and how old is that?
- Decide: can a reviewer read why it chose this?
- Act: what's the worst thing this tool call can do, and who approves it?
- Check: what independent evidence says it worked?
- Stop: what ends the run on success, and what ends it on failure?
That's a review list, not a framework to adopt. It sits under the broader shift I described in agentic software engineering: as agents do more of the implementation, the human work moves to specification, orchestration and verification. The loop is just where those jobs turn out to live.
I'll say what I don't know. I haven't measured how often each joint fails across real systems, and I'd distrust anyone who quotes you a clean percentage. What I do believe, from how these systems are built, is that the model gets blamed for failures the loop around it allowed.