# Agent cost ceiling checklist

_A loop that keeps retrying a bad value keeps billing_  
@demotoprod · BUDGET · also LEVERS · October 2026

In one agent SDK's documentation the turn limit and the spend limit both default to no limit. A threat-intelligence firm's September 2026 special report gives its own account of one case: an agent looping on a corrupted value, over 15,000 reasoning API calls in under an hour and a billing spike of about $50,000. Five checks put a budget, a circuit breaker and a step limit in your own code, then back them up at the provider.

**A cost policy to adapt per agent**

```
# Names in capitals are yours to set from your own logs
budget:
  per_task_per_day_usd: DAILY_CAP_USD
  check: before_each_call     # refuse if worst-case cost passes the cap
  alert_at_percent: [50, 90]  # from your own counter
breaker:
  trip_after_failures_in_a_row: FAILURE_THRESHOLD
  reset: by_hand
steps:
  max_tool_calls_per_task: MAX_TOOL_CALLS
  on_cap: open_ticket         # outside any retry wrapper
terminal_errors: [project_spend_limit_exceeded, enforced_spend_limit_reached]
```

- [ ] **1. Enforce the daily budget in your own code, before each call**

  **What happened.** Provider spend limits are monthly and enforcement is not instantaneous. An SDK budget cap compares estimated spend after each response, so spend can pass it by up to one response plus running subagents. A daily ceiling is a counter you check before every call.

  **The check.**
  - Keep one counter per task per day in a store that survives a restart; before each call add its worst-case cost and refuse if the total would pass the cap.
  - When the guard refuses, stop and file a ticket; the agent can never raise its own cap.

  Source: [How the agent loop works, agent SDK documentation, read 27 Nov 2026](https://code.claude.com/docs/en/agent-sdk/agent-loop)

  Source: [Spend limits, API platform guide, read 27 Nov 2026](https://developers.openai.com/api/docs/guides/spend-limits)

- [ ] **2. Trip a circuit breaker on consecutive failures, and reset it by hand**

  **What happened.** A circuit breaker blocks a resource after failures reach a threshold instead of retrying. The documented counter is time based, so it trips only when enough failures land inside one interval. The special report asks for a halt after a set number of consecutive failures and gives no number.

  **The check.**
  - Count failures per task in a row with no time window, count a rejected output as a failure, and reset only after a success.
  - When it trips, stop the task, log the last failing input, notify a person, and keep it open until a person closes it.

  Source: [AI risk and resilience in 2026, special report, case study 6, September 2026](https://cloud.google.com/security/resources/ai-risk-and-resilience-2026)

  Source: [Circuit Breaker pattern, cloud design patterns guide, read 27 Nov 2026](https://learn.microsoft.com/en-us/azure/architecture/patterns/circuit-breaker)

- [ ] **3. Cap the steps per task, and handle the cap as a logged ticket**

  **What happened.** In one agent SDK the turn limit also counts the final reply and defaults to no limit. In a widely used orchestration library the tool-call limit by default blocks excess calls and lets the model go on; its model-call limit ends the run. Test what yours does when hit.

  **The check.**
  - Cap tool calls per task and sub-task depth from your longest legitimate run in the logs.
  - Handle the cap as a logged ticket (task id, step count, last inputs) outside any retry wrapper, and force a loop in staging to confirm one ticket.

  Source: [How the agent loop works, agent SDK documentation, read 27 Nov 2026](https://code.claude.com/docs/en/agent-sdk/agent-loop)

  Source: [Prebuilt middleware, model call limit and tool call limit, read 27 Nov 2026](https://docs.langchain.com/oss/python/langchain/middleware/built-in)

- [ ] **4. Set a hard spend limit on each agent's project or workspace**

  **What happened.** One provider separates a spend alert, which notifies while traffic continues, from a hard limit, where requests return a 429. Another provider's monthly cap returns an error typed like a rate limit, with no retry-after header, and retries fail until access resumes.

  **The check.**
  - Give each agent its own project or workspace with a hard limit above your in-code cap, so your code trips first.
  - Mark the limit errors terminal in the retry policy (project_spend_limit_exceeded; enforced_spend_limit_reached, or a 400 for a limit you set yourself), and rehearse with a small limit on staging.

  Source: [Spend limits, API platform guide, read 27 Nov 2026](https://developers.openai.com/api/docs/guides/spend-limits)

  Source: [Rate limits, API documentation, read 27 Nov 2026](https://platform.claude.com/docs/en/api/rate-limits)

- [ ] **5. Alert at 50 and 90 percent of each cap, from your own counter**

  **What happened.** In the reported incident the agent made over 15,000 calls in under an hour. One cloud provider's guide says billing lags usage, that an alerts-only budget does not cap spending, and its console proposes alerts at 50%, 90% and 100%.

  **The check.**
  - Alert at 50 and 90 percent of each task's cap from your own counter, so it does not wait for billing; name who acts and what they do first.
  - Set the cloud account's budget alerts at 50, 90 and 100 percent as a second signal.

  Source: [AI risk and resilience in 2026, special report, case study 6, September 2026](https://cloud.google.com/security/resources/ai-risk-and-resilience-2026)

  Source: [Create, edit, or delete budgets and budget alerts, cloud billing guide, read 27 Nov 2026](https://docs.cloud.google.com/billing/docs/how-to/budgets)

The incident figures are the report's own account of one case; it gives no values for caps, breaker thresholds or step limits, so every number in the code is an example to replace from your own logs. Defaults and error codes are as documented on 27 November 2026 and can change.

The live version of this list, with every source link, is at https://indica-tech.com/checklists/agent-cost-ceiling/. The PDF is at https://indica-tech.com/checklists/lead-magnets/LEVERS-agent-cost-ceiling-checklist-2026-10.pdf.

---

**Nitish Gautam — Indica Technology Ltd.** Founder-led AI engineering: demo to production, in regulated industries, on fixed scope.

Website https://indica-tech.com · Book a call https://indica-tech.com/#contact · hello@indica-tech.com

YouTube youtube.com/@demotoprod · LinkedIn linkedin.com/company/indica-technology · Instagram and TikTok @demotoprod

_Agent cost ceiling checklist · October 2026 · @demotoprod_
