---
title: "CSP Generator: Build a Content Security Policy · camada"
description: "Answer a few questions and get a Content-Security-Policy header, a Report-Only version and a meta tag. Strict by default. It runs in your tab and sends nothing."
url: https://www.camada.app/tools/csp-generator
last_updated: 2026-11-18
---

# Generate a strict Content Security Policy

Say what your site uses and get a policy you can ship. It starts strict, with a nonce or hash, and falls back to a host list if you need one. Everything runs in this tab. Nothing is sent.

[Before you ship](https://www.camada.app/tools/csp-generator#steps) [What it cannot do](https://www.camada.app/tools/csp-generator#limits)

## Before you ship it

A new policy can break a page that worked. Three habits keep that from reaching your visitors.

1. 1

   ### Ship it as Report-Only first

   Send the Report-Only header for a week and watch the browser console. Fix what it flags. Then switch to the real header.
2. 2

   ### Make a new nonce on every response

   The policy shows {NONCE} as a placeholder. Never ship it as written, and never reuse one value. Your server makes a fresh random value for each response and puts it in the header and in every script tag.
3. 3

   ### Use a header when you can

   The meta tag cannot set frame-ancestors, report-uri or sandbox, and it cannot be Report-Only. Use it only when you cannot set response headers, as on some static hosts.

## What it cannot do

The generated policy is a starting point. Read these before you enforce it.

**It does not read your site**

The tool knows only what you tell it. A script it does not know about will break when you enforce the policy. This is why Report-Only comes first.

**Static sites cannot use a nonce**

A nonce must change on every response. If your pages are static files, choose hashes. Hash mode needs the sha256 of each inline script, and the hash changes whenever the script does.

**Strict mode leaves script hosts out**

With strict-dynamic, a browser trusts scripts that a nonced script loads and ignores host lists. So script hosts are not printed in strict mode. Put the nonce on each script tag you write.

**Inline styles stay loose**

Allowing inline styles needs unsafe-inline in style-src. That is weaker than a nonce. Leave the option off if your styles live in files.

## A CSP guards the page, not the door

It protects a visitor's browser. Here is what that covers and what it leaves open.

1

### What a CSP protects

A Content-Security-Policy tells a visitor's browser which scripts it may run and where it may send data. It limits what an injected script can do on your page.

[Check a live policy](https://www.camada.app/tools/security-headers)

2

### What a CSP does not do

A CSP does nothing about clients that call your login or API directly. A script, a stuffing tool or a scraper never loads your page, so it never reads your policy.

[How camada reads login traffic](https://www.camada.app/use-cases/credential-stuffing)

3

### What camada adds

camada works on the server side. An SDK in your app sends one redacted event per request, and camada reviews that traffic every few minutes. A client that attacks your login or API can be blocked on later requests. It does not replace a CSP, and it does not see page scripts in the visitor's browser.

[See how the review works](https://www.camada.app/how-it-works)

## Questions about CSP

More free tools: [all developer tools](https://www.camada.app/tools).

**What is a strict CSP?**

A strict CSP trusts scripts by a nonce or a hash instead of by host name, and adds strict-dynamic so those trusted scripts can load others. It is harder to bypass than a list of allowed hosts, because attackers often find a script on an allowed host that they can abuse.

**Why are there no https: or unsafe-inline fallbacks?**

Some guides add https: and unsafe-inline as a fallback for old browsers. Both are ignored by current browsers when a nonce and strict-dynamic are present, and the CSP analyzer flags a broad https: in script-src. This policy leaves them out so it passes the analyzer clean.

**When should I use the allowlist policy?**

Use it when you cannot add a nonce or hashes, for example when you do not control the HTML. List every script host you use. Expect to revisit the list whenever a vendor changes its hosts.

**Does my policy leave my computer?**

No. The policy is built and checked by a script in this tab, and the page makes no network request. The "Test this policy" link puts the policy in the part of the URL after the #. Browsers never send that part to a server.

**Can I edit a policy I already have?**

Yes. Paste it into the policy box. It accepts a bare policy, a Content-Security-Policy header line, a Report-Only line or a meta tag. The warnings update as you type. Changing an answer above rebuilds the policy and replaces what is in the box.

**What does the Report-Only version do?**

The browser reports what the policy would have blocked and lets everything load. Use it to find breakage before you enforce. To receive reports you need an endpoint and a report-uri directive.

**Which browsers support nonces and strict-dynamic?**

Current Chrome, Edge, Firefox and Safari support both. A browser that does not support strict-dynamic ignores it. Injected inline scripts are still blocked, but scripts loaded by a nonced script are blocked there too.

## Use it from an AI agent

This page is also Markdown at [/tools/csp-generator.md](https://www.camada.app/tools/csp-generator.md). Agents can also run the check itself, without the form.

- `audit_csp` on the MCP server at https://www.camada.app/mcp, and in this tab through WebMCP

  Takes `policy, json_api?`. Audit a Content-Security-Policy: a header value, a full "Content-Security-Policy: ..." line or a <meta> tag. Returns a row per key directive (ok, warn or info) with the reason, the warnings with fixes, any duplicated directives, and the policy as a header, a Report-Only header and a meta tag. Same rules as https://www.camada.app/tools/csp-generator and /tools/security-headers.

The MCP server needs no key. Every agent tool on this site is listed in the [server card](https://www.camada.app/.well-known/mcp/server-card.json) and on [the tools page](https://www.camada.app/tools#agents).

## Related tools

- [CSP & security headers](https://www.camada.app/tools/security-headers)

  Fetch live response headers or paste curl output. Flag unsafe-inline CSP rules, check HSTS and nosniff, and hash inline scripts.
- [Website security check](https://www.camada.app/tools/website-security-check)

  Enter a URL to trace HTTPS redirects, check CSP and OWASP headers, and audit cookie flags. Also checks robots.txt, llms.txt, and security.txt.
- [Login page check](https://www.camada.app/tools/login-page-check)

  Review your login page for HTTPS, form fields, cookie flags, and security headers. Paste two responses to spot account enumeration.

[All free tools](https://www.camada.app/tools)

## Cover the routes a CSP cannot.

Install the SDK on the Free plan to score 100,000 events a month with no card.

[Get started free](https://my.camada.app/) [CSP and header analyzer](https://www.camada.app/tools/security-headers) [See pricing](https://www.camada.app/pricing)

Free needs no card. A 14-day trial of Starter or Growth needs a card. Nothing is charged today. Cancel before the trial ends (the date is shown in the app) and you pay nothing. Otherwise the plan's monthly price starts on day 15.

## Sitemap

[Every page on this site](https://www.camada.app/sitemap.md)
