Building with Sanity AI: Understanding structured content for LLMs

Building with Sanity AI: Understanding structured content for LLMs

Mihajlo Ivanovic
Mihajlo Ivanovic
•
Sanity
•
Published on
10/2/2026

Key takeaways

  • Sanity AI is six tools running on one structured content backend, and the content model decides how well any of them work.
  • Content Agent proposes changes for a person to approve, and Agent Actions check every LLM output against your schema before it lands in a document.
  • Sanity Context gives agents read-only access, while the Sanity MCP server is the write path.
  • Sanity's own data shows 91% of agent work is operations on content that already exists, so the first project should be an audit.
  • LLMs need typed fields, references, Portable Text, and validation rules in the schema, and all four are modelling decisions.
  • Google says no special files or markup are needed to appear in AI Overviews or AI Mode.

Sanity has spent the past two years adding AI to its content operating system, and the list is now long. Content Agent, Agent Actions, AI Assist, Canvas, Sanity Context, and the Sanity MCP server all ship as part of the platform, and most marketing teams meet them as a single phrase on a vendor page that says Sanity is "AI-ready".

What that phrase means in practice depends less on the tools than on how your content is modelled. Each of these features reads and writes structured fields, so a well-modelled dataset gets reliable results, and a loosely modelled one gets confident mistakes.

Those modelling decisions are cheap to get right before a build and expensive to fix after, which is why they deserve more attention than the feature list. If the Content Lake and Studio are new to you, our guide to what Sanity is covers them.

What is Sanity AI?

Sanity AI is the collective name for the AI features inside Sanity's content operating system. Broadly, it covers the following:

  • Editorial assistance for individual writers
  • Automated content operations across whole datasets
  • Governed access for external AI agents

One idea sits under all of it. Every field in Sanity is typed and addressable, so an AI can be pointed at a specific field, have its output validated against the schema, and be governed by the same roles and permissions as a person. A legal disclaimer field, a price field, and a hero image field are three different things to the model, and that difference is what keeps it accurate.

Sanity frames this as five pillars of content operations. Those are:

  • Structured content
  • Governance and workflow
  • Content applications
  • Automation and delivery
  • Agentic context

The line that matters most for a content team is that "agents read, draft, and act on the same structured content your team works in."

Two customer figures on Sanity's homepage show the scale this is built for. PUMA manages "50k reusable structured content pieces" on the platform, and Complex reports "80h editorial time saved per month".

Sanity's AI stack, tool by tool

Six tools make up the stack, and the easiest way to keep them straight is by who uses them. Editors work in AI Assist and Canvas. Content operations teams use Content Agent and Agent Actions, and external agents connect through Sanity Context and the Sanity MCP server.

See the complete breakdown in the table and read more about each below.

Tool
Who uses it
What it does
Reads or writes
Human approval
Content Agent
Content ops teams, editors
Finds, audits, and rewrites content by conversation
Writes drafts
Required, cannot publish
Agent Actions
Developers, automation
Schema-aware generate, transform, translate, prompt, and patch
Writes
Set by your workflow
AI Assist
Editors in the Studio
Field-level instructions, translation, alt text
Writes to fields
Editor reviews in place
Canvas
Writers
Free-form drafting with an AI ghostwriter
Writes to fields
Writer maps text to fields
Sanity Context
External agents
Read-only MCP access through GROQ or knowledge bases
Reads
Not needed
Sanity MCP server
AI coding tools
Query, create, edit, publish, deploy a Studio
Reads and writes
Follows account permissions

Content Agent

Content Agent is the conversational tool for content operations. It runs from the organisation dashboard and, since June 2026, inside Slack as well. For example, you can ask it to show every product page missing a meta description, then ask it to write them.

Before the feature list, it helps to know how Content Agent is governed. Per the Content Agent documentation, it "never makes changes without your approval", it cannot publish, and it "uses your existing Sanity permissions". It only sees and edits what the signed-in person can.

