+84917212969
VIET SEO / INSIGHTS

Configuring robots and llms.txt for AI crawlers: technical and operational guide

Practical guidance for website owners, SEO, devops and agencies to allow/restrict AI crawlers, protect sensitive data, test on staging and record access evidence before public release.
Written by Viet SEO Team Updated: 2 views
Configuring robots and llms.txt for AI crawlers: technical and operational guide

Purpose: provide technical and operational steps so website owners, SEO, devops and agencies can control access by AI crawlers (AEO/GEO), protect sensitive data, validate on staging and capture access evidence before making pages public.

1. Role of robots.txt, robots meta and llms.txt

robots.txt: primary, path‑based directives read by crawlers; used to allow or block crawlers before they fetch content.

robots meta (noindex/nofollow): page‑level control applied after a fetch, useful for preventing indexing of rendered pages.

llms.txt (optional): a specialist file some AI systems may consult for collection policies, contact points, or crawl delays. It is optional; whether a vendor respects llms.txt must be verified with that vendor.

2. Verifying crawlers: User‑Agent + reverse DNS and evidence

  • User‑Agent is only an initial signal; combine it with IP checks and reverse DNS (rDNS) confirmation to verify a crawler.
  • rDNS + forward-confirm: reverse lookup returns a hostname and a forward DNS lookup of that hostname returns the original IP—this reduces spoofing risk.

Example checks:
curl -I https://example.com/robots.txt
dig -x 203.0.113.45 +short
dig host.example.com +short

Note: Official IP ranges or hostnames must be confirmed with the crawler provider; this guidance does not assert any provider-wide lists.

3. Interaction with WAF/CDN and whitelist/blacklist strategies

CDN/WAF can unintentionally block legitimate crawlers. Principles:

  • Whitelist by IP range + UA + rDNS, not UA alone.
  • Use ASN or provider ranges where available, and keep rules minimal and auditable.
  • Apply rate limits on heavy endpoints (/api/, /feeds/) rather than blanket blocking.

Example Cloudflare approach (conceptual)

  • Create Access Rule: Allow source IP range X.X.X.0/24 with a descriptive note.
  • Rate Limit for /feeds/: 10 requests per minute per IP with challenge action.
  • Firewall Rule: IF (http.user_agent contains "BadBot") AND (ip.geoip.country ne "US") THEN Challenge.

These are templates and must be adapted and tested in your environment.

4. Common configuration patterns and sample robots.txt

Sample robots.txt pattern for mixed allow/block:

# Allow entire site by default but block sensitive paths User-agent: * Disallow: /admin/ Disallow: /private-data/ Disallow: /cart/ # Allow a specific AI crawler while still blocking private paths User-agent: Example-AI-Bot Allow: / Disallow: /private-data/ Crawl-delay: 10

If you create llms.txt, include contact, scope and crawl-delay, and keep versioned copies for audit trails.

5. Staging test workflow (safe procedure)

  1. Isolate staging (password/IP restricted or VPN), keep it noindex and off public sitemaps.
  2. Deploy the same robots/llms files but with controlled allowances for test crawlers.
  3. Simulate crawler behavior using curl with the intended UA and request patterns.
  4. Collect and archive curl transcripts and access logs as evidence.

Example simulation:

curl -A "Example-AI-Bot/1.0" -I https://staging.example.com/page

6. Access log analysis to verify behavior

Sample Linux commands to extract evidence:

grep "Example-AI-Bot" /var/log/nginx/access.log | awk '{print $1,$4,$6,$7,$9}' for ip in $(grep "Example-AI-Bot" /var/log/nginx/access.log | awk '{print $1}' | sort -u); do dig -x $ip +short; done

Capture fields: client IP, timestamp, request URI, response code, bytes, user agent. Store parsed output in an audit location (S3, secured share) and record checksums.

7. Operational acceptance checklist (monitoring, alerting, rollback)

  • Pre-launch: validate rDNS + forward-confirm for all whitelisted IPs/hosts.
  • Pre-launch: staging evidence—curl transcripts, access logs, screenshots.
  • Launch: monitor first 72 hours for 403/429/5xx spikes and abnormal traffic patterns.
  • Alerting: configure alerts for sudden error-rate increases and high request rates to sensitive endpoints.
  • Rollback plan: documented playbook to revert robots.txt, remove whitelists, or re-enable stricter WAF rules.

Ensure crawlers do not bypass consent controls for personal data. For server-side tracking, separate bot/referral signals from human analytics to avoid skewing metrics.

Conclusion and verifications required

This guide emphasizes integration of technical controls with operational processes. Lists of provider IPs/hosts, or claims that a provider honors a given file, must be verified with the provider and recorded in your operational runbook before you rely on them in production.

EXPERT Q&A

Questions & Comments

You can ask a question about this article. Viet SEO will review and reply after moderation.

Private consultation via Zalo ↗
No questions yet. Be the first to ask.

Send a question

Your email address will not be displayed publicly.

Your question will be reviewed before being published.

CAPTCHA

Please do not include private addresses, phone numbers or sensitive documents in your public question.

Chat Zalo VietSEO