Skip to main content
Website Embed

CSP Allowlist

Content Security Policy hosts and copy-paste samples for embedding the ept AI chat widget.

CSP Allowlist

The widget loads assets from the ept CDN, connects to the chat API and WebSocket, and uses Google Fonts for typography. Apply a CSP that allows those hosts.

For pinned loader SRI and token hardening, see Enterprise Embed Control and Security & tokens.

Sample policy​

Content-Security-Policy:
default-src 'self';
script-src 'self' https://assets.ept.ai 'unsafe-inline';
style-src 'self' https://assets.ept.ai https://fonts.googleapis.com 'unsafe-inline';
font-src 'self' https://assets.ept.ai https://fonts.gstatic.com data:;
img-src 'self' https://assets.ept.ai https: data:;
connect-src 'self' https://assets.ept.ai https://chat.ept.ai wss://ws.api.ept.ai;
frame-src 'none';
object-src 'none';
base-uri 'self';

As a single meta tag (for local testing):

<meta
http-equiv="Content-Security-Policy"
content="default-src 'self'; script-src 'self' https://assets.ept.ai 'unsafe-inline'; style-src 'self' https://assets.ept.ai https://fonts.googleapis.com 'unsafe-inline'; font-src 'self' https://assets.ept.ai https://fonts.gstatic.com data:; img-src 'self' https://assets.ept.ai https: data:; connect-src 'self' https://assets.ept.ai https://chat.ept.ai wss://ws.api.ept.ai; frame-src 'none'; object-src 'none'; base-uri 'self';"
/>

What each host is for​

DirectiveHost / valuePurpose
script-srchttps://assets.ept.aiLoader and widget JavaScript
style-srchttps://assets.ept.aiWidget CSS (including bundled KaTeX styles)
style-srchttps://fonts.googleapis.comMontserrat CSS @import
font-srchttps://assets.ept.aiBundled KaTeX fonts
font-srchttps://fonts.gstatic.comGoogle Fonts files
connect-srchttps://assets.ept.aiVersion/track manifests
connect-srchttps://chat.ept.aiAccess-token HTTP API
connect-srcwss://ws.api.ept.aiChat WebSocket
connect-src'self'Your /api/ept-token (or equivalent)
img-srchttps: / data:CDN images plus customer botImage / userImage / headerIcon URLs

Why 'unsafe-inline'​

  • style-src: the widget uses inline style attributes in its markup.
  • script-src: an image headerIcon uses an inline onerror fallback. Prefer an emoji or text headerIcon if you must remove 'unsafe-inline' from script-src.

File upload​

If you enable enableFileUpload, add the HTTPS hosts used for your presigned upload URLs to connect-src (and img-src if previews load from those hosts).

Verify​

  1. Deploy the policy on a staging host.
  2. Open the page with DevTools → Console; confirm no CSP violations for assets.ept.ai, chat.ept.ai, or wss://ws.api.ept.ai.
  3. Send a test message and confirm the WebSocket connects.