That makes it well suited to batch audits. Point it at every case study document, ask which ones lack a summary field, and it proposes the fixes as drafts or as a content release for someone to review. We described the same audit-and-fix pattern in our guide to AI content operations, and Content Agent is the Sanity-native version of it.

Agent Actions

Agent Actions is the API layer for running schema-aware AI instructions from code. It runs wherever your developers already run things, such as Sanity Functions, CI pipelines, migration scripts, and webhook listeners.

The Agent Actions introduction lists five actions.

  1. Generate creates or enriches a document.
  2. Transform modifies an existing document without adding fields.
  3. Translate localises a document while keeping its structure.
  4. Prompt asks the LLM a question and hands the answer back to your code.
  5. Patch makes schema-aware edits with no LLM involved.

Schema-aware means the output is checked against your content model before it lands, so a generated field cannot arrive in the wrong shape. For a content lead, that is the difference between a bulk job you can trust and one you have to re-check line by line.

AI Assist and Canvas

AI Assist is the Studio plugin for editors. You write reusable instructions in plain language and attach them to fields or documents, such as drafting a summary from the title, writing alt text from an image, or translating a document. The AI Assist setup guide notes it is available on the Growth plan and up, and our guide to Sanity pricing covers what that plan costs.

Canvas is the free-form writing surface with an AI ghostwriter. You draft the way you would in a document, and per the Canvas documentation the finished text "can flow directly into the right Studio fields with a single click".

Both tools help one person write faster. Content Agent and Agent Actions work across many documents at once, which is the distinction to keep in mind when you plan a rollout.

Sanity Context and the Sanity MCP server

These two get confused because both are MCP servers, and they do opposite jobs. Sanity Context is for agents that read your content. The Sanity MCP server is for agents that build and edit it.

If the protocol is new to you, we explained what an MCP server is in our Webflow guide, and it works the same way here.

Sanity Context, per its documentation, is "a hosted Model Context Protocol (MCP) server that gives AI agents structured, read-only access to your content". It has a GROQ mode for live datasets and a Knowledge Base mode for curated material, and Knowledge Bases are still an opt-in beta.

The use case most marketers recognise is a support or product assistant on your own site that answers from your own published content. Sanity's pricing page lists the same capability as "Agent Context", so expect to see both names.

The Sanity CMS MCP server handles the write side. Hosted at mcp.sanity.io, it lets tools such as Claude Code and Cursor query, create, edit, and publish content, and even deploy a Studio, according to the MCP server docs. Which tools an agent gets follows the permissions of the account it signs in with.

How to model content in Sanity so AI can use it

A site assistant built on text chunks will confidently quote last quarter's price or the wrong product variant. Nothing in a chunk says which copy is current, so it guesses.

Sanity laid out four problems with plain retrieval over chunks when it introduced Agent Context in March 2026.

  • Precision questions get fuzzy answers.
  • Structure flattens inside embeddings.
  • Stale data has no visibility.
  • Text-only retrieval cannot filter, compare, or act.

Sanity's usage data agrees. In a June 2026 post on what agents need, it reported that agent activity on its MCP server grew 70 times in eight months to roughly 2.5 million tool calls from 20,000 organisations, and that 91% of it is operations on existing content, meaning auditing, editing, and translating. The value sits in content you already have, and it pays off only if that content is structured.

Sanity CEO Magnus Hillestad said as much in the March 2026 launch announcement. "When content is modeled intentionally, with relationships, validation rules, governance, and real-time APIs, AI systems stop guessing and start reasoning." The same release credits loveholidays with replacing a £300K-a-year translation agency with two content specialists across 50,000+ hotel listings.

The content model is therefore the specification the AI works from, and decisions made before any AI is switched on decide how reliable it will be. They start with typed fields and page blobs, the difference we covered in headless vs traditional CMS.

Typed fields for every fact

