What is CSP Builder?
CSP Builder is a free online tool that helps you visually construct Content Security Policy (CSP) headers for your website. Toggle individual directives, pick source keywords like 'self' or 'unsafe-inline', add custom domains, and instantly see the generated header string and equivalent meta tag. A built-in security rating and warnings panel highlight potential issues before you deploy.
Common Use Cases
New Web Projects
Start with a strict preset and relax only the directives your application actually needs, following the principle of least privilege.
Migrating Legacy Sites
Gradually build a CSP by enabling one directive at a time, testing in report-only mode, and tightening sources as you remove inline scripts.
Security Audits
Quickly evaluate and adjust an existing CSP header by toggling sources and reviewing the warnings panel for unsafe combinations.
Team Collaboration
Generate a human-readable CSP string and share it with your team, along with the meta tag variant for static HTML deployments.
How to Use This Tool
- Choose a preset (Strict, Moderate, Permissive, or API-only) to pre-fill common configurations
- Enable or disable individual directives using the checkboxes
- Toggle source keywords (self, none, unsafe-inline, unsafe-eval, strict-dynamic) per directive
- Add custom domains in the text input for each directive (comma or space separated)
- Copy the generated HTTP header or meta tag from the output section
Frequently Asked Questions
What is a Content Security Policy?
Should I use the HTTP header or the meta tag?
Why does the tool warn about unsafe-inline?
Is my CSP data sent to any server?
Related Tools
Learn More
- MDN: Content Security Policy Comprehensive MDN reference for CSP
- CSP Specification (W3C) Official W3C Content Security Policy Level 3 specification