{
  "id": 19456917,
  "title": "Day 18/90: Your AI Agent Has a Step Limit—But Does It Have a Budget?",
  "url": "https://urgent.news/2026/11/11/day-18-90-your-ai-agent-has-a-step-limit-but-does-it-have-a-budget",
  "topic": "ai",
  "section": "AI",
  "published": "2026-11-11T06:17:49.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/rimsha_kanwal/day-1890-your-ai-agent-has-a-step-limit-but-does-it-have-a-budget-5b6g"
  },
  "original_language": "en",
  "account": "An AI agent can operate within its step limit even if it surpasses the acceptable response time or consumes an excessive amount of tokens. Factors such as sluggish tools, expanding conversation history, or repeated retries can make a short execution costly. Today's task involves defining the extent of time and token usage an agent can afford and the consequences when either budget is depleted. Contrary to the step limit, a step limit merely regulates iterations. Various steps possess distinct costs; one iteration could be a swift lookup, while another might involve sending a substantial context to a model and awaiting a sluggish external service. To address this, Anthropic advises incorporating explicit stopping conditions for agents. Building upon this advice, this challenge introduces two additional resource controls: an end-to-end execution deadline and a cumulative token budget. These are engineering measures for evaluation, not standard settings.\n\nWhen executing a tool, set a common deadline for the entire run. This limits the maximum timeout per tool call based on the remaining run time. Utilize a monotonic clock to measure elapsed time and transmit the remaining allowance to the client's timeout settings to prevent indefinite blocking. Additionally, track tokens across all model calls since output limits pertain to a single generation and may not cap the complete agent run. Input tokens can increase as the agent carries forward conversation history, retrieved passages, and tool results. Before each model request, estimate the input tokens, reserve an output allowance, and verify that both fit within the remaining budget. Reconcile the estimate with the reported usage following the request. Note that token usage does not correspond to monetary cost, as pricing varies by model, token category, and caching.\n\nWhen dealing with retries, ensure they are contained within the original budget. The retry should not receive a separate execution budget. Before retrying, evaluate whether the failure is transient, if repeating the operation is safe, if ample time remains for backoff and another attempt, and if another model request fits within the token allowance. For tools altering external state, a timeout may leave the outcome uncertain. For instance, a ticket might be created even if its confirmation never reaches the agent. Repeating the request could result in a duplicate. Use idempotency keys where supported and validate uncertain outcomes before retrying a write. Ensure that returning an explicit stop reason is implemented when the budget is exhausted. This could include completed, deadline_exceeded, token_budget_exceeded, step_limit_exceeded, or tool_failed. Maintain verified intermediate results and elucidate what remains unfinished. For instance, \"I located the policy document, but the order lookup timed out. I cannot determine whether this order qualifies.\" Lastly, avoid treating a local timeout as proof of a remote operation failure or cancellation. The primary objective is to accomplish useful work within the allocated allowance and accurately report unfinished work when execution must end.",
  "summary": "An AI agent can stay within its step limit and still exceed an acceptable response time or consume too many tokens. A slow tool, growing conversation history, or repeated retries can make a short execution expensive. Today’s challenge: define how much time and token usage an agent can spend—and what happens when either budget runs out. Why a step limit is not enough A step limit controls…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}