MSTRMND
All insights
Agentic systems · 5 min read

An agent should know when to stop.

Agents rarely fail by doing nothing; they fail by continuing. We give every run explicit stop conditions, budgets, and a clean way to halt and ask, so persistence never outruns judgment.

Most of the effort in agent design goes into getting the agent to start: the right tools, the right context, the right plan. Far less goes into getting it to stop. That imbalance shows up in production. An agent that cannot find a file searches again with a slightly different query, then again, then again. An agent whose test keeps failing rewrites the test. An agent that has finished the task keeps polishing, touching files nobody asked it to touch.

None of these are dramatic failures. They are what happens when the only thing that ends a run is the model deciding it feels done. We do not leave that decision to the model alone. Every run we design has explicit reasons to stop, and stopping is treated as a first-class outcome rather than an absence of progress.

Done is defined before the run starts

The cheapest stop condition is a clear finish line. Before an agent begins, the task states what done looks like in terms that can be checked: the build passes, the file exists with the required fields, the reply is drafted and waiting for review. If done can only be described as "when it looks good," the agent will keep going until something outside it intervenes.

A checkable finish line also gives the agent permission to stop early. When the condition is met, the run ends. It does not continue looking for adjacent improvements, because adjacent improvements were not the task. Scope that grows on its own is one of the quieter ways an agent ends up doing something nobody approved.

Budgets are a stop condition, not a billing detail

Every run gets limits on the things it consumes: steps, tool calls, wall-clock time, tokens, and spend. We set these per task, not per agent, because a quick lookup and a long migration deserve very different ceilings.

The point of a budget is not only cost control. A run that hits its budget is telling you something about the task or the agent. Either the task was larger than expected, or the agent is stuck. Both are worth knowing, and both are better surfaced as a clear stop than discovered later as an unexpected bill or a sprawling diff. When a budget runs out, the agent writes down where it got to and halts. It does not quietly start over.

Repetition is a signal

Loops are the most common way agents waste a run. The same tool, called with nearly the same arguments, returning nearly the same result. The model often cannot see this from the inside, because each attempt looks reasonable in isolation.

The harness can see it. We track recent actions and their outcomes, and treat repeated failures on the same step as a reason to stop that step. After a small number of attempts that do not change the result, the agent is expected to change approach or escalate, not to try the same thing harder. This is a rule in the runtime, not a suggestion in the prompt, because the prompt is exactly the thing that is not working when the loop starts.

Blocked is an outcome

Some runs should stop because they cannot proceed without a person. A permission was denied. An action needs approval. A required input is missing or contradictory. In each case the right move is to halt cleanly with a clear account of why.

We design for that explicitly. A blocked run ends with a short report: what was attempted, what stopped it, what was completed, and what decision is needed to continue. It does not route around the block with a more creative approach to the same risky action. A declined approval is an answer, not a puzzle. Treating "blocked" as a legitimate result is what makes it safe for an agent to give up on the right things.

Stopping should leave things clean

A stop is only useful if what it leaves behind is understandable. We want every halted run, whether finished, out of budget, looping, or blocked, to leave the same artifacts: durable state that records progress, receipts for any side effects that already happened, and nothing half-sent.

This is where stop conditions connect to the rest of the operating layer. Because irreversible actions are separated from their drafts, a run that stops mid-task has not accidentally published anything. Because progress is checkpointed outside the model, the next run can resume rather than repeat. A stop becomes a pause with a paper trail, not a crash.

The stop belongs to the harness

It is tempting to solve all of this in the prompt: tell the model to avoid loops, respect budgets, and know when it is finished. Prompts help, and we write them. But prompts do not survive model swaps reliably, and a stop condition that depends on the model's cooperation fails exactly when the model is confused.

So the enforceable parts live in the runtime. The harness counts steps, measures spend, detects repetition, checks the finish line, and holds the approval gates. Models are interchangeable. The rules about when a run ends should not change because the model did.

Persistence with a ceiling

We want agents that are persistent. A good agent tries another path when the first one fails, and works through problems a person would find tedious. That persistence is only valuable when it has a ceiling and a clear exit. An operating layer that knows when to stop is one people can trust to start, because the worst case is a clean halt and a question, not an agent still running long after it should have asked.

03—Let's talk

Ready to build what's next?

We're always open to new conversations. Let's create something exceptional together.

Start the conversation