AI in the Editor7 min readβ€’

How to Build a Re-Write-in-Brand-Voice AI Action in Studio

A marketing team ships 400 product descriptions a week, and every third one reads like a different company wrote it.

A marketing team ships 400 product descriptions a week, and every third one reads like a different company wrote it. One editor leans formal, another writes punchy, a contractor pastes raw output from a chatbot that has never seen the brand guidelines. By the time anyone notices, the inconsistent copy is already live, and the "fix" is a manual rewrite pass that nobody has time for. The failure mode is not a lack of AI. It is AI with no memory of how the brand actually sounds.

Sanity, the AI-native content platform, treats this differently. Sanity is the AI Content Operating System, an intelligent backend where brand voice is not a PDF that editors are supposed to remember but a governed, schema-aware input to every generation. A "re-write in brand voice" action lives inside the editor, reads the block you selected, applies your codified voice, and returns a suggestion the editor accepts or rejects, all inside the review loop.

This guide walks through building that action with AI Assist and Agent Actions, from encoding voice as structured content to wiring the transform, governing the output through the Studio, and knowing when to reach for a schema-aware pipeline instead of a chatbot bolt-on.

The real problem: voice is tribal knowledge, not a system input

Most teams treat brand voice as documentation. There is a slide deck, a Notion page, maybe a one-pager taped near someone's desk that says "confident but never arrogant, warm but never cutesy." Editors are expected to internalize it. New hires and contractors are expected to absorb it by osmosis. When a large language model enters the workflow, the model absorbs none of it, because the guidance lives in a document the model was never given.

The consequence is predictable drift. A generic "rewrite this to be more engaging" prompt produces text that is engaging in the abstract and off-brand in the specific. It adds exclamation points a luxury brand would never use, or strips the plainspoken directness a developer-tools company depends on. Editors then spend more time correcting AI output than they saved by generating it, which is the worst possible trade.

The reframe is to stop treating voice as prose guidance and start treating it as structured content. Sanity's distinguishing claim is that AI is wired into the data model, not bolted on with a plugin. That means your voice definition, tone attributes, banned phrases, example rewrites, and audience notes can live as real fields in a schema. Once voice is structured, it becomes an input the model can be grounded in, deterministically, on every single generation. This maps to the first pillar: model your business. Before you automate a rewrite, you model what "on-brand" concretely means, in fields a machine can read.

Illustration for How to Build a Re-Write-in-Brand-Voice AI Action in Studio
Illustration for How to Build a Re-Write-in-Brand-Voice AI Action in Studio

Model the voice: encode tone as structured content, not a prompt string

