Set a hard USD limit on agent runs without importing ExecutionConfig.Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
Quick Start
How It Works
Themax_budget parameter creates an ExecutionConfig(max_budget=...) automatically, tracking USD spend and stopping execution when the limit is reached.
Precedence
When bothmax_budget and execution.max_budget are provided, the top-level parameter wins:
| Configuration | Result | Warning |
|---|---|---|
Only max_budget=1.00 | Uses $1.00 limit | No |
Only execution=ExecutionConfig(max_budget=0.50) | Uses $0.50 limit | No |
Both equal: max_budget=1.00, execution=ExecutionConfig(max_budget=1.00) | Uses $1.00 limit | No |
Both different: max_budget=1.00, execution=ExecutionConfig(max_budget=0.25) | Uses $1.00 limit | Yes |
CLI Behavior
The CLI provides clean error handling when budget limits are exceeded:Before (Raw Traceback)
After (Clean Message)
BudgetExceededError across all display modes (silent, quiet, verbose, debug, jsonl, json, editor) and provides actionable guidance.
Catching the Error in Code
Handle budget exceeded errors programmatically:Error Attributes
| Attribute | Type | Description |
|---|---|---|
agent_name | str | Agent that exceeded the budget |
total_cost | float | USD spent at the time of error (legacy alias of used) |
max_budget | float | Configured limit (legacy alias of limit) |
budget_type | str | "cost" for dollar budgets |
error_category | str | Always "budget" |
is_retryable | bool | False |
Related
Budget Concepts
Complete budget management guide
ExecutionConfig
Full execution configuration options

