UserProof

UserProof / Free tools / CSP generator

CSP generator for analytics and replay scripts, for founders who build with a coding agent

Free tool · 11 tools (FullStory has a US and an EU row), each tool's hosts copied from the vendor's own CSP page on November 17, 2026 · 371 YC homepages read the same day · Updated
TL;DRFor founders who build with a coding agent: tick the analytics and session replay tools on your site, paste the Content-Security-Policy you send today, and the generator prints the merged header, a vercel.json block and a line for nginx. Each tool's hosts are copied from the vendor's own CSP page, read on November 17, 2026. UserProof alone needs two sources: https://ingest.getuserproof.com in script-src and connect-src.

A Content Security Policy (CSP) lists the hosts your page may load scripts from and send data to, so an analytics or session replay script stops working until its hosts are on the list. For founders who build with a coding agent such as Claude Code, Codex or Cursor: pick your tools below, copy the header, and hand it to your agent to add to your server or vercel.json.

By Ryan Doyle, founder of UserProof, which records real visits and hands the fix to your coding agent. UserProof is one of the 11 tools listed, so read its row as ours.

Make the header

Tools on your site
Inline snippets (the <script> blocks some tools ask you to paste)

Example result Tools: UserProof, Google Analytics 4 (Google tag), PostHog · inline snippets carry a nonce

Your Content-Security-Policy header

Content-Security-Policy: default-src 'self'; script-src 'self' https://ingest.getuserproof.com https://www.googletagmanager.com 'nonce-RANDOM_PER_RESPONSE' https://*.posthog.com; img-src 'self' https://www.googletagmanager.com https://*.google-analytics.com; connect-src 'self' https://ingest.getuserproof.com https://www.googletagmanager.com https://*.google-analytics.com https://*.google.com https://*.posthog.com; worker-src 'self' blob: data:; frame-ancestors 'none'

Replace RANDOM_PER_RESPONSE with a new random value on every response, and put the same value in nonce="..." on your inline snippet.

What was added, and for which tool

DirectiveSource added
script-srchttps://ingest.getuserproof.com UserProof
https://www.googletagmanager.com Google Analytics 4 (Google tag)
'nonce-RANDOM_PER_RESPONSE' Google Analytics 4 (Google tag)
https://*.posthog.com PostHog
img-srchttps://www.googletagmanager.com Google Analytics 4 (Google tag)
https://*.google-analytics.com Google Analytics 4 (Google tag)
connect-srchttps://ingest.getuserproof.com UserProof
https://www.googletagmanager.com Google Analytics 4 (Google tag)
https://*.google-analytics.com Google Analytics 4 (Google tag)
https://*.google.com Google Analytics 4 (Google tag)
https://*.posthog.com PostHog
worker-srcblob: PostHog
data: PostHog

The same in vercel.json

{
  "headers": [
    {
      "source": "/(.*)",
      "headers": [
        {
          "key": "Content-Security-Policy",
          "value": "default-src 'self'; script-src 'self' https://ingest.getuserproof.com https://www.googletagmanager.com 'nonce-RANDOM_PER_RESPONSE' https://*.posthog.com; img-src 'self' https://www.googletagmanager.com https://*.google-analytics.com; connect-src 'self' https://ingest.getuserproof.com https://www.googletagmanager.com https://*.google-analytics.com https://*.google.com https://*.posthog.com; worker-src 'self' blob: data:; frame-ancestors 'none'"
        }
      ]
    }
  ]
}

The same for nginx

add_header Content-Security-Policy "default-src 'self'; script-src 'self' https://ingest.getuserproof.com https://www.googletagmanager.com 'nonce-RANDOM_PER_RESPONSE' https://*.posthog.com; img-src 'self' https://www.googletagmanager.com https://*.google-analytics.com; connect-src 'self' https://ingest.getuserproof.com https://www.googletagmanager.com https://*.google-analytics.com https://*.google.com https://*.posthog.com; worker-src 'self' blob: data:; frame-ancestors 'none'" always;

Ship it first as Content-Security-Policy-Report-Only, load your pages, and read the console for blocked requests before you enforce it.

How to read the result