Every piece of content an AI should be able to find, change, or quote gets its own named field with a type, such as string, number, reference, image, or block. A fact buried inside a rich-text body is invisible to a field-level query.

Here is one product page modelled with AI in mind.

Field
Type
Why it matters for AI
Title
String
Gives the agent one unambiguous name to match on
Summary
Text
A snippet-ready answer the agent can quote whole
Price
Number
Filterable and comparable as a number
Category
Reference
Lets the agent traverse to related products
Compliance disclaimer
Reference
One source of truth, updated in a single place
FAQ items
Array of objects
Each question and answer is addressable on its own
Hero image
Image with alt text
The model can caption, swap, or describe it
Related products
Array of references
Relationships survive retrieval

Before, a pricing claim is pasted into fourteen pages. After, one price field is referenced fourteen times, and a change lands everywhere at once.

References for shared content

References give an agent a single source of truth. A product, an author, or a legal disclaimer is modelled once and linked everywhere, so an update propagates and an agent never has to reconcile copies.

References do more than help an agent coordinate copies. In the words of Sanity's June 2026 post, they "remove the need for" coordination altogether.

Picture a compliance line that legal changes every quarter. Referenced by every landing page, it is updated in one edit, and an agent asked to check compliance text has exactly one place to look.

Portable Text for rich text

Portable Text is "a JSON based rich text specification", which means rich text is stored as typed blocks and marks with no HTML string in the mix.

For an LLM, this changes what is safe to touch. A model can rewrite one block, translate one paragraph, or pull one quote without corrupting the markup around it, and the same text renders on the web, in an app, or inside an AI pipeline.

Keep rich text in Portable Text, and keep structured facts such as prices, dates, and specs out of it entirely. That is the whole rule.

Validation and roles in the schema

Guarantees belong in the schema and the permission model, because a prompt to a non-deterministic model cannot enforce them. Sanity's June 2026 post says it plainly. "You do not put the guarantees in the prompt to a non-deterministic model."

Three controls do most of the work.

  1. Validation rules on fields, such as required, length, and allowed values, which Agent Actions outputs are checked against.
  2. Roles and tokens that limit what an agent can read or write.
  3. Approval steps, through drafts and content releases, that keep publishing with a person.

These are the same controls you would set for a new human editor, which is the fastest way to explain the governance model to a stakeholder. Nobody gives a new hire publish rights on day one, and an agent earns them the same way.

Structured content and AI search

Everything above is about AI reading and operating your content through Sanity's APIs. AI search engines such as Google AI Overviews and AI Mode, ChatGPT, and Perplexity read your published pages like any crawler, which makes them a different case.

Google's documentation on AI features is direct about this and states that "There are no additional requirements to appear in AI Overviews or AI Mode" and that "You don't need to create new machine-readable files, AI text files, or markup to appear in these features". It does ask that your structured data "matches the visible text on the page".

Profound's February 2026 experiment tested the Markdown question across 381 pages on six sites, with half serving Markdown to AI bots for three weeks. The result was "one extra visit per page", about 16% on the median, and the authors concluded the data "doesn't support" treating Markdown as a priority. That is a developer week to spend elsewhere.

What structured content does do for AI search is make clean, consistent HTML and accurate schema markup a by-product of the model, so nobody rebuilds them page by page. That is the part Google actually asks for, and it is the discipline behind earning citations in our guide to AEO for Webflow.

Fix the content model and the page templates first. Add llms.txt once those are done, as a cheap extra, and expect no measurable traffic from it.

Where to start with Sanity and AI

The order matters more than the tool choice. Here is the sequence we would run this quarter.

  1. Audit the content model against the four rules above before switching anything on.
  2. Run the first AI project as an audit with Content Agent, since 91% of agent work is operations on existing content.
  3. Automate one repeatable job with Agent Actions, such as translation or metadata, with a person approving the output.
  4. Connect external agents last, through Sanity Context for reading and the MCP server for writing, each scoped by role.

