SimplyScan logoSimplyScan
What We ScanPricingFree ToolsBlogCreate AccountLog In
  1. Home
  2. Free Tools
  3. CSP Generator
Free Tool · Runs in your browser

Free CSP Generator (Content Security Policy Builder)

Build a Content-Security-Policy header from scratch · pick directives and sources, and get a copy-ready header with the risky options explained.

100% client-side · nothing you enter is ever sent to a server or stored.

Preview · sign in with a free account to run it

default-src
script-src
style-src
img-src
font-src
connect-src
frame-ancestors
object-src
base-uri
Check this policy in the CSP Evaluator

Send it as an HTTP response header from your server or CDN · a <meta http-equiv> tag works too but can't set frame-ancestors.

Send it as an HTTP response header from your server or CDN · a <meta http-equiv> tag works too but can't set frame-ancestors.

How to use it

  1. Go through the directives (default-src, script-src, style-src, img-src, font-src, connect-src, frame-ancestors, object-src and base-uri) and tick the sources each may use.
  2. Add your own hosts, such as a CDN or API, under More sources.
  3. Choose Content-Security-Policy-Report-Only to test without blocking anything, and optionally add an HTTPS endpoint for violation reports.
  4. Copy the header, and check the policy in the CSP Evaluator before you deploy it.

Example

Input

default-src 'self' · script-src 'self' · img-src 'self' data: · connect-src 'self' https://api.example.com · frame-ancestors 'none' · object-src 'none' · Report-Only on

Result

Content-Security-Policy-Report-Only: default-src 'self'; script-src 'self'; img-src 'self' data:; connect-src 'self' https://api.example.com; frame-ancestors 'none'; object-src 'none'

What the sources mean

'self'
The same origin as the page: scheme, host and port.
'none'
Blocks every source for that directive.
https:
Any HTTPS origin, including sites you don't control. Avoid it in script-src.
data:
Inline data URLs. Fine for images, risky for scripts.
connect-src
Where fetch and WebSocket calls may go. Add your API and your Supabase project URL here.
Report-Only
The browser reports violations without blocking them. Use it first, then switch to the enforcing header.

Go deeper

  • Content Security Policy for Vibe-Coded Apps: A Practical CSP Guide
  • A Security Headers Checklist for AI-Built Apps

Page updated 21 November 2026

Frequently asked questions

What's a good starting CSP?

default-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'none' · then add specific script-src and style-src sources as needed. Start in Content-Security-Policy-Report-Only mode to find breakage before enforcing.

Why avoid unsafe-inline?

Because it re-enables exactly what CSP exists to block: injected inline scripts. If you need inline code, use nonces or hashes instead · 'unsafe-inline' in script-src reduces your CSP to decoration.

What should a Supabase or Firebase app add?

Add your project URL to connect-src (for example https://abcd1234.supabase.co, plus wss:// for realtime), and your storage host to img-src if you show uploaded images.

Want the full picture?

This tool covers one narrow check. A full SimplyScan runs 60 checks across 14 categories · exposed keys, RLS, XSS, auth, and speed · in 30 seconds.

Run a full security scan

Related tools

Hash Generator

Generate MD5, SHA-1, SHA-256, SHA-384 and SHA-512 hashes from any text · instantly and entirely in your browser.

SRI Hash Generator

Generate a Subresource Integrity hash for any script or stylesheet · paste the content or upload the file · so a compromised CDN can't tamper with it.

AES Encrypt / Decrypt

Encrypt text with a password using AES-256-GCM · and decrypt it back. Keys are derived with PBKDF2 and everything stays in your browser.

SimplyScan logoSimplyScan

Security Scanner for Vibe-Coded Apps.

Product

See What We ScanHow It WorksView Pricing

Resources

Security BlogSecurity ChecklistTrust BadgeUptime MonitoringIntegrationsMCP Server (Claude, Cursor & Windsurf)API DocumentationBackend Audit GuideThreat Detection GuideFAQTerms of ServicePrivacy Policy

Platforms

All platforms →Lovable ScannerBolt.new ScannerCursor ScannerReplit Scannerv0.dev ScannerWindsurf ScannerBubble Scanner

Free Tools

All free tools →SSL CheckerSecurity HeadersDNS Security CheckerCORS TesterJWT DebuggerCSP EvaluatorHash GeneratorSEO Checker

Account

Create AccountLog In

© 2026 SimplyScan. All rights reserved.