Token budget per agent (runaway prevention) #106
Labels
No labels
bug
commercial
documentation
duplicate
enhancement
feature
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jasoncouture/llama-shears#106
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Cap how many tokens an agent (plus all its sub-agents) can spend over a configurable rolling window. When the budget is exhausted, the agent gets back-pressure / pause / hard-stop depending on policy. Prevents a runaway loop (or an adversarial prompt) from burning through quota / money / local GPU time unchecked.
Surface:
Considerations:
Depends on accurate token usage (sibling) — budgets that key on estimates aren't budgets.
Per-agent budgets are a lot more useful than one global spend ceiling because they fail in a way you can reason about.
The part I'd strongly consider pairing with this is a progress test, not just a spend test. A run can stay under budget and still waste hours if it keeps making the same tool call with the same evidence.
The pattern that has held up best for me is:
That last part matters because people can only trust the stop if they can see why it stopped.
We've been seeing the same need in MartinLoop from the control-plane side.