Financial Guardrails: Preventing Budget Burn
Hard caps and pauses for recursive execution costs.
Steps
- Define a 'Max_Session_Budget' outside the LLM context.
- Track cumulative token spend in a local state variable.
- Trigger a 60-second pause if a single step fails twice.
- Require Human-in-the-loop approval at 50% budget usage.
- Terminate immediately on 3 consecutive 429 errors.