AI assistant in a CMS — how does it work and what is it for?

An AI assistant in a CMS is a set of features built into the content editor that, at the editor’s request, send a piece of text to a language model and show a proposed change: shorter, corrected, translated or supplemented with metadata. A well-designed assistant works through the application ser…

This post is also available in: Polski

An AI assistant in a CMS is a set of features built into the content editor that, at the editor’s request, send a piece of text to a language model and show a proposed change: shorter, corrected, translated or supplemented with metadata. A well-designed assistant works through the application server, which holds the API key, and every result goes to a preview first, not straight into the document. It is a tool for speeding up routine editorial work – not a publishing autopilot.

TL;DR

  • An AI assistant in a CMS transforms selected text, translates, checks the language, suggests SEO texts and image descriptions – always as a proposal to be reviewed.
  • The browser talks only to your server; the server knows the API key, the prompts and the limits, and only the server connects to the model provider.
  • Content leaves your infrastructure only when someone runs an AI feature – and it goes to the provider you chose yourself.
  • The model provider charges for every paid request, so per-user limits and a spending limit on the provider account are part of the deployment, not an extra.
  • In VEditor, AI features are available in the AI edition, run on your own OpenAI, Anthropic or OpenAI-compatible key, and every result waits in a preview for a human decision.

An assistant in the editor vs a chat in another tab

Many editors already use AI: they copy a paragraph into a chat in the browser, ask for corrections and paste the result back into the CMS. This works, but it has three weak points. First, the organisation does not know what content goes to which services and on which accounts. Second, pasted text loses its formatting or brings foreign HTML with it. Third, there are no shared rules: everyone writes different instructions, and nobody keeps an eye on brand guidelines or the budget.

An assistant built into the editor turns this around. The instructions are defined on the server side, there is one provider chosen deliberately, costs go to the organisation’s account, and the result comes back in the document’s structure – with headings, lists and links – and passes the same HTML checks as the rest of the content. The editor does not switch between windows; they select a passage and choose an action.

What editorial teams use an AI assistant for

The table below lists typical tasks. The last column matters most: it tells you what the model will not check for you.

TaskWhat AI doesWhat a human must check
Improving style and fixing errorssuggests a smoother version of a paragraphwhether the meaning, numbers or proper names have changed
Shortening and simplifyingremoves repetition, shortens sentenceswhether conditions, exceptions or warnings have disappeared
Changing the tonerewrites the text to be more formal or more casualwhether the tone suits the channel and the audience
Translationtranslates a passage or the whole document, keeping its structureindustry terminology, product names, units
Proofreadingpoints out spelling, grammar, punctuation and style errorswhether the comment is right in context
Publishing textssummary, SEO description, title suggestions, slugwhether the promise matches the content, duplicates on the site
Alternative textsuggests an image descriptionthe image’s function in the article, guessed details
Autocompletesuggests the next few wordswhether the suggestion adds facts

Each of these tasks has its own pitfalls. We cover SEO texts in detail in the guide how to generate SEO titles and meta descriptions with AI, image descriptions in the article how to generate image alt text with AI responsibly, and suggestions while typing in AI autocomplete in the editor – benefits and limitations.

Example: shortening a paragraph that contains a warning

An editor selects a paragraph of instructions: “Before cleaning the filter, disconnect the device from the mains and wait at least 10 minutes until the fan has stopped completely. Wash the filter in lukewarm water, without detergents.” and chooses “Make shorter”. The model may return: “Disconnect the device and wash the filter in lukewarm water.” The sentence is shorter and linguistically correct, but it has lost the waiting time and the ban on detergents. This is exactly why the result must go to a preview, and the editor must compare it with the original before clicking “Replace”.

How an AI assistant works under the hood

From an architectural point of view, an AI assistant has three parties: the editor in the browser, an endpoint on your server and the model provider’s API. A secure flow looks like this:

  1. The editor selects text and chooses an action, for example “Simplify”.
  2. The editor sends the action name and the data (the selection, possibly a piece of context) to your endpoint, together with a CSRF token.
  3. The endpoint checks whether the user is logged in and allowed to edit content, whether this feature is permitted for them and whether they have exceeded their limit.
  4. The server builds the instruction for the model from its own templates, adds the API key and sends the request to the provider.
  5. The response comes back to the server, which cleans the returned HTML according to the same rules as ordinary content.
  6. The editor shows the result in a preview; only the editor’s decision changes the document.

Three design decisions in this scheme matter most.

