Knowing when to stop is one of the harder problems in agent design. Without a clear condition, an agent either declares victory early or keeps working long after it should have given up.
What makes a good stopping condition?
Something checkable. Tests pass, the file exists, every item has a value, the document contains these sections. Anything the agent can verify rather than judge.
Why are vague goals a problem?
Because improve this has no completion. An agent given an open-ended goal will either stop arbitrarily or continue producing changes indefinitely, and neither is useful.
What causes premature stopping?
- Partial success. Mistaken for completion.
- A plausible answer. Reached without verification.
- Difficulty. Producing a summary instead of a result.
- Lost context. Forgetting part of the goal.
What is the most common one?
Declaring success without checking. An agent that wrote a file and assumed it was correct has stopped at the point where verification should have started.
How do you address that?
By making verification a required step. Instructing an agent to confirm the outcome before finishing, using a tool that actually checks, converts an assumption into a result.
What about timeouts as a stopping condition?
A blunt instrument that belongs in every deployment anyway. A time limit catches the case where an agent is making progress too slowly to be worth continuing, which iteration caps alone do not.
It should not be the primary mechanism. An agent stopped by a timeout has produced partial work with no report, where one stopping on its own condition can say what it achieved and what remains.
What causes endless running?
A condition the agent cannot satisfy, combined with no recognition that it cannot. It will try variations indefinitely, which is why iteration caps exist as a backstop.
What should happen when it gives up?
A clear report of what was achieved and what was not. An agent that stops and says which parts failed is considerably more useful than one producing a confident summary of partial work.
How do you specify this?
In the instructions, explicitly. Telling an agent what finished means, what to verify, and to report failure rather than approximating success is the highest-value thing you can write.
What about tasks with several valid endings?
Worth being explicit about which you want. An agent given a goal that could be satisfied several ways will pick one, and it may not be the one you had in mind.
Stating a preference, or the criteria for choosing, is a sentence that prevents a common disappointment. The agent did what was asked, and what was asked was less specific than the person believed.
What about partial completion?
The outcome to design for explicitly, because it is common. An agent that processed sixty items of a hundred has produced something useful and something misleading, depending entirely on whether it says so.
Instructing it to report counts, and to list what it could not complete, converts a partial success into a usable result. Without that instruction the summary will describe the work as done, and the gap is discovered later by somebody else.
What about tasks with no clear end?
Worth restructuring. Breaking an open-ended goal into bounded pieces with definite outcomes gives both you and the agent something to measure against.
What is the practical formulation?
Say what done looks like, say how to check it, and say to stop and report rather than guess. Three sentences, and they address most of what goes wrong at the end of a run.