CSP Header Generator

Assemble a Content-Security-Policy from sensible defaults, with a strict preset and a report-only mode.

How it works

  • Directives left blank are omitted, and default-src is always emitted first so the policy is valid.
  • A strict preset locks everything to 'self'; a permissive preset allows common CDNs so you can tighten it from there.
  • Use report-only mode to test a policy in production without blocking anything.