Serving AI Agents Structured Data Without Cloaking: What Is Safe and What Is Not

How to serve AI agents structured data without cloaking: where Google’s policy starts, three safe methods, content negotiation and how to test.
Content Versioning for Agents: Serving Different Data to Humans vs AI Content Versioning for Agents: Serving Different Data to Humans vs AI

AI agents read your pages differently from people. They want facts, not stories. So some sites try to serve them a different version. That can be fine. It can also be cloaking. The difference is what you change, and why.

This guide shows three safe ways to give agents structured data. It also shows where the risk starts, using Google’s spam policy and the HTTP standard.

If you only do one thing

Keep the facts identical for every visitor. Change only the format. Then test the page the way Googlebot sees it.

Google defines cloaking as presenting different content to users and search engines [1]. Its example: a page about travel for search engines and a page about discount drugs for users. It also treats adding keywords only when the visitor is a search engine as cloaking [1].

Google’s policy does not say that every difference by user agent is cloaking. It also does not describe formats for AI agents. So we cannot say that a JSON version for agents is approved or banned. What we can say is that a page that tells a crawler one thing and a person another is the risky pattern.

Watch out: Prices, availability, legal terms and warnings must match in every version. If an agent sees a different price from a person, you have a trust problem, whatever the policy says.

Which safe way to serve agents?Three questions, four outcomes and one rule. The same path is written out below the graphic.aiseojournal.netWhich safe way to serve agents?The ruleSame facts for every visitor. Change only the format.Q1: Do agents need more than the page says?NoYesKeep one pageAdd JSON-LD next to thevisible text. One URL,one source of truth.Q2: Can every version come from one source?YesNoOne URL or two?One URL: negotiateon Accept and sendVary. Two URLs:link withrel="alternate".Fix the sourceDo not ship twohand-edited versions.They will drift.NeverDifferent prices, terms or warnings for agents. Choosing by user-agent name alone. rel=canonical to the JSON.Sources: Google spam policies; MDN content negotiation; Google canonical guidanceaiseojournal.net
Read the workflow as text
  1. The rule. Same facts for every visitor. Change only the format.
  2. Question 1: do agents need more than the page says? If no, keep one page and add JSON-LD next to the visible text. One URL, one source of truth.
  3. If yes, question 2: can every version come from one source? If no, fix the source first. Do not ship two hand-edited versions.
  4. If yes: one URL or two? On one URL, negotiate on the Accept header and send a Vary header. On two URLs, link them with rel="alternate".
  5. Never show agents different prices, terms or warnings, choose by user-agent name alone, or point rel=canonical at the JSON.
Built from the steps in this article.aiseojournal.net

What are three safe ways to serve agents?

MethodHow it worksMain risk
Structured data in the same pageAdd JSON-LD next to the visible text. One URL, one source of truth.The data can drift away from the visible text. Check it on every edit.
Content negotiation on one URLThe server picks a format based on the Accept header, for example HTML or JSON [2]Caches can serve the wrong version if you forget Vary [2]
Separate URL for each formatFor example a JSON file or feed next to the page. Link them with rel="alternate" [3]Two places to keep in sync. Content drifts.

For most sites, the first method is enough. It adds no new URL and no detection logic.

What does drift look like?

The risk with a second version is that the facts drift apart. Here is a made-up example.

Visible text on the page (example)

Plan: Standard
Price: [amount shown to visitors] per month
Cancel: any time

Fails: the agent version has a different price (example)

{ "plan": "Standard", "price": "[a different amount]", "cancel": "any time" }

Passes: both generated from one record (example)

record = { plan: "Standard", price: "[amount]", cancel: "any time" }
visible text   <- built from record
agent version  <- built from record

Paste both into the comparer below and it will show the difference in the numbers.

How does content negotiation work, and what can go wrong?

Content negotiation lets one URL return different representations, such as another language or file type. In the usual server-driven form, the client sends headers like Accept and the server chooses [2]. The server sends a Vary header to say which request headers it used. Caches need that to store the right copy [2].

MDN lists real drawbacks. The server does not fully know what the client can handle. Shared caches work less well. More headers also mean more fingerprinting risk [2]. MDN also calls choosing by User-Agent a bad practice for features, though some uses are fine [2].