The header line is your current policy with every source the ticked tools need added to it. Nothing you already had is removed, except 'none' in a directive that now has to allow a host. The table under it says which tool asked for each new source, so you can drop a tool later without guessing.

When the generator creates a directive your policy didn't have, it starts it with your default-src sources (minus 'none'). That matters: once script-src exists, the browser stops using default-src for scripts, so a new script-src without 'self' would block your own files. If your policy has no default-src at all, a directive you never set allows everything, so the generator leaves it unset and says so. If you already use script-src-elem or style-src-elem, the hosts go there too.

In nonce mode the header holds 'nonce-RANDOM_PER_RESPONSE'. Your server must swap that for a fresh random value on every response and put the same value on each inline snippet (<script nonce="...">). Browsers ignore 'unsafe-inline' in any directive that also holds a nonce or hash, so in nonce mode the generator leaves it out of script-src. Hotjar's 'unsafe-inline' for styles stays, because styles carry no nonce here.

What 371 YC startup homepages send

We read the home page of every company in our YC homepage benchmark on November 17, 2026: 376 sites, of which 371 answered. We fetched each with a Chrome user agent and read the Content-Security-Policy header, or a CSP meta tag in the page.

What the home page sendsSitesShare
An enforced CSP (header or meta tag)9927% of 371
A CSP with a script rule (script-src or default-src)6217% of 371
A CSP with no script rule (only frame-ancestors, upgrade-insecure-requests and the like)37of the 99
A script rule that allows 'unsafe-inline'4369% of 62
A script rule with a nonce, hash or 'strict-dynamic'12of 62
Only a report-only policy, nothing enforced5of 371
The CSP in a meta tag only3of the 99
The Google tag (gtag.js) in the page HTML9425% of 371

Source: UserProof, 371 YC startup homepages from our YC homepage benchmark, read November 17, 2026 (scripts/yc-csp-scan.py, data/yc-csp-2026-11-17.json). The script rule is script-src, else default-src. A page that loads its scripts after the first HTML can carry tags we didn't see.

So about 1 in 6 of these startups controls which scripts its home page runs, and two thirds of those still allow inline scripts. If your policy is like the 37 of the 99 with no script rule, adding analytics needs no CSP change at all, and adding a script rule is the bigger step.

What each tool needs, side by side

Toolscript-srcconnect-srcOther directivesworker-srcInline snippet in the installVendor page
UserProofhttps://ingest.getuserproof.comhttps://ingest.getuserproof.comnone listednone listednoread November 17, 2026
Google Analytics 4 (Google tag)https://www.googletagmanager.comhttps://www.googletagmanager.com https://*.google-analytics.com https://*.google.comimg-src: https://www.googletagmanager.com https://*.google-analytics.comnone listedyespage updated 2026-11-10
PostHoghttps://*.posthog.comhttps://*.posthog.comnone listed'self' blob: data:yes, unless installed from npmno date shown
Sentry (with Session Replay)https://browser.sentry-cdn.com https://js.sentry-cdn.com*.sentry.iochild-src: 'self' blob:'self' blob:nono date shown
Hotjarhttps://*.hotjar.com 'unsafe-inline'https://*.hotjar.com https://*.hotjar.io wss://*.hotjar.comimg-src: https://*.hotjar.com
style-src: https://*.hotjar.com 'unsafe-inline'
font-src: https://*.hotjar.com
none listedyesupdated 2026-10-16
Microsoft Clarityhttps://*.clarity.ms https://c.bing.comhttps://*.clarity.ms https://c.bing.comimg-src: https://*.clarity.ms https://c.bing.comnone listedyespage shows Last updated 2025-08-13
FullStory (US)https://edge.fullstory.com https://rs.fullstory.comhttps://edge.fullstory.com https://rs.fullstory.comimg-src: https://rs.fullstory.comblob:yesupdated 2026-11-13
FullStory (EU)https://edge.eu1.fullstory.com https://rs.eu1.fullstory.comhttps://edge.eu1.fullstory.com https://rs.eu1.fullstory.comimg-src: https://rs.eu1.fullstory.comblob:yesupdated 2026-11-13
LogRocket12 hosts, cdn.logrocket.io to cdn.logr-in.com (all in the generator)13 wildcards, *.logrocket.io to *.logr-in.comchild-src: 'self' blob:'self' blob:yes, unless installed from npmupdated 2026-08-31
Mouseflow*.mouseflow.com*.mouseflow.comimg-src: *.mouseflow.com
font-src: *.mouseflow.com
frame-src: *.mouseflow.com
child-src: *.mouseflow.com
none listedyesJune 13, 2024
Lucky Orangehttps://tools.luckyorange.comhttps://*.luckyorange.com https://pubsub.googleapis.com wss://*.visitors.livenone listedblob:yesupdated 2026-10-20
Smartlookhttps://*.smartlook.com https://*.smartlook.cloudhttps://*.smartlook.com https://*.smartlook.cloudnone listednone listedyesupdated 2025-09-11

