How to Use Server Logs to See Which AI Agents and Bots Visit Your Site
Your analytics dashboard shows no visits from ChatGPT or Claude last month, yet AI answers keep quoting your pricing page. Tag-based analytics misses these visits because most AI crawlers don't execute JavaScript. Server logs record them.
Your analytics dashboard shows no visits from ChatGPT or Claude last month, yet AI answers keep quoting your pricing page. Tag-based analytics misses these visits because most AI crawlers don't execute JavaScript. Server logs record them. Each request carries a User-Agent such as GPTBot or ClaudeBot. You confirm it against the operator's published IP ranges, then sort it into training, search, or user-triggered fetches. When your content is structured in Sanity, each logged path traces back to a specific document you can fix.
Getting this wrong has real costs. Training crawls produce most of the volume. Cloudflare put them at about 80% of AI crawling in the year to August 2025. User-triggered fetches are different: each one is tied to a person asking a question right now. If you treat all bot traffic as one number, you can end up blocking the wrong agents. You can also keep serving a 100K-token HTML page to an assistant that needs about 3K tokens of actual content.
This guide treats server logs as a content signal, not a security chore. They show who is reading, what they ask for, and whether what they receive is accurate and machine-readable.
How do you identify AI agents and bots in server logs?
You identify AI agents in server logs by reading the User-Agent header on each request and then checking the client IP against the operator's published ranges. The User-Agent alone is only a claim. Any scraper can send a string that says GPTBot. The header tells you who a request says it is, and the IP check tells you whether that's true.
OpenAI's crawlers show the pattern clearly. GPTBot sends a string containing 'compatible; GPTBot/1.4; +https://openai.com/gptbot'. OAI-SearchBot sends 'compatible; OAI-SearchBot/1.4; +https://openai.com/searchbot', and ChatGPT-User sends 'compatible; ChatGPT-User/1.0; +https://openai.com/bot'. OpenAI publishes matching IP lists as JSON files at openai.com/gptbot.json, openai.com/searchbot.json, openai.com/chatgpt-user.json, and openai.com/adsbot.json. Treat a request that claims to be GPTBot but comes from an address outside gptbot.json as an unverified scraper, not as OpenAI.
Anthropic runs three robots: ClaudeBot, Claude-SearchBot, and Claude-User. Browsers that Anthropic hosts to complete tasks for users identify separately, as Claude-Agent. Anthropic warns that blocking its IP addresses 'may not work correctly or persistently guarantee an opt-out' and recommends robots.txt instead. For log work, that means IP checks are for verification, and robots.txt is how you control access.
In practice, each log line you flag gives you three things to test: a known token in the User-Agent, an IP inside the matching published range, and a path. Fetch the JSON range files on a schedule instead of hard-coding them, because operators change their ranges. Two smaller details help with cleanup. OpenAI may add a 'robots.txt' marker to the User-Agent when it fetches robots.txt, which makes those requests easy to separate. And a robots.txt change can take about 24 hours to affect ChatGPT search. If you change the rules and the logs don't shift the same afternoon, that delay is the likely reason, not a misbehaving bot.

