Engineering

How to turn off the AI features in RichTextEditor

Hiding the Ask AI button is not enough. Every way AI can be reached in the editor, the configuration that closes them all, and how to ship without the AI code.

4 min read

Some teams need an editor with no AI in it: a policy forbids it, a customer contract excludes it, or the feature simply is not wanted. Hiding the Ask AI toolbar button is not enough on its own, because the button is only one of the ways in. This page lists every way in, and the configuration that closes all of them.

What the editor does by default

The AI features live in one plugin, the AI Toolkit (aitoolkit.js), which is bundled inside all_plugins.js. The editor does not contact an AI service by itself. A request only leaves the browser if you set aiToolkitResolver to a function that calls your own endpoint or provider. With no resolver the plugin runs in a demo mode that answers locally, with no network call and no API key.

So if you never configured a resolver, no document text has been sent anywhere. The buttons are still there.

Where AI can be reached

Turn AI off with configuration

This keeps your current script tags and removes every AI entry point a user can reach.

Code example
var config = {
  toolbar: "default",
  aiToolkitEnabled: false,             // the plugin skips its own setup
  aiToolkitAutoToolbarButtons: false,  // and must not add its button to a toolbar
  aiContextMenu: false                 // right-click shows the browser's menu again
};

// The stock "default" and "full" toolbars name the AI command. Take it out.
["toolbar_default", "toolbar_full"].forEach(function (name) {
  config[name] = RTE_DefaultConfig[name]
    .replace(/[#|]?\{aiassist\}/g, "")
    .replace(/,?aiassist/g, "");
});

var editor = new RichTextEditor("#editor", config);

All four parts matter. In version 2.6.19, aiToolkitEnabled: false on its own leaves the Ask AI button in the default and full toolbars and leaves the right-click menu active, because those toolbars name the command themselves. Use the whole snippet.

If you already pass your own toolbar string, you do not need the loop. Check that your string does not contain aiassist, and keep the three settings.

To apply this to every editor on a site, put the same values in the RTE_DefaultConfig block at the top of rte.js instead of repeating them in each page.

Remove the AI code altogether

With the configuration above, editor.aiToolkit still exists, because the plugin file is still loaded. If your policy is that the AI code must not ship at all, stop loading it:

After that, editor.aiToolkit is undefined and there is no AI code on the page.

How to check the result

  1. Load the page. The toolbar has no Ask AI button.
  2. Select a sentence and right-click it. You get the browser’s own menu, not a list of AI actions.
  3. In the browser console, run typeof editor.aiToolkit. It prints "undefined" if you removed the plugin file, and "object" if you only changed the configuration.
  4. Open the Network tab and edit for a minute. No request goes to an AI provider. None did before either, unless you had set a resolver.

Dictation is separate

Speech-to-text is a different plugin and is off by default. It only appears if you set dictationEnabled: true. Leave it off if audio must not leave the device: in some browsers, including Chrome, speech recognition runs on the browser vendor’s servers.

Every AI setting is described in the AI Toolkit reference and the configuration reference. If you do use AI later, see streaming AI through your own server for keeping provider keys out of the browser.


RichTextEditor is a perpetual-licence JavaScript editor — one purchase, self-hosted, no metered editor loads. Download the evaluation or see how it compares.