Skip to content

Install

Allow MivoChat through a Content Security Policy

If your site sends a Content-Security-Policy header, a few directives must be added before the launcher can load, style itself and open the chat.

Allow the MivoChat origin in script-src, frame-src and connect-src, and allow inline styles with style-src 'unsafe-inline'. If you set a custom launcher image, also allow the host that serves it in img-src.

Prefer to let your AI coding agent do it? Copy the agent prompt.

Installation steps

  1. 1

    Prepare

    Find the origin in the src of your script tag; production installs use https://mivochat.app.

  2. 2

    Configure

    Add that origin to script-src, frame-src and connect-src, keeping every source those directives already list.

    script-src https://mivochat.app;
    frame-src https://mivochat.app;
    connect-src https://mivochat.app;
    style-src 'unsafe-inline';
  3. 3

    Publish

    Add 'unsafe-inline' to style-src, or accept that the launcher can render unstyled; the loader writes its styles inline inside a shadow root.

  4. 4

    Verify

    Reload with DevTools open, read the Console for blocked URIs that name the MivoChat origin, and send a test message.

The directives to add

The loader needs four things from your policy. The script-src directive lets the browser run widget.js. The frame-src directive lets the chat panel open as an iframe served by MivoChat. The connect-src directive lets the loader fetch its site configuration, and style-src lets it apply its own styles.

Replace the origin with the one in your script tag if you load the widget from anywhere other than production. A preview or local environment serves widget.js from its own origin, so the policy has to name that origin instead.

script-src https://mivochat.app;
frame-src https://mivochat.app;
connect-src https://mivochat.app;
style-src 'unsafe-inline';

Why style-src needs unsafe-inline

The loader builds its launcher inside a closed shadow root and writes a style element into it as markup. Browsers treat that as an inline style, so a policy with default-src 'self' and no style-src exception blocks it and the launcher appears without styling. A nonce cannot help, because the style element lives inside the shadow root and your page has no way to reach it.

We have not tested every browser and policy combination. If you cannot allow inline styles site-wide, scope the exception to the pages that show chat, or link visitors to a separate support page.

Images and the chat panel

The default launcher icons are drawn inline and need no image source. If you upload a custom launcher image in Widget settings, add the host that serves it to img-src.

The chat panel is a separate document served by MivoChat under its own policy. Your script-src and style-src do not apply inside it; on your page only frame-src decides whether it can open.

Roll it out safely

Start with the report-only header so violations are logged without breaking the page, then switch to the enforcing header once the console is clean. Look for reports whose blocked URI names the MivoChat origin.

Content-Security-Policy-Report-Only: script-src 'self' https://mivochat.app; frame-src https://mivochat.app; connect-src 'self' https://mivochat.app; style-src 'self' 'unsafe-inline'

Before you change the setup

Who this is for
an engineer who owns the security headers of a marketing or docs site and must keep a strict policy
What you need
the current policy string, the origin in your script tag, and a way to deploy a header change
Where it goes
the Content-Security-Policy response header, or a meta tag, set by the host, framework or CDN in front of the site
Watch out for
a header set at two layers, such as the framework and the CDN, is merged by the browser, so every layer must allow the origin

Test the support boundary

  • Does the launcher open with default-src 'self' still in place?
  • Does a custom launcher image load once img-src names its host?
  • Does a report-only policy show zero MivoChat violations before you enforce it?

Frequently asked questions

The launcher shows but looks unstyled

Your policy blocks inline styles. Add 'unsafe-inline' to style-src for the pages that show chat, then reload.

The console says it refused to frame the chat

Add the MivoChat origin to frame-src. If the policy relies on default-src, add the origin there or declare a frame-src directive.

widget.js loads but the launcher never appears

Check connect-src. The loader fetches its configuration from the MivoChat origin, and a missing entry blocks that request.

The custom launcher image is missing

Add the host that serves the image to img-src. The default icons are inline and need no image source.

Keep exploring

The r3-final-a evaluation measured 95% answerability-tier accuracy on 224 questions; this is an evaluation result, not a guarantee. AI replies use Anthropic. See the method and results and subprocessors and data locations.

Try MivoChat on your support pages.

Start a 14-day trial, connect public pages, and test what gets answered or handed to your team. Check current paid billing status on pricing.