Late one night, your abuse alert fires: someone using a single API key is calling your invoice endpoint with sequential IDs at ten requests a second, retrying every 403 (access denied) response with a new parameter. You revoke the key and tighten the bot rules across your whole edge (the network layer that filters traffic before it reaches your servers), and the traffic graph goes quiet. Within days you get a churn warning on one of your largest accounts. Their operations team had set up an assistant to pull usage reports through your API, and your new rules showed it a CAPTCHA it could not pass. The assistant reported to the customer that your product failed, then finished the job through a competitor's integration. In tightening the rules against an attacker, you had turned away a paying customer's assistant.
You need a deliberate policy for how agents get into your product, because getting it wrong in either direction is expensive. With no gate at all, malicious agents can probe your product at machine speed; with defenses tuned for scrapers, paying customers' assistants get turned away and no alert tells you at the time. This chapter builds that policy.
Tell your guests apart by how much they can prove
Your guests, the agents other people send to your product, range from anonymous crawlers that owe you nothing to agents acting with authority a paying customer delegated to them, and no single policy works for that whole range. Every rule you write starts from the same question: who sent this request, and how strongly can they prove it? The answers fall into tiers.
- Anonymous reads. The request carries no identity at all. This tier gets public documentation at public rate limits and nothing more.
- Declared bots. The bot names itself in its user-agent header (the name a client sends with each request). Declaring itself is a courtesy, and the label helps you route traffic, but anyone can copy it with one line of code, so it is never proof.
- Signed agents. In web bot auth, a pattern still being standardized, the company that runs an agent publishes a public key and signs each request, so the signature proves cryptographically which company sent the traffic, without the company needing an account with you. Large edge networks already verify these signatures. That creates a middle tier: a guest whose identity you can verify and who has a reputation to lose. Which companies sign their requests and which networks verify the signatures keeps changing, so we track the specifics, with dates, in the Interop Ledger, our reference page for agent-protocol facts that change often.
- Delegated customer agents. The company that runs the agent registers with you, holds keys or an OAuth client (credentials registered for your login flow), and presents proof that a customer authorized the work. Every request then arrives tied to a scope you granted (a permission that names one action) and to a relationship you can bill, suspend, or call. Only this tier may take consequential actions (actions with real effects, such as spending money or changing data), and the credential alone is not enough: as Delegation: check whose authority the agent carries showed, credentials let the agent in, and only proof of what the customer delegated authorizes the action.
The more a guest can prove, the more it may do: public reads for anonymous guests, higher limits for signed agents, consequential actions only for delegated customer agents, and never a decision worth money based on a user-agent string alone.
In the diagram, titled GUEST GATE, an ANONYMOUS SCRAPER meets a CHALLENGE (a test, such as a CAPTCHA, meant to stop bots) and is stopped at a RATE LIMIT marked 429, the HTTP status code for too many requests. A DELEGATED AGENT carrying a signed badge passes three checks, IDENTITY, QUOTA, and MANDATE (the signed record of what its customer authorized, which is the delegated proof described above), and goes in through the FRONT DOOR, the entrance you build for identified agents. The caption, "Separate the decisions. Give the agent a front door.", means: decide separately how to treat anonymous scrapers and identified agents, and give identified agents a documented way in.
Deciding which capabilities each tier gets is product work, not infrastructure work. Documentation stays open to everyone, signed crawlers you want to keep get higher read limits, and every tool that changes anything in your product stays behind credentials and delegated proof. The action surface: every tool is delegated authority makes the full case for that last rule.
Set rate limits for how agents behave, not how people behave
A person reads, pauses, and clicks. An agent splits one errand into dozens of parallel calls, retries every failure immediately, and runs the job again whenever its customer asks. None of that is abuse, but limits set for the pace of a person will flag it as an attack every time.
- Set quotas per key and per organization. One customer can run many agents on many keys, so set limits at both levels: a per-key limit stops one agent stuck in a loop without punishing the whole account, and a per-organization budget stops one customer's agents from slowing the platform for everyone else. Rules per IP address do little, because agent traffic arrives from shared cloud addresses.
- Return honest 429s with a Retry-After header. An honest 429 is a real "too many requests" response, not a silent drop or a CAPTCHA, and the Retry-After header tells the caller how many seconds to wait. A well-built agent waits exactly that long and finishes late. If you drop the request without a response, the agent's retry code has nothing to go on, so it keeps retrying, and one request over the limit becomes a flood of them.
- Degrade service before you block. When a guest nears its budget, or your system is under heavy load, give the guest reduced service before you block it: lower priority in the queue, smaller pages, cached reads. If you slow a guest down, the customer's task keeps running; if you block the guest outright, your capacity problem becomes an outage for the customer.
An agent that hits a clear limit backs off and finishes late. An agent that hits a CAPTCHA cannot pass it and reports failure to a paying customer, so use challenges only where you have decided no agent is welcome.
Explain every refusal in words the agent can pass on
The customer never sees your block page; they hear only what their agent tells them, and an agent that gets a bare 403 or an unexplained challenge has nothing to pass on except failure. That is how the opening scene ended in a churn warning. Give every refusal a machine-readable reason and a next step: rate limited, retry after this many seconds; this action requires human confirmation, send the account owner here; this key lacks the required scope, and here is its name. The agent passes the reason on, and the customer gets an accurate account of what happened instead of a dead end.
The customer hears only what their agent tells them: an agent that gets a refusal with a machine-readable reason passes that reason on accurately, and an agent that gets a bare block reports "the product did not work."
Malicious guests test your defenses at machine speed
Some guests come to probe your defenses. They run the same steps a patient human attacker would, but in an afternoon instead of weeks: they send malformed values to your tool parameters to see what the error messages reveal, try identifiers in sequence to find objects they should not be able to reach, and call every tool with a low-privilege key to check whether its scope is actually enforced or only written down. The defenses that do most of the work are familiar ones. Treat every tool parameter as untrusted input: check its type and range, and check that any object it refers to belongs to the caller. Enforce authorization on the server for every call, checking this key, this object, and this action on each request, not once at the start of a session.
Other people's agents read your content
Everything so far protects your product from its guests. The last risk runs the other way: other people's assistants fetch your docs, listings, reviews, and support threads and use them as context. A hostile instruction planted in a review only needs an assistant to read it, and researchers have repeatedly pulled assistants off task with instructions placed in ordinary web content.
You are now both a target and a possible carrier of attacks: hostile agents attack the tools you expose, and a customer's assistant can fetch hostile text you host and act on it as if it were an instruction.
No filter reliably catches text written as an instruction, so the steps that actually work are the ones that reduce exposure.
- Sanitize what you serve to software. Strip markup, hidden text, and obvious instruction patterns from user-generated content in any feed you build for software to read.
- Label who wrote what. Serve your own text and your users' text in separate, labeled fields, so a client reading them can tell whose words are whose.
- Moderate the fields people forget. Display names, review titles, and image captions also end up in context windows (the text a model receives with each request), and moderation that covers only review bodies leaves those fields wide open.
Our chapter Prompt injection: the input is the attack surface explains why injected text can steer an agent at all; this chapter adds what to do about the text you serve.
Try it now
In this drill you attack your own product's public entry points, as a red team would, in 15 to 30 minutes. Run both halves against your own product, never someone else's.
Pick an entry point. Choose one public endpoint or tool your product exposes: a docs page, a public API route, or a tool already open to agent clients.
Send requests with no identity. From a terminal, run a small loop against it: a few dozen requests with no credentials and a generic user agent, few enough that they do not page your own on-call engineer. Record what comes back: a block with no explanation, a CAPTCHA, an honest 429 with a Retry-After header, or every request served normally.
Read one page the way an agent receives it. Open one page of your user-generated or public content and read it as raw text, the way it enters a context window, including display names and titles. Note anything that reads as an instruction, and note the fields your moderation does not cover.
Write up the two worst findings. Take one from the entry point and one from the content, each with its fix: the honest 429 to add, the challenge to remove from the path delegated agents use, the field to sanitize or label. Give the list to whoever owns your edge; both fixes are cheap, and neither will happen until someone asks for it.
Chapter Summary
- Your guests range from anonymous crawlers to agents carrying authority a customer delegated to them, and one rule for all of them either lets attackers through or turns away paying customers.
- Guests fall into tiers by how much they can prove: anonymous reads, declared bots, signed agents, and delegated customer agents. Anyone can copy a declared label, so it is never proof.
- The more a guest can prove, the more it may do: public reads for anonymous guests, higher limits for signed agents, and consequential actions only for delegated customer agents, because credentials let an agent in and only proof of what the customer delegated authorizes an action.
- Agents send bursts of parallel calls and retry at once, so set quotas per key and per organization, return honest 429s with Retry-After, and reduce service before you block anyone, instead of putting up hard blocks.
- A CAPTCHA is not a limit: an agent cannot pass it, so the customer hears that your product failed.
- Every refusal needs a machine-readable reason the agent can pass on, because the customer hears only their agent's version of events.
- Treat every tool parameter as untrusted input and authorize every call on the server; a well-behaved client does not prove that your defenses work.
- Other people's agents read your docs, listings, and reviews, so sanitize and label the text you serve; you are both a target and a possible carrier of attacks.
- Some agents skip your API entirely and operate the interface you built for people, which is the subject of Computer-use traffic: when agents operate your UI anyway.
Sources
- IETF (2025). Web bot auth draft specifications: HTTP message signatures for identifying automated agents (last verified July 2026).
- Cloudflare (2025). Blog and developer documentation on verified bots and cryptographically signed agent requests (last verified July 2026).
- IETF. RFC 6585, Additional HTTP Status Codes (2012), defining 429 Too Many Requests; RFC 9110, HTTP Semantics (2022), defining the Retry-After header.
- Greshake, K., et al. (2023). Not What You've Signed Up For: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection. AISec.
- OpenAI and Anthropic (2025). Published documentation of crawler and agent user agents and IP ranges (last verified July 2026).