CrewAI budget per agent: why a shared token pool is not enough for multi-role crews

CrewAI makes it easy to define a crew of specialized agents — a researcher, a writer, a reviewer — each with its own role, goal, and backstory. What CrewAI doesn’t give you is a per-agent budget. All roles draw from the same underlying LLM client. If your researcher agent enters an information-gathering loop — repeatedly calling search tools or web-scraping tools because results are never quite sufficient — it can consume 80% of your session’s token budget before the writer agent starts its first task. This page shows why per-role cost caps matter and how to add them to a CrewAI crew using RunGuard.

The shared-pool problem in CrewAI

Adding per-agent budget caps with RunGuard

Detecting delegation loops in hierarchical crews

CrewAI built-in controls vs. RunGuard

ControlCrewAI built-inRunGuard
Per-agent cost capNot supportedbudget: max_usd per GuardedChatOpenAI instance
Loop detectionNot supportedloop: repeats + window catches tool and delegation loops
Max iterationsmax_iter (default 25) — counts ReAct steps, not costNot needed (cost guard fires first in most cases)
Delegation loop detectionNot supportedsig_fn extracts delegation target for manager loop detection
Alert on budget exceededNot supportedalerts: slack_webhook or pagerduty_key
Partial output on haltNot supported — task output is None if agent hits max_iterBudgetExceededError exposes accumulated context and partial result

Tuning per-agent budgets for your crew