5 min read
Rate Limits and Caps Sized for Agents, Not Humans
How to set rate limits and caps for AI shopping agents: per-agent RPS, max order value, max quantity, and failing closed when agents retry harder.

On this page
Rate limits for AI agents need different numbers and different shapes than the limits you set for human shoppers. A person browsing your store clicks a few times a minute, gets bored, and leaves. An agent can loop, retry, and fan out in parallel without ever getting tired. If your limits were tuned for people, agents will either hit them constantly or slip right past them.
This post covers how I size limits and caps for agent traffic on storefront MCP servers: per-agent request rates, order value and quantity caps, and why everything should fail closed.
Agents behave differently from people
A few patterns show up as soon as agents start calling a store:
- Retries are aggressive. When a tool returns an error, many agent frameworks retry immediately, sometimes several times, sometimes with slightly changed arguments.
- Fan out is common. An agent comparing options may call
get_productfor twenty items at once. - Loops happen. A confused agent can call the same tool repeatedly because the result did not match what it expected.
- Mistakes scale. A person typing a quantity of 100 by accident usually notices. An agent that misreads "10" as "100" will happily submit it.
None of this is malicious. It is just how automated clients work. Your limits need to absorb it without hurting your human shoppers or your inventory.
Limit per agent, not per IP
IP based limits are a poor fit for agents. Many agents run from shared cloud infrastructure, so one IP might carry traffic from many integrations, or one integration might spread across many IPs.
Since each integration already has its own credentials (see my earlier post on authenticating the agent), key your limits on the agent id:
- Requests per second per agent, with a small burst allowance.
- Requests per minute per agent per shopper, so one heavy user does not consume an integration's whole budget.
- Separate budgets per tool class. Read tools like
search_catalogcan have generous limits. Write tools likecart_addorcheckout_initiateshould be much tighter.
I usually start conservative for new integrations and raise limits based on observed, healthy usage. It is much easier to increase a limit than to explain why an unchecked agent caused an incident.
Caps on what an agent can buy
Rate limits control how often. Caps control how much. For any tool that touches money or inventory, define hard caps per agent:
- Max order value. The total an agent can submit in a single order without additional approval.
- Max quantity per line item. Stops the 10 versus 100 mistake cold.
- Max line items per order. Keeps carts sane.
- Max orders per shopper per day through this agent. Catches loops that create duplicate orders.
- Max refund or cancel actions per period, if the agent is allowed those at all.
Caps should be configured per integration, stored next to its scopes, and enforced on the server. Never rely on the agent's own instructions to respect a limit. Instructions are guidance. Server checks are rules.
When a request goes over a cap, the right response is usually not a silent rejection. Return a clear error that the agent can pass to the shopper, or route the action to a confirmation step where a human approves it.
Fail closed
When your limit or cap check cannot run, for example because the counter store is unavailable or the integration record failed to load, the safe default is to deny the request.
Fail open feels friendlier in the moment. In practice it means that the one time your protection breaks is the one time an agent can do unlimited damage. For read only catalog tools you might decide a brief fail open is acceptable. For anything that writes, charges, or refunds, fail closed every time.
A few related habits:
- Validate arguments before counting. Reject malformed requests early so they do not burn budget or reach business logic.
- Use idempotency keys on write tools. If an agent retries
checkout_initiatewith the same key, return the original result instead of creating a second order. - Return retry hints. A
retry_aftervalue helps well behaved agents back off instead of hammering.
Make limits visible to agents
Agents handle limits better when they know about them. Include limits in your agent profile or tool descriptions in plain terms, for example that orders above a certain value need shopper confirmation, or that quantity per item is capped. Well built agents will plan around these rather than discovering them through errors.
Error messages matter too. "Quantity exceeds per-item limit of 5 for this integration" is far more useful than a generic 429. The agent can explain it to the shopper and suggest a next step.
Monitoring that catches problems early
Limits are only half the picture. You also want to notice when an agent is behaving oddly before it hits a wall:
- Alert on sudden spikes in error rates for one agent.
- Watch for repeated identical calls in a short window.
- Track cap rejections per integration. A rising count often means a bug on the agent side.
- Review new integrations closely for the first few weeks.
All of this depends on good structured logs, with the agent id on every line.
A starting checklist
- Limits keyed on agent id, not IP
- Separate, tighter limits for write and money tools
- Max order value, max quantity, max items, max orders per day
- Server side enforcement, never prompt only
- Fail closed for writes and payments
- Idempotency keys on every write tool
- Clear errors with retry hints
- Alerts on per-agent anomalies
Wrapping up
Agents are tireless clients. Limits built for human pace will not hold. Sizing rate limits per agent, capping money and quantity per integration, and failing closed gives you a store that welcomes agent traffic without betting your inventory on every agent being perfect.
If you are opening your Next.js eCommerce store to AI agents or building MCP tools and want limits and caps designed in from the start, I am happy to help. Get in touch through my contact section or at ahmadraza365pro@gmail.com.


