Control and proof
Rate limiting for AI agents
Rate limiting for AI agents controls how many requests an agent can make in a time window, both to the platform it calls and to each vendor API behind it, so a fast or looping agent cannot exhaust a shared quota or trigger lockouts.
What it is
A rate limit caps requests per window: per second, minute, hour or day. RFC 6585 defines status 429, Too Many Requests, for a client that has sent too many in a given time, optionally with a Retry-After header saying how long to wait. For agents there are two limits that matter: how fast the agent may call the platform it uses, and how fast that platform calls each vendor.
Why it matters
Agents work at machine speed, in parallel and sometimes in loops. Vendor quotas are usually per account, not per integration, so an eager agent can spend the quota your billing sync and ticket integration also need. The MCP tools specification says servers must rate limit tool invocations. OWASP lists rate limiting as a way to reduce the damage of excessive agency, though not to prevent it.
How it works
- Declare each vendor's published limits and what they are counted against (account, user, database).
- Count atomically across every instance, so ten workers do not get ten budgets.
- Leave headroom below the published limit for the customer's other integrations.
- Queue briefly, then refuse with 429 and
Retry-Afterwhen over budget. - Cap concurrency per connection, so one run cannot open hundreds of sockets.
- Limit inbound traffic per address, per credential and per tenant.
Example
A vendor allows 10,000 requests an hour per account. Two agents and a nightly sync share that account. Without coordination, the agents spend the hour's budget by 9:20, and the sync fails. With pacing at 92% of the limit, counted per account, the agents slow down and the sync keeps its share.
Common pitfalls
- Agents retrying 429s immediately, turning one refusal into a burst.
- Counting per connection when the vendor counts per account.
- Ignoring
Retry-After. - Using rate limits as a budget. Slow and steady can still spend a month's allowance. See spending caps.
How actionlake handles it
Each service file declares the vendor's limits. The gateway counts them per vendor account per window, across all instances, and spends to 92% of the published limit, leaving 8% for your other systems. Over budget, it holds the request briefly, then answers 429 with Retry-After; callers should not retry a 429 themselves, because we are pacing that vendor for everyone. A per-connection concurrency cap stops one plan opening hundreds of sockets. Vendor 429s are not billed. Inbound, separate buckets apply per address, per credential and per tenant, set well above what a busy agent sends. Read more in your rate limits are safe with us.
Questions
What should an AI agent do when it gets a 429?
Wait for the time in the Retry-After header, or back off with jitter if there is none. Never retry immediately in a loop.
Why do vendor rate limits matter if my agent is the only user?
Your agent is rarely the only user. Billing syncs, ticket integrations and people share the same account quota, and a lockout affects all of them.
Is a rate limit the same as a spending cap?
No. A rate limit controls speed; a spending cap controls total use over a period. Agents need both.
Related terms
- Agent spending capAn agent spending cap is a hard limit on how much a single AI agent credential may spend or call in a period, checked before each request is sent, so that a looping or misbehaving agent stops at the limit instead of after it.
- Upstream callAn upstream call is one HTTP request that actionlake sent to a vendor's API on your behalf and that returned a definitive, attributable response; it is the unit actionlake meters and bills.
- Idempotency keyAn idempotency key is a unique value attached to a write request so that if the same request is delivered twice, after a timeout or a retry, the server performs it once and returns the stored result for the repeat.
- MCP gatewayAn MCP gateway is a single MCP endpoint that sits between AI agents and many systems, holding the credentials and enforcing permissions, limits and logging on every tool call that passes through it.
Sources
Connect an agent. Start free.
100,000 calls free every month. No card. Hard caps on every key.