What is the difference between training crawlers, search crawlers, and user-triggered agents?
AI bots fall into three groups by purpose: training crawlers, search crawlers, and user-triggered fetches. Sorting log lines into these three groups matters more than any total count. Each group relates differently to your traffic, your robots.txt rules, and your content decisions.
Training crawlers, such as GPTBot and ClaudeBot, collect pages for model training data, and they produce most of the volume. Cloudflare analyzed the 12 months to August 2025. About 80% of AI crawling was for training, 18% for search, and 2% for user actions. Training's share was up from 72% a year earlier. GPTBot's share of AI and search crawler traffic grew from 4.7% in July 2024 to 11.7% in July 2025, and ClaudeBot's grew from 6% to about 10%.
Search crawlers, such as OAI-SearchBot and Claude-SearchBot, index pages so AI search products can cite and link to them. This group is the closest to classic SEO. If you block it, you drop out of the answers these products give.
User-triggered fetches happen when a person asks an assistant something and it fetches your page live. Examples are ChatGPT-User and Claude-User, plus Perplexity-User, which Cloudflare classifies as a user action. OpenAI says ChatGPT-User 'is not used for crawling the web in an automatic fashion. Because these actions are initiated by a user, robots.txt rules may not apply.' Anthropic says disabling Claude-User 'prevents our system from retrieving your content in response to a user query.' There aren't many of these requests, but each one is a real question being answered with your content.
Each category also has its own controls. Anthropic supports Crawl-delay. As of Oct. 30, 2026, it also recognizes a 'no AI training' preference signal based on the IETF aipref draft. That lets you treat training and retrieval as separate decisions instead of one yes-or-no on all AI access. Group your log report by purpose to see which of those choices would actually change your traffic.
Crawl volume isn't the same as visitors
Where do you get AI bot logs on a modern CDN and edge stack?
On a modern stack, the logs that show AI agent traffic come from the CDN, edge, or hosting provider, not just the origin server. Origin logs record only the requests that reach the origin. Anything the edge serves from cache never shows up there. On a well-cached marketing or docs site, that can be most of the traffic, including most bot fetches of popular pages.
Three common sources cover most setups. Cloudflare Logpush streams unsampled HTTP request logs, with user agent and bot metadata, to storage or observability tools. Unsampled matters here. User-triggered agent fetches are a small share of AI traffic, and sampling can drop them entirely. Netlify Log Drains stream traffic logs with path, status, IP, and user_agent fields, and Netlify has published a guide on using them to track AI search traffic. Vercel Log Drains export request records as JSON or NDJSON, which third-party analyzers parse for crawler user agents.
Whatever the provider, check that the export includes four fields before you build on it. You need the full User-Agent string, the real client IP (not a proxy hop), the request path with its query string, and the response status. Without the IP, you can't verify bots. Without the status, you can't tell whether agents are getting 404s, redirects, or blocked responses.
One common failure is a split view. The platform team reads origin logs and sees little AI activity, while the CDN quietly serves thousands of cached responses to GPTBot every day. Another is when one host serves the HTML pages and an API or MCP endpoint runs and logs somewhere else. Agent traffic hits both, so combine both log sets, keyed on timestamp and path, before drawing conclusions.
The last question is retention. Bot patterns shift month to month as operators change crawl rates. Keep at least a few months of edge logs in cheap storage so you can compare periods instead of reading a single snapshot.
How do you analyze server logs for AI bot traffic step by step?
Analyzing server logs for AI bot traffic follows a repeatable sequence: collect, filter, verify, classify, and read the paths. If you run the same procedure every month, you get trend data instead of a one-off snapshot.
1. Export edge logs, not just origin logs, for a fixed window such as the last 30 days. Include User-Agent, client IP, path, status, and timestamp.
2. Filter the User-Agent for known AI tokens: GPTBot, OAI-SearchBot, ChatGPT-User, ClaudeBot, Claude-SearchBot, Claude-User, Claude-Agent, and any others you track.
3. Verify each matching request against the operator's published IP list. For OpenAI, that means gptbot.json, searchbot.json, chatgpt-user.json, and adsbot.json. Move requests that fail into a separate 'claimed but unverified' group.
4. Classify each verified request as training, search, or user-triggered.
5. Group by path and count requests per category so you can see the top pages for each purpose.
6. Break out special paths: robots.txt, llms.txt, any .md URLs, sitemaps, and API or MCP endpoints.
7. Check status codes per bot. A cluster of 404s or 403s is a content or configuration problem you can fix this week.
8. Compare the results with the previous period and with your current robots.txt rules.
Two cautions keep the analysis honest. First, don't read user-triggered counts the way you read pageviews. These requests are rare (Cloudflare's data puts user actions at about 2% of AI crawling), but each one maps to a live question someone asked an assistant. Second, don't assume the unverified group is harmless. Scrapers often disguise themselves with AI user agents. If you skip step 3, they inflate how much real AI interest your site appears to get.
The output you want is a short table for each month. It lists bot, category, verified request count, top ten paths, and error rate. Review it alongside the previous month's version. That table is what you turn into content decisions.
What do AI agent requests reveal about llms.txt, markdown, and API calls?
AI agent requests show which pages agents read, whether they use llms.txt or markdown endpoints, whether they call APIs or MCP servers, and how often they come back. The path is the most useful field in the log, because it shows which content an agent wanted and in what format.
Page HTML requests are the baseline. Most AI crawlers don't execute JavaScript, so they see your raw HTML, not the rendered page. If a page builds its main content client-side, a 200 response in the log can still mean the agent got an empty shell. Compare what the server actually sent with what a human reader sees.
For llms.txt, logs usually show much less use than people expect. Ahrefs studied server logs from 137,000 domains and reported on June 15, 2026 that 28% publish an llms.txt file. But 97% of those files got zero requests in May 2026. Of the fetches to the 3% that were read, 96% came from bots and 19.5% from named AI tools. GPTBot was the top fetcher and Claude-Code second. AI bots never requested llms.txt on domains that didn't have one. Google's John Mueller called llms.txt a 'temporary crutch, perhaps to save some tokens' for AI coding tools. Your own logs will show whether anything reads yours. Most sites should expect coding agents and tools, not search bots.
Markdown endpoints tell a similar story. Sanity's documentation serves a markdown version of a page when you append .md to the URL, so its logs show which agents ask for the leaner format directly. Profound tested 381 pages across six websites for three weeks and found no statistically significant increase in bot traffic from serving markdown. Format affects what agents get, not whether they come.
API and MCP calls are the most deliberate signal. An agent calling an endpoint isn't browsing. It's fetching specific records to complete a task, so request counts per endpoint show which content agents depend on most.
Markdown changes what agents receive, not how often they visit
How do you turn AI bot log findings into content decisions?
Log findings become content decisions when you read them as a ranking of the content agents rely on. The pages user-triggered agents fetch most are the ones answering real questions right now. Review those first for accuracy, clearer structure, and a machine-readable version.
Start with the top paths from user-triggered fetches and search crawlers. If ChatGPT-User keeps fetching a pricing page, a returns policy, or a setup guide, that page is effectively part of an assistant's answer, so check it for stale facts first. Contradictions between two pages on the same site hurt agents more than human readers, because an agent quotes whichever page it happens to read.
Next, look at errors. Bots getting 404s on old URLs point to missing redirects. Repeated requests for .md or llms.txt paths that don't exist suggest tools expect a format you don't serve. Pages that return 200 but depend on client-side rendering need server-rendered content, because most AI crawlers don't run JavaScript.
Then decide what to expose better. Sanity's field guide on serving content to agents lists the options from least to most effort. You can do nothing or add an llms.txt file. If you host on Cloudflare, you can turn on its edge conversion. You can serve markdown routes that respond to an Accept: text/markdown header, expose content through APIs or MCP, or add copy-as-markdown buttons. Your logs tell you which option is worth the effort. If coding agents fetch your docs constantly, markdown versions and llms.txt pay off. If almost nothing reads them, an llms.txt file isn't worth much.
Finally, set policy separately for each category. Training, search, and user-triggered traffic each need their own decision. A common middle path is blocking training crawlers while allowing search crawlers and user fetches. Your logs confirm whether the rules took effect, as long as you allow about 24 hours for ChatGPT search to pick up a robots.txt change. One caution: heavy training-crawler traffic on a page isn't a reason to rewrite it, because training crawls say little about current demand.
How does Sanity make sure agent traffic reaches accurate, machine-readable content?
Sanity makes sure agents receive accurate, machine-readable content by structuring content once and serving it from that single source as clean HTML, markdown, or API and MCP responses. Server logs show which agents arrive. What they receive is decided upstream, in the system that holds the content.
Sanity is the AI Content Operating System, the intelligent backend for companies building AI content operations at scale. CMSes bolt on AI. Sanity is built for it, and the difference shows up in the formats agents request. Raw HTML wastes an agent's context: Sanity's field guide notes that a 100K-token page becomes about 3K tokens of useful content after navigation, footers, scripts, and cookie banners are stripped. Because Sanity content is defined by a Schema and stored as Portable Text, you can render a markdown route directly from it at the source. You don't have to reconstruct the content from rendered HTML at the edge.
For agents that query instead of browse, Sanity Context exposes content through a Context MCP endpoint. GROQ mode queries the dataset at request time. A request like 'size L latex gloves, under $200 a pallet' becomes a filter over product documents. It stays exact across hundreds of thousands of records, with nothing to keep in sync. GROQ mode needs a deployed schema (sanity schema deploy, Studio v5.1.0 or later). Knowledge Bases, currently in beta, serve a pre-built index instead. When the same fact appears in conflicting versions across sources, a build raises an issue so you can choose the correct one. For example, a help center might say returns are accepted within 30 days while a product page says 45. You can switch a single connection with ?mode=groq or ?mode=knowledge_base.
Functions keep that content fresh. They react to content changes: a Document function on create or update events, or a Sync tag invalidate function, can regenerate markdown versions or clear caches when an editor changes a page. That way, the paths agents hit most in your logs serve the current version, not last week's.
Run regeneration hooks on update, not publish
Where AI agent visibility and agent-ready content come from
| Feature | Sanity | Origin server logs | CDN or edge logs | Bot analytics tools |
|---|---|---|---|---|
| Sees agent requests served from edge cache | Not a log source. Sanity's role starts before the request: the cached page or .md route the edge serves is generated from structured content in the Content Lake. | Partial: records only requests that reach the origin, so pages served from CDN cache never appear, which can hide most bot fetches on well-cached sites. | Strong: Cloudflare Logpush streams unsampled request logs, and Netlify and Vercel Log Drains export path, status, IP, and user_agent fields. | Varies by tool: coverage depends on the logs or edge data each tool ingests, so check whether it reads edge requests or only origin traffic. |
| Identifies and classifies AI bots by purpose | Not a bot analytics product. Pair Sanity with edge logs: verified paths map back to Schema-defined documents, so each finding points to specific content to fix. | Manual: you match User-Agent tokens like GPTBot or ChatGPT-User yourself, verify IPs, and maintain the category mapping in scripts or queries. | Available: Cloudflare logs carry bot metadata, and Radar AI Insights groups crawlers as Training, Search, User action, or Undeclared. | Core job: these tools exist to label who visited, grouping AI crawlers and agents by operator and purpose for reporting. |
| Changes what agents actually receive | At the source: content defined by a Schema in the Content Lake renders to clean HTML, markdown routes from Portable Text, or API responses, all from the same documents. | No: origin logs record responses after the fact. Changing the payload means changing the application or the content behind it. | Partly: Cloudflare can convert HTML to markdown at the edge, though the conversion works from rendered HTML rather than the underlying content structure. | No: they report who visited and what was fetched, but changing what agents receive is the job of the system that holds the content. |
| Answers agent queries through API or MCP | Native: Sanity Context MCP in GROQ mode queries the dataset at request time. Knowledge Base mode (beta) serves a pre-built index. Override per connection with ?mode=groq. | Logs MCP or API calls if the endpoint runs on that origin, but the logs themselves provide no query surface for agents. | Logs API and MCP calls that pass through the edge. The query surface comes from whatever application sits behind it. | Reports on endpoint traffic when the logs include it. These tools don't host APIs or MCP endpoints for agents to query. |
| Keeps agent-facing content fresh | Functions react to create and update events, and Sync tag invalidate functions react to Live Content sync tags, so markdown versions and caches regenerate when content changes. | Shows when bots refetch a page, which helps you judge staleness, but has no link to when the underlying content changed. | Edge caches can be purged when content changes, and the logs then show whether bots received the new version on their next fetch. | Shows crawl frequency per page over time, which helps you spot stale pages agents keep fetching, though the tools don't fix them. |