---
title: "When a swarm should stop: time and token budgets for a task"
url: "https://kyberagent.com/blog/when-a-swarm-should-stop"
description: "A long task without a budget runs until the money or the patience ends. What a budget per task covers, what the planner does when a share runs out, and how a stop is resumed."
---

# When a swarm should stop: time and token budgets for a task

October 20, 2026·4 min read·Editorial team

A rounded compute cell beside a mechanical countdown meter with three small windows, one of them reading zero, and a red stop lever pulled down

A small company asks a swarm to clean up its product catalogue: find duplicates, fix the units, flag items with no supplier. The job starts on a Friday afternoon. On Monday the person who started it looks at the bill, then at the result. The bill is large. The result is a catalogue that is half cleaned, with the second half touched in a pattern nobody can explain.

The swarm was never told when to stop. So it did not stop. One sub-agent retried a failing lookup for most of Saturday. Another re-read the same supplier list for every item because nothing told it that the list had not changed. The planner kept adding items to its own list as it discovered edge cases, and the list grew faster than it shrank.

Nobody did anything wrong by the rules it had. The rules just did not include an end.

## The real cause: a goal without a limit is an open loop

A task description says what done looks like. It does not say how much effort done is worth. Without that second number, an agent has only one way to decide whether to continue, which is to ask itself whether it is finished, and an agent in the middle of a hard job will almost always answer no. Effort flows into the task until something outside the task, the account balance or the person’s patience, closes the loop.

That is why the cost of a task is the cheapest early signal that it has gone wrong, as argued in [an agent that regulates itself](https://kyberagent.com/blog/an-agent-that-regulates-itself). A budget turns that signal into a rule.

## How an unbudgeted task fails

**The retry that never gives up.** A tool call fails, the sub-agent tries again, the call fails the same way. Each attempt looks reasonable on its own. Without a cap on retries the sequence has no natural end, and the trajectory fills with the same step repeated.

**The sub-agent that works harder than its item deserves.** One item on the list is worth a minute of attention. The sub-agent that took it does not know that, so it spends an hour being thorough about something nobody will read.

**The plan that grows.** Every discovery becomes a new item. A plan that is allowed to grow without limit is a task that redefines itself as it goes, and a task that redefines itself cannot be finished.

**The tool loop.** The agent reads a file, decides it needs another, reads that, decides it needs the first one again. Tool calls are cheap individually, so nothing flags the pattern until the count is in the thousands.

**Spending to avoid asking.** The hardest failure to see. The swarm could stop and ask the person a short question, but asking means admitting it is stuck, so instead it tries another approach. And another. Each costs more than the question would have.

**The stop nobody can resume.** When money finally runs out the run is killed from outside. There is no record of which items were finished, so the only safe move is to start over, which spends the money twice.

## What a budget should look like

Our design treats a budget as part of the task, written down next to the goal, and shared out as the planner splits the work.

**Four limits, not one.** Wall-clock time, model tokens, tool calls and retries per step. They catch different failures. A retry cap stops the stuck lookup; a token cap stops the over-thorough sub-agent; a time cap stops the job that is simply bigger than anyone thought. A single limit on cost alone misses the loops that are cheap per step.

**Each sub-agent gets a share, not the whole.** When the planner hands out an item it hands out a slice of the budget with it. A sub-agent that exhausts its share does not borrow from the others. It stops, writes down what it has and returns a report that says so: finished this much, stuck here, this is what I tried. Its working files stay in its [KyberCell](https://kyberagent.com/blog/kybercell-explained) for whoever picks the item up next.

**The planner decides what a short report means.** It has three honest options. Give the item a second, explicitly larger share, because the first guess was wrong. Narrow the item, because the report shows the item was too big. Or hand the item back to KyberBot, which asks you. What it does not do is quietly spend the remainder of another item’s share.

**Out of range means narrower, not faster.** This is the homeostat on the homepage applied to budgets. When spend drifts above its set point, the swarm starts fewer sub-agents and takes smaller steps. It does not try to make the deadline by going harder.

**The stop is a step on the record.** A budget stop is written into the [trajectory](https://kyberagent.com/blog/every-step-on-the-record) like any other decision: which limit was hit, at what point in the plan, with which items done. The plan file is the resume point. A person, or a later run, can read the plan, see the ticked items and the one marked stopped, and continue from there with a fresh share rather than from zero.

A plain limit: none of this is released. There is no budget syntax to show you yet, and we are not going to pretend there is. What is settled is the shape: the budget lives with the task, it is split with the work, and running out is a recorded decision, not a crash.

## A test you can run today

Take the next long task you give any agent and, before you start it, write down four numbers on paper: how long it should take, roughly how much it may cost, how many times a single step may be retried, and at what point you want to be asked rather than have it continue.

Then start the task and do not interfere. When it ends, compare the paper to what happened.

If the task stopped on its own before any of your numbers and told you why, you have a budgeted agent. If it stopped because you killed it, or because the money ran out, you have an open loop, and the numbers on your paper are the beginning of the rule it needs. Where a budget sits between the planner and the cells is on the [KyberAgent homepage](https://kyberagent.com/), and what happens when two sub-agents inside a budget come back with different answers is the subject of [two agents disagree](https://kyberagent.com/blog/two-agents-disagree).

-   budgets
-   tokens
-   planning
-   homeostat
-   trajectory

## Keep reading

-   [Two agents disagree: how a swarm settles a dispute](https://kyberagent.com/blog/two-agents-disagree)
-   [Agents on Android XR: background tasks and the cell](https://kyberagent.com/blog/agents-on-android-xr)