The front end is a separate decision, and Sanity stays neutral about it. For marketing sites, we often see Webflow in the frame, and our Sanity vs Webflow comparison covers when each makes sense.

Modelling content for AI is the part teams get wrong, and it is cheap to fix before a build and expensive after. If you are scoping a Sanity build and want the content model right before any AI touches it, that is the conversation to have with us first. If you would rather see how AI reads your current site, start with a free AI website audit.

Frequently asked questions about Sanity AI

Is Sanity AI free?

Every Sanity plan includes Content Agent, Agent Actions, and Agent Context, plus a monthly allowance of AI credits. Sanity's pricing page lists 1,000 AI credits a month on Free and Growth and 5,000 on Enterprise. Extra credits cost $0.05 each as of October 2026. Per Sanity's AI credits guide, a Content Agent message costs 4 credits, a Content Agent tool action costs 2, and an Agent Action request costs 1, and organisations can set a monthly spending cap. The AI Assist plugin is the exception and needs Growth or above.

Can AI agents publish directly to a live Sanity site?

Content Agent cannot publish at all. It proposes drafts or adds changes to a content release for a person to approve. An agent working through the Sanity MCP server, or code that calls Agent Actions and the Sanity client, can publish if the token or signed-in user holds publish rights. The practical rule is to give agents a role that stops at drafts or content releases and keep publishing with a person.

Which AI tools connect to the Sanity MCP server?

The hosted server at mcp.sanity.io lists Claude Code, Cursor, VS Code, Lovable, Replit, v0, and OpenCode as supported clients. It uses OAuth by default, with token authentication as an option. Since June 2026 it can also deploy a Studio from inside those tools, so a project can go from first prompt to a hosted Studio without the CLI.

Do I need an llms.txt file for a Sanity site?

No. Google says no special files or markup are required to appear in AI Overviews or AI Mode, and the one controlled test of serving Markdown to AI bots found no statistically significant change. If your team wants one, it is cheap to generate from the content model and worth treating as a low-priority extra. A GEO audit will tell you whether the model and the templates are the bigger gap.

Can Sanity AI translate content and keep the structure?

Yes. The Translate action in Agent Actions localises a document while keeping its fields and references intact, and AI Assist offers translation inside the Studio. The loveholidays example Sanity publishes, with 50,000+ hotel listings run by two content specialists, is the scale case for this.

Can Sanity AI generate images?

Yes. The Generate and Transform actions can target an image field, and the AI Assist plugin can be configured with image prompt fields, per Sanity's image generation guide. Each request uses AI credits, and the API returns success before the image finishes rendering, so the asset appears a moment later.

Mihajlo Ivanovic

SEO and Content Manager at Flow Ninja, writing on technical SEO for Webflow, programmatic SEO, and how to earn citations in AI search.

More about 
Mihajlo Ivanovic

Get for free
Foresight
Used on 5000+ websites

See your website the way a senior strategist does

Foresight scans your site across 10 strategy dimensions. You get a scored breakdown of every gap costing you leads.

Invalid website URL
Scan my website

Free. No sign-up. Results in 2 minutes.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Clear roadmap for each category

69

Overall score
26
 issues found
Positioning
53
Differentiation
61
Target Audience
86
Website Structure
72
Social Proof
37
Conversion & Growth
60

Continue reading

All posts
Two men working on laptops at a shared desk with plants and computer monitors near a window.
Two people sitting and discussing indoors with a laptop on a glass table.
Two men working on laptops at a desk in a bright office with plants and large windows.
Close-up of a laptop keyboard and trackpad illuminated with purple and blue lighting.
Two people working on laptops having a discussion in a modern office setting.

 Ready to escape your CMS nightmare

100+ successful migrations. 0 ranking disasters at launch. One embedded team that's done this before.

Free strategy call

Get your free resource

Enjoy your free resource!
❤️