Start by giving voice a home in your content model. Create a brandVoice document type with fields that a model can actually act on: a short voice statement, an array of tone attributes (each with a name and a do or don't example), a list of banned words and phrases, a reading-level target, and a set of before-and-after rewrite examples that show the transformation you want. This is not busywork. Few-shot examples encoded as structured data are the single highest-leverage input you can give a rewrite action, because they show rather than tell.

Use Portable Text for the example rewrites and any rich guidance. Portable Text preserves structure, annotations, marks, and blocks, so when the content flows into a generation step the model sees headings as headings and emphasis as emphasis, rather than a flattened string that loses meaning during chunking. That structural fidelity is exactly what keeps a rewrite from mangling links, product names, or inline code.

Because this is all just content in the Content Lake, it is versioned, governed by Roles and Permissions, and reviewable like anything else. Your brand and legal teams can edit the voice definition without touching code, and every change is auditable. Contrast that with a prompt string buried in an application repository, where updating the brand voice means a pull request, a deploy, and a developer who may not know that "synergy" was banned last quarter. Structured voice is the difference between a living brand system and a stale prompt nobody dares to touch.

AI Assist: the rewrite the editor actually reaches for

AI Assist is the in-Studio layer where editors invoke LLM help directly on the field they are working in. This is the "AI inside the editor" lens, and it is where a brand-voice rewrite belongs for day-to-day editorial work. An editor selects a paragraph, triggers the rewrite action, and gets a suggestion in place. They can accept it, tweak it, or discard it. The human stays in the loop by design, which is the whole point when the output carries your brand's name.

The key move is grounding the instruction in your brandVoice document rather than a hardcoded prompt. Instead of "make this more engaging," the AI Assist instruction references the structured tone attributes, the banned-phrase list, and the few-shot examples you modeled. Now "rewrite in brand voice" means something specific and consistent for every editor on every field, whether they are a ten-year veteran or a contractor on their first day.

Concretely, AI Assist can rewrite a block in a different voice, translate the page's headings into several locales, summarize a long section into a meta description, or fact-check a claim against a knowledge base. For the brand-voice use case, you scope the instruction tightly: preserve meaning and structure, apply the tone attributes, strip the banned phrases, and match the reading level. Because the action runs against the selected block and returns an editable suggestion, editors trust it. An AI feature editors distrust gets turned off. One that respects their judgment gets used a hundred times a day, and that adoption is what actually moves brand consistency.

Agent Actions: the same rewrite as a schema-aware pipeline primitive

In-editor rewriting solves the one-block-at-a-time case. The harder enterprise problem is the backlog: 4,000 legacy product descriptions written before the brand voice existed, or a nightly import of syndicated copy that arrives off-brand. You do not want an editor manually invoking AI Assist 4,000 times. This is where Agent Actions come in, the "AI as a content pipeline primitive" lens.

Agent Actions are schema-aware APIs for LLM-driven content workflows: generate, transform, translate, and validate. Because they understand your schema, a transform action can target a specific field across a whole dataset, apply your structured brand-voice instruction, and write governed suggestions back into the Content Lake, without flattening your documents into opaque strings. The action knows that description is Portable Text and that productName should never be rewritten, because those facts live in the schema it reads.

Pair Agent Actions with Functions to make the pipeline automatic. A rewrite-on-import Function can run the brand-voice transform whenever new content lands, and an enrich-on-publish hook can flag anything that drifts. The output does not go straight live. It lands as a draft or a Content Release that a human reviews. This is the pillar in action: automate everything, but keep the automation inside a governed loop. The distinction that matters here is that a bolt-on chatbot integration processes text; a schema-aware Agent Action processes your content, with all the type information, references, and validation rules that make the rewrite safe at scale.

Govern the output: staging, review, and audit for AI-touched content

The moment an LLM writes to your production content, governance stops being optional. The question every enterprise buyer asks is not "can it generate?" but "who reviewed what the machine produced, and can I prove it?" A rewrite action that pushes straight to the live site is a liability. One that routes through review is an asset.

Sanity's answer is to treat AI-touched content like any other change that needs oversight. Rewrite suggestions land as drafts. Content Releases let you stage a batch of rewrites, review them together, schedule them, and roll them out as a coordinated change rather than a thousand silent edits. Roles and Permissions control who can approve AI-generated changes versus who can only propose them. Audit logs record what changed and when, so when someone asks why a product page reads differently than it did last month, the answer is a query, not a guess.

This governance layer is also where compliance lives. Sanity is SOC 2 Type II compliant and GDPR aligned, offers regional hosting and data residency, and publishes its sub-processor list, which matters when your rewrite action is sending brand content to a model provider. For regulated teams, being able to say exactly where content is processed and which humans signed off is the difference between shipping an AI workflow and having it blocked in security review. The reframe: the value of an AI rewrite is not just the generation, it is the reviewable, attributable trail around it.

Iterate on quality: measure drift and tune the voice definition

A brand-voice action is not a build-once artifact. Voice evolves, editors find edge cases, and the model's output quality is only as good as the structured guidance behind it. The teams that get durable value treat the brandVoice document as a product they tune, not a config they set and forget.

Build a feedback loop. When an editor rejects or heavily edits a rewrite suggestion, that is a signal. Capture it. Over a few weeks you learn that the model keeps reintroducing a phrase you thought you had banned, or that it flattens a particular sentence rhythm your brand depends on. The fix is not a new prompt engineering session in a codebase. It is adding a banned phrase or a before-and-after example to the structured voice document, where every future rewrite immediately inherits the improvement.

Because the voice definition is structured content, you can also power richer evaluation. The Embeddings Index API and dataset embeddings let you run semantic search across your published copy to find the passages least similar to your on-brand examples, surfacing drift you would never catch by hand. Embeddings are tied to your content, so freshness is automatic; there is no separate vector pipeline to keep in sync. This is the third pillar: power anything. The same structured voice input feeds the in-editor rewrite, the batch pipeline, and the drift-detection search, from one governed source of truth rather than three disconnected tools that each drift from the others.

Brand-voice rewrite: native AI action vs. bolt-on integrations

FeatureSanityContentfulStoryblokStrapi + LangChain.js
In-editor rewriteAI Assist runs on the selected block and returns an editable suggestion the editor accepts or rejects in place.Studio AI / Quick Start AI offers in-app generation and rewriting, though grounding relies on prompt text rather than modeled voice fields.Storyblok AI provides in-editor generation and translation actions triggered from the field toolbar.No native in-editor AI; you build a custom Studio plugin and wire the LLM call yourself via LangChain.js.
Voice as structured contentModel a brandVoice document with tone attributes, banned phrases, and few-shot rewrites as real, governed schema fields.Voice typically lives in prompt configuration or content-type notes rather than a first-class, model-readable schema.Brand guidance is generally supplied via prompt settings, not modeled as reusable structured content.You can model voice in Strapi content types, but reading it into the LLM call is entirely custom code you maintain.
Structure-preserving formatPortable Text keeps marks, annotations, and blocks intact through generation, so links and product names survive the rewrite.Rich Text is JSON-based and structured, though preservation through AI rewrites depends on the integration you build.Richtext is structured, but fidelity through an AI rewrite depends on how the action serializes it.Markdown or blocks rendering; structure preservation through the LLM call is your responsibility to implement and test.
Batch rewrite pipelineAgent Actions apply a schema-aware transform across a whole dataset; Functions automate rewrite-on-import and enrich-on-publish.App Framework plus Content Management API supports batch jobs you build; the AI transform logic is custom application code.Management API and webhooks enable batch pipelines you assemble; AI transforms are not a native primitive.Fully DIY: scripts iterate the API and call LangChain.js chains you build, host, and monitor yourself.
Embeddings for drift detectionEmbeddings Index API and dataset embeddings are tied to content, so semantic drift search stays fresh with no separate vector pipeline.No native content embeddings; teams bolt on an external vector database and sync it themselves.No native embeddings index; semantic search requires an external vector store you maintain.LangChain.js can build a vector index, but you own the embeddings store, the sync, and the freshness problem.
Governance for AI outputDrafts, Content Releases, Roles & Permissions, and Audit logs stage, review, and attribute every AI-generated change.Roles, workflows, and release features exist and can gate AI output once you route it through them.Workflows, releases, and roles can govern AI-generated changes when the integration writes to draft states.Draft and publish states plus a review workflow are largely custom; AI output governance is what you build around it.
Compliance postureSOC 2 Type II, GDPR aligned, regional hosting and data residency, with a published sub-processor list for model providers.Enterprise compliance certifications available; verify AI sub-processor and data-residency terms for your tier.Enterprise-grade compliance offered; confirm AI-specific data handling and residency for your plan.Self-hosted control of data location, but every compliance guarantee for the LLM path is yours to establish.