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
| Directive | Host / value | Purpose |
|---|---|---|
script-src | https://assets.ept.ai | Loader and widget JavaScript |
style-src | https://assets.ept.ai | Widget CSS (including bundled KaTeX styles) |
style-src | https://fonts.googleapis.com | Montserrat CSS @import |
font-src | https://assets.ept.ai | Bundled KaTeX fonts |
font-src | https://fonts.gstatic.com | Google Fonts files |
connect-src | https://assets.ept.ai | Version/track manifests |
connect-src | https://chat.ept.ai | Access-token HTTP API |
connect-src | wss://ws.api.ept.ai | Chat WebSocket |
connect-src | 'self' | Your /api/ept-token (or equivalent) |
img-src | https: / data: | CDN images plus customer botImage / userImage / headerIcon URLs |
Why 'unsafe-inline'
style-src: the widget uses inlinestyleattributes in its markup.script-src: an imageheaderIconuses an inlineonerrorfallback. Prefer an emoji or textheaderIconif you must remove'unsafe-inline'fromscript-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
- Deploy the policy on a staging host.
- Open the page with DevTools → Console; confirm no CSP violations for
assets.ept.ai,chat.ept.ai, orwss://ws.api.ept.ai. - Send a test message and confirm the WebSocket connects.