Sub topic 13
When You Need Enforcement, Not Etiquette
Assume you understand basic HTTP requests, user-agent headers, and web server access logs. This chapter focuses on controls that can actually prevent or restrict a request. Files such as llms.txt and robots.txt communicate preferences, but they do not enforce them.
The control boundary
A crawler policy has two separate parts:
- Identification: deciding whether a request appears to come from an AI crawler.
- Enforcement: deciding what the server does with that request.
A user-agent string supports identification, but it is only a claim supplied by the client. A malicious or careless client can copy another crawler's name. Stronger identification uses reverse DNS checks, published IP ranges, signed requests, or a bot-management service. Each method adds maintenance or operating cost.
| Control | What it can do | Main weakness |
|---|---|---|
| User-agent rule | Allow or deny named crawlers | Easy to spoof |
| Rate limit | Reduce request volume | Does not stop all access |
| WAF rule | Block patterns at the edge | Can block legitimate users |
| Authentication | Require an approved identity | Requires a client integration |
| robots.txt | State crawler preferences | Cooperative crawlers only |
Rate limiting and WAF rules
Rate limiting is often safer than a complete block. It reduces load and gives you time to observe behavior. Apply separate limits to suspected crawlers rather than slowing every visitor. A web application firewall (WAF) can reject requests before they reach the application, based on user-agent, IP reputation, request frequency, geography, or other signals.
A simple Nginx policy can demonstrate the mechanics:
events {}
http {
limit_req_zone $binary_remote_addr zone=clients:10m rate=2r/s;
map $http_user_agent $ai_crawler {
default 0;
~*GPTBot 1;
~*ClaudeBot 1;
~*PerplexityBot 1;
}
server {
listen 8080;
location / {
limit_req zone=clients burst=10 nodelay;
if ($ai_crawler) {
return 403;
}
return 200 "public content\n";
}
}
}This example blocks requests that announce one of three crawler tokens and limits other clients to two requests per second, with a short burst allowance. In production, avoid treating the user-agent as proof of identity. Combine it with verified bot signals or an edge provider's managed bot detection.
Authentication for hard boundaries
Use authentication when access must be private or contractually restricted. Options include:
- HTTP authentication for a controlled integration.
- API keys or signed requests for approved consumers.
- A private network, VPN, or identity-aware proxy.
- Application-level authorization that checks the requested resource.
Authentication has a cost: every legitimate consumer must implement the protocol, and leaked credentials can grant access. It also changes the site from an openly crawlable resource into an explicitly managed service.
Choose the smallest effective control
Use observation before blocking. Start with logs, identify the traffic you need to control, and measure false positives. A useful sequence is:
Blocking all automated traffic can reduce legitimate search discovery, accessibility tools, or user-requested retrieval. A narrowly scoped rule is easier to reverse and less likely to damage normal traffic.
Exercise
A site owner says that adding Disallow: / for an AI crawler guarantees that the crawler cannot read private product plans. What control should you recommend?
Show answer
Move the product plans behind authentication or another access control. robots.txt only expresses a preference to cooperative crawlers and cannot protect sensitive content.