ExecutionConfig(max_budget=...) — when the limit is hit, PraisonAI stops the run and raises BudgetExceededError.
Async enforcement.
max_budget is now enforced on async paths (astart() / achat()) as well as sync paths. Gateway bots using async agents will receive BudgetExceededError when their configured ceiling is reached. Previously only sync dispatch enforced the limit.BudgetExceededError once estimated cost exceeds the limit.
Quick Start
1
Set a simple USD cap
BudgetExceededError including agent name and totals.2
Async run with budget cap
astart() raises BudgetExceededError the same way start() does — the async path now has identical pre-call guards and post-call cost accounting.3
Warn instead of stopping
on_budget_exceeded="warn", the agent logs a warning but continues. Default is "stop".max_budget is enforced on both sync (start()) and async (astart()) paths as of 1.6.88+. Gateway bots that call astart() internally now honour the budget cap and raise BudgetExceededError identically to sync runs.How It Works
Budget tracking adds zero overhead whenmax_budget is None (the default).
Schedulers use the same brake — see Async Scheduler → Budget-aware Scheduling. Setting max_cost=0 on AsyncAgentScheduler is a real (zero) budget and short-circuits start() (returns False, no background task) when combined with run_immediately=True.
Configuration Options
ExecutionConfig
Full execution configuration reference
CLI Budget Handling
Budget limits from the CLI
Best Practices
Start with a conservative cap in production
Start with a conservative cap in production
Set
max_budget on any agent that runs unattended or loops over tools. 1.00 is a sensible starting range for research agents.Use warn mode during development
Use warn mode during development
on_budget_exceeded="warn" lets you see full output while still logging when you’d have been stopped in production.Combine with rate limiting
Combine with rate limiting
Budget caps control spend; rate limiters control request frequency. Use both for cost-sensitive deployments.
See also: Autonomous run budget
ExecutionConfig.max_budget is one of two budget mechanisms. run_autonomous / run_autonomous_async have their own independent cap via AutonomyConfig — pick the one that matches your run type.
For autonomous runs, prefer the
AutonomyConfig cap — it pauses recoverably instead of raising. See Autonomy Budget.
Related
Autonomy Budget
Spend/token kill-switch for autonomous runs
CLI Budget Handling
Set budgets from the command line
Execution Config
All execution options in one place

