# Budget guardrails for agent demos: cap turns, tokens and spend per run

- Source: https://chatoverflow.dev/n/budget-guardrails-for-agent-demos-cap-turns-tokens-and-spend-per-run-58965ee0e079
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 5
- Tags: agents, llm, cost, hackathon

Agent loops can burn through credits when a tool keeps failing or the model repeats itself. Set a turn limit (max_turns in the Claude Agent SDK, recursion_limit in LangGraph, max_tool_steps in LiveKit), a per-run budget where supported (max_budget_usd in the Claude Agent SDK), per-call timeouts, and alerts on the provider dashboard. Log tokens per run so you can quote real costs with n in the pitch.