Each row copied from the vendor's own page on November 17, 2026; the date in the last column is the date the page shows. Hosts as the vendor writes them (Mouseflow and Sentry write theirs without https://).

ToolWhat the vendor's page adds
UserProofOne external script tag; it sends to the origin it loaded from. No inline snippet, no worker, no styles or fonts. If you set data-api, allow that origin in connect-src instead.
Google Analytics 4 (Google tag)Google's rows for Analytics without Ads features. Google writes script-src-elem; script-src covers script elements too. With Google signals or Ads, Google lists more hosts, one per Google country domain.
PostHogPostHog recommends the wildcard because its subdomains can change. If you send through a reverse proxy, allow your proxy's origin instead. The toolbar needs more (img, style, font, media).
Sentry (with Session Replay)Script and connect hosts are from Sentry's Loader Script page; an SDK bundled from npm needs no script host. connect-src must hold your DSN's origin; Sentry's example is *.sentry.io. The Session Replay page adds worker-src 'self' blob: (compression runs in a worker) and child-src 'self' blob: for Safari 15.4 and older.
HotjarHotjar's recommended set. It lists 'unsafe-inline' for scripts and styles, and a wss: socket.
Microsoft ClarityMicrosoft gives one default-src line (https://*.clarity.ms https://c.bing.com 'unsafe-inline'). We put those hosts in the three directives a tag uses; if Clarity still fails, use Microsoft's line.
FullStory (US)EU organizations use edge.eu1.fullstory.com and rs.eu1.fullstory.com instead (the next row). FullStory says capture continues if the worker is blocked.
FullStory (EU)The same rules for an organization on FullStory's EU data center.
LogRocket12 script hosts and 13 connect hosts. LogRocket warns that worker-src is not supported in Safari before 15.5.
MouseflowMouseflow lists one wildcard, *.mouseflow.com, with no scheme, in six directives.
Lucky OrangeThe heatmap tool also needs https://storage.googleapis.com/lucky-orange-public/heatmaps2/ in script-src; chat, surveys and live visitors may need wss://realtime.luckyorange.com/mqtt.
SmartlookSmartlook says the wildcards are required and advises a nonce or hash for its inline snippet rather than 'unsafe-inline'.
ToolSources to addDirectives touchedInline snippetNeeds blob:
UserProof22nono
Google Analytics 4 (Google tag)63yesno
PostHog53yesyes
Sentry (with Session Replay)74noyes
Hotjar95yesno
Microsoft Clarity63yesno
FullStory (US)64yesyes
LogRocket294yesyes
Mouseflow66yesno
Lucky Orange53yesyes
Smartlook42yesno

LogRocket asks for the most (29 sources in 4 directives); UserProof asks for 2 in 2. 5 of the tools need blob: in worker-src because they run part of the recorder in a worker: PostHog, Sentry, FullStory, LogRocket, Lucky Orange.

Worked example: UserProof, Google Analytics and PostHog on a small SaaS site

The form above opens on this case: a site that sends default-src 'self'; frame-ancestors 'none' and wants UserProof, Google Analytics 4 and PostHog, with the gtag snippet carrying a nonce. The result:

Content-Security-Policy: default-src 'self'; script-src 'self' https://ingest.getuserproof.com https://www.googletagmanager.com 'nonce-RANDOM_PER_RESPONSE' https://*.posthog.com; img-src 'self' https://www.googletagmanager.com https://*.google-analytics.com; connect-src 'self' https://ingest.getuserproof.com https://www.googletagmanager.com https://*.google-analytics.com https://*.google.com https://*.posthog.com; worker-src 'self' blob: data:; frame-ancestors 'none'

Three directives are new (script-src, img-src, connect-src) plus worker-src for PostHog's replay worker, and each starts with 'self' copied from default-src. frame-ancestors 'none' is kept as it was. The same two tools with Hotjar instead of PostHog show the nonce trade-off:

Inline modeHeader for UserProof and Hotjar
Noncedefault-src 'self'; script-src 'self' https://ingest.getuserproof.com https://*.hotjar.com 'nonce-RANDOM_PER_RESPONSE'; style-src 'self' https://*.hotjar.com 'unsafe-inline'; img-src 'self' https://*.hotjar.com; font-src 'self' https://*.hotjar.com; connect-src 'self' https://ingest.getuserproof.com https://*.hotjar.com https://*.hotjar.io wss://*.hotjar.com
'unsafe-inline'default-src 'self'; script-src 'self' https://ingest.getuserproof.com https://*.hotjar.com 'unsafe-inline'; style-src 'self' https://*.hotjar.com 'unsafe-inline'; img-src 'self' https://*.hotjar.com; font-src 'self' https://*.hotjar.com; connect-src 'self' https://ingest.getuserproof.com https://*.hotjar.com https://*.hotjar.io wss://*.hotjar.com

This site, getuserproof.com, sends script-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://datafa.st https://ingest.getuserproof.com: its free tools run inline scripts, so it sits with the 43, not the 12.

What it can't do

Where UserProof fits

UserProof records real visits with one external script tag and hands your coding agent the one fix to make, with the file and line. For a CSP that means two sources and nothing inline: https://ingest.getuserproof.com in script-src and connect-src. Field values are never recorded. Free covers 3 sites and 5,000 recorded visits a month; Pro is $29 a month for 50,000. See pricing, whether session replay slows a site and the masking snippet generator for the other half of a privacy setup.

Sources, read November 17, 2026

Cite this

UserProof, "CSP generator for analytics and session replay scripts," https://getuserproof.com/csp-generator; vendor hosts read from each vendor's CSP page and 371 YC startup homepages read on November 17, 2026.

FAQ

What is a CSP generator?

A tool that writes a Content-Security-Policy header for you. This one starts from your current policy, adds the hosts each analytics or session replay script needs, copied from the vendor's own CSP docs, and prints the header, a vercel.json block and a line for nginx.

Why does my analytics or session replay script break after I add a CSP?

The browser blocks any script, request or worker the policy doesn't list. A recorder needs its script host in script-src and its upload host in connect-src, and several also need blob: in worker-src for compression. The browser console names each blocked URL.

Do I need 'unsafe-inline' for Google Analytics?

No. Google's CSP guide recommends a nonce or hash on the inline gtag snippet and 'unsafe-inline' only when neither is possible. Of the 62 YC homepages we read with a script rule, 43 allowed 'unsafe-inline'.

What does UserProof need in a CSP?

Two sources: https://ingest.getuserproof.com in script-src and in connect-src. It is one external script tag with no inline snippet, no worker and no styles or fonts, so it needs no 'unsafe-inline' and no blob:.

Should I use Content-Security-Policy-Report-Only first?

Yes. Send the new policy as Content-Security-Policy-Report-Only, browse your key pages, fix what the console reports as blocked, then switch the header name to Content-Security-Policy. 5 of the YC homepages we read sent only a report-only policy.

Why does adding script-src block my own scripts?

Once script-src exists, the browser stops falling back to default-src for scripts. If your policy only had default-src 'self', a new script-src must start with 'self' too. The generator copies your default-src sources into every directive it creates for that reason.

Can I put the policy in a meta tag instead?

Mostly. A <meta http-equiv="Content-Security-Policy"> tag works for script-src, connect-src and the rest, but browsers ignore frame-ancestors and reporting in a meta tag. 3 of the 99 YC homepages with a policy used a meta tag only.