The API key stays on the server. Anything sent to the browser can be read by the user. A key embedded in JavaScript is an invitation for anyone who opens the developer tools to use your account.

Prompts on the server side. If the browser could send any system instruction, every logged-in user could change the model’s behaviour. It is better if the browser sends only an action name from an allowlist, and the user’s own instruction reaches the model as input data, not as an instruction.

Model output as untrusted input. The model may return HTML with tags you do not want in your database – sometimes because an instruction for the model was hidden in the content (prompt injection). The output must go through the sanitizer just like HTML pasted from outside.

Technical details, including ready-made endpoints for popular frameworks, are covered in the guide how to integrate OpenAI with a WYSIWYG editor.

Choosing the provider and the model

An AI assistant is not tied to a single model. The usual choice is between OpenAI and Anthropic, and for data that must not leave the company, teams consider a model running on their own infrastructure through an OpenAI-compatible interface. The decision should be based on tests on your own texts, the data processing terms and the billing model – we discuss the criteria in the article OpenAI or Anthropic for editorial assistance.

Equally important is the question of whose account it is. In the “bring your own key” (BYOK) model, the organisation has a contract directly with the model provider, sees the bill and can revoke the key or switch providers at any time without changing the editor. The pros and limitations of this approach are described in your own AI API key – how to avoid lock-in to the editor vendor.

A human decides: preview, approval, undo

An AI assistant that overwrites the document by itself shifts responsibility for the content to the model – and the model is not responsible for anything. That is why the minimum standard is:

  • the result appears in a preview next to or instead of the selection, clearly separated from the approved content;
  • the editor can choose at least “replace”, “insert alongside”, “try again” and “discard”;
  • applying the result can be undone with a single step in the editor’s history;
  • saving the document and publishing it remain separate decisions in the CMS.

How to design this process in a team, when to separate the author from the approver and why Ctrl+Z is no substitute for versioning are covered in the article AI with human approval – preview, approval and undoing changes.

Costs: who pays and what they depend on

Every model call is a paid request to the provider. The cost depends on the model, the length of the text sent and the length of the response. In practice, the most expensive features are those that send a lot of context (translating a whole document, chatting about a long article) or run frequently without an explicit user decision (autocomplete after every pause in typing).

Cost control has three levels: who has access to which AI features at all, how many requests a single user can send in a given period, and what the hard spending limit on the provider account is. You set the first two in the application and the third in the provider’s dashboard. We show how to estimate a budget using variables in the guide how to control AI request costs in a CMS.

Privacy: when text leaves the server

Ordinary writing in the editor sends nothing outside. Text reaches the model provider only when the editor runs an AI feature – and only to the extent needed for that feature. The exception that needs attention is autocomplete: once enabled, it sends context automatically after a pause in typing, so it is worth enabling it deliberately and telling the team about it.

Before deployment, decide which documents must not be processed by AI (e.g. contracts, customer data), check the data processing terms of the chosen provider’s API plan and describe the transfer to the AI provider in your privacy policy. You will find a list of questions for the provider and data minimisation practices in the article data privacy when using AI in a text editor.

What an AI assistant will not do for your editorial team

  • It will not verify facts. The model generates probable text, not verified text. Numbers, dates, names, quotes and sources always need checking.
  • It does not know your business context until it is given it. Brand guidelines, preferred terms and banned phrases have to be passed in the configuration.
  • It will not replace a specialist in legal, medical or financial content.
  • It will not ensure accessibility or search rankings. It can suggest an image description or a meta description, but judging whether they are appropriate is up to a human.
  • It does not remove the need for sanitization. HTML from the model is just as untrusted as HTML pasted from Word.

Rolling out an AI assistant in six steps

  1. Choose the tasks. Start with two or three features of the highest value (e.g. proofreading and publishing texts) instead of switching everything on.
  2. Choose a provider and set up an organisation account. Set a spending limit and a separate key for the production environment.
  3. Secure the endpoint. Login, permission to edit content, CSRF token, request size limit, per-user limits.
  4. Configure the brand context. Short style guidelines and a glossary of terms sent with every request.
  5. Test on your own texts. Long documents, tables, lists, texts with numbers and proper names, a dropped connection, a limit refusal.
  6. Train editors and update your documents. What may be sent, how to read the preview, where to report errors; an entry in the privacy policy.

How it works in VEditor

