What is the simplest loop pattern for an AI agent?
The solo loop. One agent produces work on a fixed cadence. A second party observes it. The loop has three hard bounds: a cadence, a turn cap and a wall-clock limit. Every output is kept, and the loop ends when a bound is reached or when someone sends it a stop signal.
Most "autonomous agent" demos are one agent in an unbounded while true. That is the largest building
block there is, not the smallest. It has no natural place to stop, nothing outside it reads its work,
and when it goes wrong the only tool you have is to kill the process.
The solo loop goes the other way. It is the smallest unit that still has everything a loop needs to be safe to leave running.
The four parts
| Part | What it is | Why it is there |
|---|---|---|
| Producer | One agent that does the work each turn | The loop has to make something |
| Observer | A second party that reads each output | The producer does not grade itself |
| Bounds | Cadence, turn cap, wall-clock limit | The loop ends even if nobody remembers it |
| Stop signal | An explicit instruction to end now | A human or another agent can end it early |
Take away any one of them and you get a familiar failure. With no observer, a loop that repeats the same wrong answer looks busy. With no bounds, you get a loop that runs until someone notices the bill. With no stop signal, ending it means killing the process, and you lose track of what state it left behind.
Rendering diagram…
What the bounds look like in agent.ceo
In agent.ceo, a solo loop is a pattern you can pick from your organization's enabled loop patterns. The loop we ran end to end on staging used these bounds:
{
"pattern_id": "solo-loop",
"schedule": {"every_seconds": 60},
"budget": {"max_turns": 3, "max_wall_minutes": 3},
"stop_conditions": [{"type": "max_turns", "params": {"max_turns": 3}}]
}
That run checked four things in order. The loop produced an output from its participant. The output was kept and readable afterwards. A stop signal was accepted. After one more full cadence, nothing new had been produced. The last check is what shows the loop actually stopped.
The exact calls are in how to create, watch and stop an agent loop. This page is about why the pattern has this shape.
Why "smallest" matters
A small bounded loop can be tested on its own. You can prove three things about it without testing anything else:
- It produces. An output exists and names who produced it.
- It stops. After the stop, one full cadence passes with no new output.
- Its work is readable. Someone other than the producer can open what it made.
Something that has been proven like this can be trusted when you combine it with other things. An unbounded agent cannot be proven like this, because "it has not stopped yet" and "it will never stop" look the same from outside.
From one loop to a graph
Here is the larger idea. An organization's process is a graph. Steps are joined by hand-offs, and there is a decision at each junction. A bounded loop is one kind of step: something that repeats until a condition holds.
Rendering diagram…
We are building agent.ceo toward that: drawing the graph, putting the right kind of agent or person at each junction, and running the whole graph as a versioned artifact. That composition is design work today. What runs today is the block itself. A bounded loop can be created, watched and stopped, and a proposal can wait for a human decision. We would rather build the graph out of blocks that are proven one at a time than promise it all at once.
For the bounds themselves, and what goes wrong without each one, read how to stop an AI agent loop from running forever.
FAQ
What is the simplest loop pattern for an AI agent?
The solo loop. One agent produces work on a fixed cadence, a second party observes it, and the loop carries hard bounds: a cadence, a maximum number of turns and a wall-clock limit. Every output is kept, and the loop stops when a bound is reached or when it receives a stop signal.
Why does an agent loop need an observer?
Because an agent that only checks itself cannot tell a result from a repetition. The observer is the second party that reads what the loop produced. Without one, a loop can run to its limit producing the same wrong output every turn and still look busy.
Why build bigger agent workflows out of small loops?
A small bounded loop can be tested on its own: you can prove it produces, prove it stops, and read what it made. A large workflow built from blocks that each have those properties is easier to reason about than one long-running agent with no bounds.
Related: What is graph engineering for AI agents? · The FOVEA loop · Autonomous loop docs