Everything *[NYC] 2026: see what we announced. →
Skip to content

Agent Actions

AI building blocks for structured content workflows

Generate, transform, and translate content using large language models. With schema-aware AI-powered responses that integrate with the Content Lake.


Deeply integrated AI

  • Built on structure

    Outputs are automatically validated against the content types in your Sanity Studio schema, so responses from the LLM always fit your schema.

  • Respond with AI

    Trigger content updates using APIs, scripts, or CI pipelines. No Studio or UI needed, although hooks can easily be integrated into the Studio or UI’s.

  • Operates at any scale

    Whether you're automating a single field or running updates across your entire dataset, Agent Actions scale with you.

  • Creative computation

    Instead of coding static rules, use structured prompts and live content values to generate meaningful, schema-valid results.

It’s not just AI automation. It’s programmable creativity

Automation

Make AI a collaborator

Generate, transform, and translate automatically in response to content updates, editorial input, external events or Sanity Functions. Integrate AI into publishing flows without custom integrations or manual steps.

instructing AI agent with prompt

Generate

Create or enrich content with dynamic prompts

Use LLMs to generate schema-valid content with real context. Combine prompt templates with live values from GROQ, document fields, or external sources. Run synchronously or in the background

client.agent.action.generate({
  targetDocument: {
    operation: 'create', _type: 'movie'
  },

  instruction:
    `Write a summary for the movie, $movie.`,
  instructionParams: {
    movie: {
      type: 'constant',
      value: 'Space Jam',
    },
  },
	
  schemaId: 'schemaId'
})

Transform

Reshape content for new use cases

Rework content structure, style, or tone without manual work. Ideal for adapting messaging or standardizing imported data at scale.

client.agent.action.transform({
  instruction: 'Replace "Your CMS" with "Sanity"',
  documentId: 'documentId',
  schemaId: 'default-schema'
})

Translate

Localize content while keeping structure intact

Translate entire documents or specific fields between languages, respecting schema and preserving intent.

client.agent.action.translate({
  fromLanguage:
    { id: 'en-GB',title: 'English' },
  toLanguage:
    { id: 'no-NB', title: 'Norwegian Bokmål' },
  
  styleGuide: 'Preserving formal tone and legal terminology without paraphrasing',
  
  documentId: 'documentId',
  schemaId: 'default-schema'
})

AI translations that follow your terminology

AI translation tools sound fluent but break product names, ignore style rules, and can't tell a reference field from a text field

This guide shows how to fix that: store your glossary, style guide, and do-not-translate rules as structured content, then feed them to the Agent API at translation time

A cursor clicks the 'Translate All' button, activating progress bars for de-DE, en-CA, and es-MX translations.

Developers love Sanity

  • G2 badge: momentum leader, spring 2025
  • G2 badge: spring 2025 users most likely to recommend mid-market
  • G2 badge: grid leader enterprise
  • G2 badge: spring 2025 high performer mid-market
Tecovas
It's incredibly easy to push data into Sanity Content Lake from outbound systems. With the Sanity API, I'm not making 10,000 calls to update 10,000 items. I'm making one API call and the whole dataset is updated.
Kevin Harwood

Kevin Harwood

CTO

Tecovas


Get started with Sanity


Ready to build? Let's make it real.

Sign up for Sanity for free and start crafting your first project.

Get Started