'unsafe-inline' and no
'unsafe-eval' are required for the guide to load, chat, point, and run
Verified Actions.
This page gives you a baseline policy that covers the core experience, then the
exact additions to make when you enable Verified Actions or voice. Treat the
samples as a starting point and confirm them against your own application’s
directives — most sites already serve a CSP, and the values below are meant to
be merged into it rather than to replace it.
Minimal baseline policy
This is the smallest policy that loads the guide, lets it chat, and lets it point and highlight on your page. Replace{NONCE} with your per-request nonce value
(the same one you put on the boot script). A real header is a single line; it is
wrapped here for readability.
What each origin is for
Test before you ship. The injected stylesheet carries your nonce, so a nonce-basedstyle-srcadmits it without'unsafe-inline'. We do not promise a nonce-onlystyle-srcis sufficient for every setup — your other app directives and any third-party styles still apply — so verify the policy in a staging environment and watch the browser console for CSP violations before rolling it to production.
Add Verified Actions (Turnstile)
Verified Actions protect writes with a Cloudflare Turnstile challenge. Turnstile loads a script and renders its challenge in a frame, so add its origin to two directives:Add voice
Voice is optional per workspace. When it is enabled, the runtime streams the visitor’s speech to the Puntego worker, which transcribes it, and the guide’s spoken replies back, both over WebSockets to your worker origin, so extendconnect-src:
wss://worker.puntego.com is your data-gp-api origin with the wss: scheme.
A CSP host source with https: does not match wss: (CSP3 scheme matching only
upgrades http: to https: and ws: to wss:), so list it explicitly. Without
it the guide still speaks, by requesting each sentence over HTTPS with a slower
start, and listening falls back to other paths; the browser logs a CSP violation
for each refused socket. The player that plays the stream is an AudioWorklet
loaded from a blob: URL, like the microphone capture: a policy that already
lets voice capture run needs nothing more for it.
No browser connects to the speech-recognition provider any more: the worker
holds that connection. An older policy that still lists
wss://stt-rt.soniox.com keeps working; you can remove it.
OpenAI realtime voice no longer needs a CSP entry: the browser sends its
connection offer to the Puntego worker (already in connect-src), which starts
the call with OpenAI, and the audio then flows over WebRTC, which connect-src
does not govern. An older policy that still lists https://api.openai.com keeps
working; you can remove it.
A strict-CSP site must also grant microphone access through a Permissions-Policy
header, or the browser blocks capture before Puntego ever asks:
Complete policy (all features)
With Verified Actions and voice both enabled, the merged policy looks like this:puntego-loader is used by the npm/programmatic loader, puntego-boot by
boot.js, and puntego by runtime HTML and feature-script sinks. A Trusted-Types-enforced
page must allow the names for the integration paths it uses.
Install snippet
Use the standard snippet when you do not serve a nonce-based CSP. Keepcrossorigin="anonymous" in both forms.
Standard
Strict CSP (with nonce)
Pass the same nonce value to bothnonce and data-nonce:
How nonce propagation works
You only set the nonce once. The boot script reads it from eithernonce or
data-nonce, then the runtime reuses that value for everything it adds to the
page:
- The boot script reads your nonce from
nonceordata-nonce. - The runtime stamps the same nonce on every follow-on script it loads (the runtime chunk and, when voice is active, the voice chunk).
- The runtime stamps the same nonce on the single stylesheet it injects for the guide’s shadow root.
script-src and style-src can stay nonce-based with no
'unsafe-inline'.
Sub-apps in iframes
If the guide works inside one of your sub-apps in an iframe (Sub-apps in iframes), the sub-app’s own pages load the child script, and the child reads Puntego’s public keys to check the pass the guide brings for each connection:frame-ancestors with your site’s origin so only your page can
embed it, and keep your page’s frame-src (or child-src) to the sub-app origins
you allowed:
Next steps
- Install Puntego — the full script tag, configuration attributes, and domain allowlist.
- Framework guides — read a per-request nonce from
next/headersand pass it through the@puntego/reactprovider, plus single-page-app routing and a no-code Google Tag Manager template. - Verified Actions — what the Turnstile origins protect and how approved actions are configured.
- Security — how Puntego isolates the guide, redacts PII, and keeps telemetry clean.