VEditor has AI features in the AI edition (the Pro edition works without them). They work through your own endpoint, with your own API key for OpenAI, Anthropic or an OpenAI-compatible service. The key never reaches the browser, and the maker of VEditor takes no part in AI requests or payments – you pay the provider directly, according to its price list.

FeatureWhat it does
AI assistant“Improve writing”, “Fix spelling and grammar”, “Make shorter”, “Make longer”, “Simplify”, “Continue writing”, “Change tone”, “Translate” or your own instruction for the selection or the current paragraph
Document translationthe whole content together with its structure, preview in a dialog, “Replace document”
Publishing textssummary, SEO description, 3 title suggestions and a slug
Alternative text“Describe (AI)” in the image dialog
AI chata conversation in a side panel about the document and the selection; nothing is stored
Proofreadingspelling, grammar, punctuation, style, clarity and consistency; “Apply” and “Skip” for each suggestion
Autocompletea grey suggestion of a few words; Tab accepts, Esc rejects; off by default
Your actionsactions defined by the administrator, with prompts on the server

The editor sends requests to the address given in the ai.url option:

await VEditor.create('#content', {
    ai: { url: '/veditor/ai', csrfToken: token, autocomplete: false },
});

On the server side, the VEditor\AiApi class checks the POST method, the CSRF token, the request size, the licence and the features allowed for the user, and then calls the provider. Prompts live only on the server, the user’s own instruction goes into the model’s input data, and HTML from the response is cleaned on the server and once more by the editor’s schema before the preview. Every result goes to a preview first; a changed selection or paragraph has the buttons “Replace”, “Insert below”, “Try again” and “Discard” (new text at the cursor position – “Insert”, “Try again” and “Discard”), and applying it is a single history step (Ctrl+Z).

The administrator has aiFeatures (features for individual users), aiBeforeRequest (a hook before every paid request, e.g. a daily limit), aiContext (brand guidelines added to every request) and aiActions (custom actions). The documentation explicitly warns that without aiBeforeRequest AI usage has no limit, so it is worth setting it from day one, together with a spending limit on the provider account. The Laravel, Symfony and Yii2 integrations include a ready-made AI endpoint; without a framework, a single PHP file described in the documentation is enough.

AI can make mistakes – check facts, names, numbers and quotes before publishing. Content goes to the provider only when a user runs an AI feature; mention this in your privacy policy.

FAQ

Can an AI assistant publish an article by itself?

It should not. The assistant suggests changes in the editor, while saving and publishing stay in the normal CMS process with a human decision. In VEditor, an AI result always goes to a preview first.

Do I need an account with an AI provider?

Yes. In the bring-your-own-key model, the organisation sets up an account with OpenAI, Anthropic or another provider, generates an API key and puts it in the server configuration. The provider bills you for usage.

Does an AI assistant work with a model running on my own server?

If the editor supports an OpenAI-compatible interface, yes – this is how tools for running models locally are connected, among others. You then need to assess the quality of results and the hardware requirements yourself.

How do we start if the team does not trust AI?

Enable only proofreading and publishing texts at first. These are features where the editor picks individual suggestions and can easily judge whether they are right. Add other features after a few weeks of experience.

What should I do if AI returns incorrect information?

Discard the suggestion or correct it by hand, and do not treat the model’s answer as a source. If the error keeps recurring for a given type of text, add a rule to the brand context or switch the feature off for that group of content.

Try VEditor in practice

The quickest way to evaluate the AI assistant is to look at the result preview and the configuration options. The pages below show the features, the server settings and how to deploy them.

AI in the content editor

How to integrate OpenAI with a WYSIWYG editor?

To integrate OpenAI with a WYSIWYG editor, you need an endpoint on your own server that accepts an action name and text from the editor, checks permissions, adds the API key and sends a cleaned result back to the preview. The OpenAI key never reaches the browser, and you treat the model’s respons…

Clean HTML, accessibility and SEO

How to clean HTML copied from Google Docs

HTML copied from Google Docs contains a style on almost every fragment of text, a <b id="docs-internal-guid-…"> wrapper around the whole thing, and dir, role and aria-level attributes. Cleaning it means removing that wrapper, turning styled span elements into strong and em, keeping headings, list…

HTML security

Why filtering HTML in the browser is not enough

Because the server does not know whether a request came from your editor. Anyone who can save content can also send arbitrary HTML with their own HTTP client, a modified form or another endpoint – and then the JavaScript filter never runs at all. Cleaning in the browser improves convenience and c…

Try it in your browser

The demo has the full toolbar and shows what the PHP sanitizer returns for your content.