The short answer
Let AI draft pages from your library, and have a person publish them. Connect it through the Sanity MCP, limit its access at the permission level, give it written instructions, check its work with your own validation step, and review every page on a staging link. Prompts alone are not a guardrail. Permissions and structure are.
For the case for this approach, read AI page builder for your team. For the content model it depends on, read Structuring Sanity content for AI. This chapter is about how to set the limits.
What the finished setup looks like
A section library in Sanity, AI connected to it through the Sanity MCP, and marketing skills written for it. The team sends the content. The AI picks the right sections from the library, builds the page and shares a staging link. If the team likes it, it goes live. If something needs to change, they say what, and it gets changed.
The rest of this chapter is general advice for setting up your own. It is not a description of any client's settings.
What the MCP gives an AI
The Sanity MCP server is hosted by Sanity at mcp.sanity.io. It lets AI tools work with your project through the Model Context Protocol. Its tools change over time, so check the current docs. When we read them, they fell into these groups:
| Area | Sample tools | Risk |
|---|---|---|
| Read | query_documents, get_schema | Low on public content, higher if your dataset holds private data |
| Draft | create_documents, patch_documents | Medium. Patches go to the draft or release version, not to published content. Watch types with liveEdit on: the docs say create can make published documents for those |
| Publish | publish_documents, unpublish_documents | High. Changes the live site at the next build |
| Schema | deploy_schema, schema_fields_patch | High. Changes the library itself |
The takeaway: the server can do far more than draft. If you connect it with broad access and only ask the AI nicely to stay in drafts, the AI still has a publish button.
What the AI may and may not change
Write this table for your own team, and agree it before connecting anything. Here is a starting point.
| Thing | AI | Person |
|---|---|---|
| Choose sections from the library | Yes, within recipes | Reviews |
| Choose variants from fixed lists | Yes | Reviews |
| Fill in text fields, from the brief | Yes | Reviews every word |
| Select existing images | Yes, if they fit | Reviews |
| Point to existing facts by reference | Yes | Checks the right one was used |
| Create or edit prices, clients, quotes, stats | No | Yes, in their own documents |
| Change a published page in place | Draft only | Reviews the change, then publishes |
| Publish or unpublish | No | Yes |
| Change schemas, add sections | No | Developer, through Git |
| Change redirects, tracking, code | No | Developer |
Decision rule If a wrong value would be a false claim about your company, the AI may only point to it, never type it. If a mistake would reach visitors with no person seeing it first, the AI may not do it.
Enforce the limits with access
Now make the table real. The MCP docs say OAuth is the default, and that with an API token, tool calls are limited to that token's role and permissions. They also say a personal token shares your own role. So if an administrator connects the AI under their own account, assume the AI has the same reach.
- Use a dedicated token for the AI, so you can remove its access without touching anyone else's.
- Pick the narrowest role that can write drafts. Sanity's Contributor role can write but not publish, on the plans that include it. Sanity's token docs describe tokens holding role memberships, so check in the management console which role yours holds.
- Test it. Ask the AI to publish a test draft, on a test dataset first, and confirm it is refused. Do the same for a schema change. Do not assume, try it.
- Use a separate dataset for your pilot, if your plan allows, so early mistakes cannot touch live content.
- Check your AI client. Some let you approve or switch off single tools. Use that as a second layer, not the only one.
- Use one token per application, as Sanity's docs advise, and set an expiry.
Write the skills
"Skills" here means written instructions the AI reads before it works. Yours should be short enough to read in one sitting, and specific enough to act on. Include:
- Library guide. Each section: its job, when to use it, when not to. Copy this from your usage notes.
- Recipes. The allowed orders from chapter 2, by page type.
- Voice. Your tone, your banned words, and examples of good copy from your own site.
- Fact rules. Use references for facts. Use only what is in the brief. If something is missing, leave a note instead of guessing.
- Process. Read the schema first, save as a draft, run the checks, then send the staging link with a list of open questions.
Then test with bad briefs as well as good ones. Give it a brief with no proof points and see if it invents some. Give it a brief asking for a section you do not have and see what it does. It should ask, or flag it.
Do not rely on Studio validation
This is the one surprise that catches people. Sanity's validation docs say schema rules only run in the Studio, so API writes are not checked. The MCP docs say create and patch use looser validation, that publishing runs stricter checks, and that custom validation rules are skipped through MCP.
So your length limits and custom rules may not stop an AI draft. Add your own check before anyone reviews the page. Sanity's CLI has sanity documents validate, which checks a dataset's documents against your Studio schema. A small script can check the rest, such as approved recipes, and whether references resolve. Then render the page: your Astro build fails on unknown types, and a staging build shows the page as a visitor would see it.
Review before publish
Every page gets a person's review on a staging link, marked noindex. See staging if the idea is new. The reviewer checks:
- Every claim is true, and every number has a source.
- Names, prices and quotes come from references, not typed text.
- Sections follow a recipe, and the order makes sense for this reader.
- The copy sounds like you, and it says something specific.
- The page works on a phone, with the longest headings.
- Title, description, slug, headings and alt text are all set.
- Links and forms work, and any tracking fires.
- The page does not compete with one you already have.
Done when The AI has been refused a publish in a test, a bad brief produced a question and not an invention, and a named person has reviewed and published one real page.


