agile workshop by codaisens Open a room

Tokens: putting AI agent costs into Sprint Planning

A token cap at Sprint Planning, a counter at the Daily Scrum, and a written rule for the day the budget runs out.

A $412 API bill for four days of calls to a coding agent, and nothing in the Sprint Backlog to tie it to one item rather than another. The Increment ships, the Sprint Review goes well, the invoice arrives a week later. By then, nobody can say which work produced it.

A token is text billed by the meter

A token is a fragment of text: a short word, the end of a word, a punctuation mark. Model providers bill every token exchanged, both what the agent reads from the repository and what it writes back. An agent asked to reread a two-hundred-line file pays for the whole read, then pays again on every new call that reloads the same file.

That meter runs somewhere else. The flow measures described in the Kanban Guide (Work in Progress, throughput, Cycle Time, Work Item Age) do not capture it [1]. On a Kanban board, the agent shows up as a work item in progress, with a Cycle Time that keeps growing; the spend stays on the provider's site.

A team that wants to track this cost adds a line to the Sprint Backlog. The harder part is knowing what to put there, and what to put it next to.

Set a cap at Sprint Planning

The Scrum Guide describes Sprint Planning as the moment when the Scrum Team decides why the Sprint is valuable, what can be done during the Sprint, and how the chosen work will get done [2]. Tool cost appears in none of those three questions. It belongs in the third, where the team already chooses its breakdown and its tools.

Two rules are enough. The amount is set at Sprint Planning, for the whole Sprint, and does not reopen along the way. What gets revised at the Daily Scrum is the work planned inside that envelope. A team that renegotiates the amount every morning ends up with no cap at all.

Before picking the number, decide what it covers. A tool subscription is paid monthly and does not move from one Sprint to the next; tokens do. A cap that mixes the two becomes unreadable at the Daily Scrum.

Take a team of six working on a billing service. One item proposes importing PDFs and having an agent read them; the usual estimate gives three days. The person who opened last month's invoice remembers a comparable job, two hundred files processed by a mid-range model, $180 in tokens. The team sets a $200 cap for the Sprint and writes the reference volume next to the number, on the same line.

Show the counter at the Daily Scrum

The Daily Scrum exists to inspect progress toward the Sprint Goal and adapt the Sprint Backlog for the day [2]. A counter approaching the cap is replanning information like any other, provided the people who decide can see it.

The trap is asymmetry. One person checks the provider console, everyone else discovers the overrun at the Sprint Review, in a room where nothing can change anymore. Put the counter where the team already looks: next to the board, or in a daily export pasted into the team channel. Ten seconds to read when the number is in front of you, ten minutes of discussion when someone has to go find it.

On a morning when the counter reads 60% after three days out of ten, the team knows it can still run the agent on the PDF import without starving the end of the Sprint. The same number at 90% on day six changes the order of the week's tasks.

The decision belongs to the Developers, who watch the agent run. The principles behind the Agile Manifesto assign architecture and design to self-organizing teams [3], and the 2020 Scrum Guide leaves the team to decide its own internal organization [2]. The Product Owner orders the Product Backlog; they do not need to approve every call.

When the cap runs out before the Sprint ends

The arbitration rule gets written at Sprint Planning, while nobody is under pressure yet. A cap without a rule turns into an improvised negotiation on Friday at 5 p.m., usually won by whoever talks loudest.

Picture a team of five on a Thursday at 11 a.m.: 85% of the envelope spent, four items still open. Two outcomes hold up. Cut scope, keep the low-volume items, and announce the deferral at the Sprint Review. Or handle the rest by hand, more slowly, without going over. Letting the agent keep running and finding the total on the invoice is not one of them.

An item pushed back for budget reasons goes into the Product Backlog with its reason. Without that line, it comes back next Sprint and nobody remembers why it was dropped.

The cap applies to one Sprint. The Sprint Backlog does not carry over to the next one: each Sprint establishes a new one [2].

Test one file before splitting an item

One concrete step: run the agent on a single file and read the counter. Multiply that number by the expected volume to get the order of magnitude for the whole item. A file at $4 across a batch of two hundred files points to $800, four times the Sprint cap. The item gets split.

Split by volume: one hundred files now, the rest next Sprint, with the same instruction and the same model, so the second batch starts from a counter comparable to the first.

This does nothing when the agent loops on a vague instruction. Rewrite the instruction, rerun on the same file, compare the two readings. If the cost drops, the wording was the problem, not the batch size.

A billing trap: one hundred separate calls cost more than one hundred files processed in a single pass, because each call resends the context. Before splitting into batches, check how many calls the split adds.

Cost rarely follows value. An item costing a few dollars can unlock an entire demo; an expensive item can produce code nobody will reread. Value is discussed with the Product Owner, the envelope with the team.

Keep tokens out of story points

Putting tokens into the estimation unit mixes a monetary cost, known to the dollar and verifiable on an invoice, with a relative estimate, approximate by construction and meant to get the team talking about what it does not yet know. The Scrum Guide prescribes no estimation unit [2]. Two separate lines are enough: the estimate on one side, the spending cap on the other.

A ratio computed after a few Sprints (tokens spent divided by points delivered) can serve as a forecast. Its value depends on the model used and the volume processed; it moves as soon as either changes. The day that ratio becomes a commitment, it pushes people to consume so they don't look behind.

A reasonable use of the ratio: spot the Sprint where spending drifts from the estimate, and raise it at the next Sprint Planning.

Before the next Sprint Planning, take last month's invoice and try to tie each line to an item from the past Sprint Backlog. If half the lines find no owner, the cap is premature. Measure one full Sprint without a cap, then set one with the number in hand.

Sources

  1. Kanban Guides (Daniel Vacanti & John Coleman), Kanban Guide, 2020-01.
  2. Scrum Guides (Ken Schwaber & Jeff Sutherland), The Scrum Guide, 2020-11.
  3. Agile Manifesto, Manifeste pour le développement agile de logiciels, 2001-02.