Agent Wranglers

AGT-72Recommended

Answer bursts with 429 instead of a stall

When a client asks too often, answer 429 with Retry-After at once. Serve large agent files as files built ahead of time, never built on request.

How to do it

Agents fetch in bursts and in parallel, often the largest files first. Build full-content files, feeds and JSON exports at deploy time, and serve them from a CDN, the web server or memory. Rate-limit per client in front of the application, as Limit how often anyone can call your APIs says. Send the limit headers from Tell clients their rate limit. A queue of slow requests holds workers until the site stops answering everyone.

Examples

nginx example

limit_req_zone $binary_remote_addr zone=agents:10m rate=10r/s;
location ~ \.(md|txt|json)$ {
  limit_req zone=agents burst=20 nodelay;
  limit_req_status 429;
  try_files $uri =404;
}

How to check

Send 100 requests in 10 seconds from one client, including the five largest agent files. Every answer arrives within 2 seconds, as 200 or as 429 with Retry-After. Another client's requests meanwhile still get 200.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/agents-as-users/ready-for-ai-agents/burst-answers">Agent Wranglers agents as users playbook</a>. In code you write, add a comment next to it with the same link.