So prefer the Accept header over guessing from a user-agent name. It says what the client asked for. A user-agent name only says who it claims to be.

What about canonical tags?

Do not use rel="canonical" to point at other formats. Google ignores canonical links that carry attributes such as type or hreflang. For other versions of a page, it says to use rel="alternate" instead [3]. For the same content at different URLs, choose one preferred URL and signal it with a redirect or a canonical link [3].

How do you test for safety?

  1. Compare the facts. Request the page as a browser and as an agent. Check every price, date, spec and warning matches.
  2. Check what Googlebot gets. Use the URL Inspection tool’s live test in Search Console and read the rendered page.
  3. Check your CDN. Firewalls sometimes treat bots differently from what you intended.
  4. Set one source of truth. Generate every version from the same data, so they cannot drift.

Our technical SEO fundamentals guide covers the wider crawl and index checks.

Worth knowing: We rewrote this article in November 2026. The earlier version quoted statistics attributed to Gartner and SEMrush, a quote attributed to MDN, and called user-agent switching “SEO-safe”. We could not verify those claims, so we removed them.

From our own site: On 8 November 2026 we requested one of our own pages twice, once with Accept: text/html and once with Accept: application/json. Both returned HTTP 200, and the Vary header listed only Accept-Encoding. So aiseojournal.net does not negotiate content by Accept. It serves everyone the same page. On 9 November 2026 we repeated the test and added user-agent names, from one ordinary internet address. The Chrome-style name, OAI-SearchBot, ClaudeBot and PerplexityBot each got HTTP 200 and a page of about 269 KB. The Googlebot and bingbot names got HTTP 403. The GPTBot name got HTTP 429 in two separate runs. Our robots.txt allows all crawlers, so those blocks come from the server or its firewall, not from robots.txt. A fake Googlebot name is not real Googlebot, so this does not show what Google receives. Use URL Inspection for that [4]. It does show that the server treats user-agent names differently.

How do you check what real Googlebot gets?

Do not test with a fake user-agent name. Anyone can send one. Google says to verify that a request really comes from Google by a reverse DNS lookup and a forward lookup, or by checking the IP against its published ranges [5].

  1. Use the URL Inspection tool. Enter the full URL and choose Test live URL. Then View tested page to see the screenshot, the HTML and the HTTP headers. The tool also has a daily limit per property [4].
  2. Compare that HTML with what a browser gets. Use the comparer below.
  3. Check your logs for real Googlebot requests, verified by DNS or IP range [5], and compare the responses.
  4. Check your firewall and CDN rules. Our own test below shows why.

What about paywalled pages?

Google says a paywall is not cloaking if Google can see the full gated content, as a person with access would, and the site follows Google’s Flexible Sampling guidance [1]. Check that guidance before you gate anything.

Fact compareraiseojournal.net

Paste the visible text of a page, then the version you serve to agents, such as the JSON values. The tool lists numbers, amounts and words that appear in only one version. It compares the text you paste. It does not fetch pages, test what Googlebot sees or judge intent, and it stores nothing. Nothing leaves this page.

Paste both versions and press Compare.
Different key names will show as word differences. Look at the values. aiseojournal.net

Frequently asked questions

Google defines cloaking as presenting different content to users and search engines. It does not rule on formats for AI agents. Keep the facts identical and change only the format, and test what Googlebot sees.

Prefer the Accept header. MDN calls user-agent sniffing for features a bad practice. A user-agent string is easy to fake and changes often.

Yes, if one URL returns different formats. It tells caches which request headers decided the response.

No. Google ignores canonical links with attributes like type. Use rel=alternate for other versions.

Put structured data in the same page and generate it from the same source as the visible text.

Do not trust the user-agent name. Google says to verify with a reverse DNS lookup followed by a forward lookup, or to match the IP address against its published ranges.

Google says it is not, if Google can see the full gated content as a person with access would, and the site follows its Flexible Sampling guidance.

What should you do next?

Pick one method. For most sites that is structured data inside the page. Then test it with a normal browser request, an agent-style request and the URL Inspection tool. Our technical SEO fundamentals guide has the wider crawl checks.

Sources

5 comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use