Agent Auth Gateway v1.0

Guides / 7 min read

How to Rate Limit an AI Agent (Calls, Tokens and Concurrency)

Published 2026-11-14 · Reviewed 2026-11-14 · By the Ingenious AI team

A spend cap tells an agent when to stop for the day. A rate limit tells it how fast it may go right now — and speed is where loops live, because a loop is just legitimate-looking work happening far too quickly.

The short answer

Set three rate limits per agent: calls per minute, tokens per minute, and concurrent runs. Size them from observed normal behaviour at roughly three times the healthy peak, enforce them in the authorisation path so the excess call is refused or queued rather than executed, and treat sustained rate-limit hits as an anomaly signal, not as background noise. Rate limits do not replace spend caps — a slow loop under the rate limit still burns all day — but they convert an explosive incident into a slow, visible one.

Check your own setup as you read: run the free Spend Guard self-check or test a policy in the playground — five minutes, no signup, and the gaps it names map to the controls below.

Worked example: 900 calls a minute from a 'healthy' agent

Solstice Travel, a fictional online travel agency, ran a fare-monitoring agent that normally made 40 to 60 calls a minute across its suppliers. A supplier API change made one endpoint return a 'retry immediately' hint in its error body, and the agent complied — 900 calls a minute for 3 hours, 118,000 calls, $1,140 in per-call fees, and a supplier threatening to suspend the agency's access for abusive traffic. Every call was individually legitimate; the rate was the abuse.

Solstice set a 150-call-per-minute ceiling for the agent — two and a half times its healthy peak — plus a token-per-minute limit and a cap of 3 concurrent runs. When the supplier repeated the change two months later, the agent hit its rate ceiling in the first minute, excess calls were refused with the reason logged, the anomaly alert fired at sustained saturation, and a developer fixed the retry handling the same morning. Total cost of the second incident: $4.10 and one alert.

Rate is a different signal from total

Totals tell you an incident happened; rate tells you one is happening. A loop's fingerprint is velocity long before it is volume — by the time a monthly total looks wrong, the loop has been running for days. That is why rate limits belong in the live authorisation path, evaluated per call, and why their refusals should page like incidents rather than accumulate quietly in a metrics dashboard nobody opens on weekends.

Three limits, three different loops

Calls per minute catches chatty loops and retry storms against per-call-priced tools. Tokens per minute catches the verbose loop — an agent re-sending an ever-growing context, where call count stays modest while each call balloons. Concurrent runs catches the fan-out failure, where a scheduler or a self-spawning workflow starts many copies of the same agent, each individually under every other limit. Set all three; any one alone leaves a shaped hole a real failure will find.

Refuse, queue or degrade — choose per action

Not every excess call deserves the same response. For read calls, queuing briefly or degrading to a cached answer keeps user-facing work alive. For writes and paid calls, refuse outright: a queued payment instruction that executes twenty minutes later, out of context, is its own incident class. Whatever you choose, the agent must be told plainly — a clear rate-limit refusal it can back off from, not a timeout it will retry against, which is how a rate limit accidentally manufactures the storm it exists to prevent.

Sustained saturation is an alert, not a statistic

An agent that touches its rate ceiling occasionally on a busy day is healthy. An agent pinned against it for ten minutes is telling you something changed — in it, in a supplier, or in its inputs. Alert on sustained saturation with the agent's name and the limit it is hitting, and include the top action in the alert so the responder starts with the likely culprit in hand.

Choosing what happens in the minute after the limit

The limit itself is arithmetic; the minute after it is design. Decide in advance, per agent, what saturation means: for a monitoring agent, excess calls drop harmlessly and the next minute starts clean; for a customer-facing agent, reads degrade to the last good answer; for anything that writes or pays, saturation is a lockdown candidate if it persists. Write those decisions into the alert the saturation triggers, so the responder is executing a plan rather than inventing one. And rehearse the supplier-failure case in staging — a tool that answers 'retry immediately' is a realistic test fixture, not a paranoid one, as Solstice's $1,140 lesson shows.

Five actions to rate limit an agent today

  1. Measure each agent's healthy peak calls and tokens per minute over two normal weeks.
  2. Set calls-per-minute and tokens-per-minute ceilings near three times the healthy peak, per agent.
  3. Cap concurrent runs per agent so fan-out failures cannot multiply under every other limit.
  4. Refuse excess paid and write calls outright; queue or degrade only safe reads, with a clear back-off signal.
  5. Alert on sustained saturation — ten minutes at the ceiling — naming the agent and its top action.

Source note and related guides

Figures in the worked example are illustrative, drawn from a fictional company created for this guide; the controls, failure patterns and procedures described are the gateway's documented behaviour — see the Agent Auth Gateway documentation and the policy patterns in allowlists vs denylists, spend caps and the agent kill switch. Reviewed by the Ingenious AI team, 2026-11-14.

Sources

  • OpenAI API documentation — Rate limits and spend limits, on how provider-side usage and spend limits are defined at organization and project level: platform.openai.com, 2026
  • NIST AI Risk Management Framework (AI RMF 1.0), the voluntary framework for managing AI risk across design, development and use: nist.gov, 2023
  • OWASP Top 10 for Large Language Model Applications, the OWASP GenAI Security Project's risk list for LLM and agent systems: owasp.org, 2025

Frequently asked questions

What rate limit should an AI agent have?

Start near three times its observed healthy peak. Solstice Travel's fare agent peaked at 60 calls a minute normally, so its ceiling was set at 150. Revisit after a month of logs; a limit that fires daily is mis-sized, one that can never fire is decoration.

Do rate limits replace spend caps?

No. A loop running just under the rate limit can still spend all day. Rate limits bound velocity and make incidents visible early; spend caps bound the total. You need both, enforced in the same path.

What happens when an agent hits its rate limit?

Excess calls are refused or, for safe reads, queued or degraded — and the agent receives a clear rate-limit response it can back off from. A silent timeout is the worst response, because agents retry timeouts and amplify the storm.

Why limit tokens per minute as well as calls?

Because some loops grow call size instead of call count: an agent re-sending expanding context can multiply token spend while its call rate looks normal. Token velocity catches that shape.

Should rate-limit hits trigger alerts?

Sustained ones, yes. Brief contact on a peak day is normal; ten minutes pinned at the ceiling means something changed and a human should see the agent's name and top action while it is still cheap.

Governing agents in production?

Spend caps, approval queues, policy simulation, burn forecasting, and step-up lockdowns — all built into the gateway. Free tier to start. Or test policies in the playground with no signup.

Share this: X Facebook LinkedIn WhatsApp
← Scoped Tokens for AI Agents: Least Privi… All guides What an Audit Log for AI Agent Actions M… →