Free browser tool
CSP Builder and Evaluator
Quick answer
Build a Content Security Policy by choosing directives and allowed sources, or paste a policy to review common weaknesses. Everything runs locally in your browser. Start in Report-Only mode, test your application, then enforce the policy and check its live response headers. Presets need adaptation to your site.
Build a policy
Choose a starter, edit each directive, then generate a header. No website is fetched and there is no usage quota.
Presets are starting points. The nonce starter requires dynamic rendering and matching script nonces. Static and SPA presets use source allowlists and may block inline framework code. Replace example hosts, test routes and review violations before enforcement.
An enabled empty source list blocks that resource type. Disabled fetch directives may fall back to default-src. base-uri and frame-ancestors do not.
Allowed sources
- 'nonce-REPLACE_WITH_RANDOM_PER_RESPONSE'
- 'strict-dynamic'
Current directive list
- 'self'
- 'nonce-REPLACE_WITH_RANDOM_PER_RESPONSE' 'strict-dynamic'
- 'self'
- 'none'
- 'none'
- 'none'
- 'self'
Configure report-to with a separate Reporting-Endpoints header, or a report-uri endpoint, to collect reports. No endpoint is created by this tool.
Evaluate an existing policy
Frequently asked questions
What does Content Security Policy do?
CSP tells a browser which resources a page may load and restricts certain execution behaviors. A carefully deployed policy helps reduce XSS risk, but does not replace safe rendering, input handling or application testing.
Should I start with Report-Only?
Report-Only monitors violations without enforcing the policy. Use the Content-Security-Policy-Report-Only HTTP header and configure reporting endpoints to receive reports. Browser developer tools also help inspect violations. Report-Only cannot be delivered through a meta tag.
Can I paste the nonce starter into static configuration?
No. Replace nonce placeholders with a fresh unpredictable value for every response and put the matching nonce on intended script elements. The middleware example generates it per request. Next.js nonce rendering requires dynamic rendering and application integration; a fixed config nonce is unsafe.
Does unsafe-inline still work with nonces or hashes?
In a supporting browser, a valid nonce or hash source causes unsafe-inline to be ignored for that source list. Nonces do not cancel unsafe-eval. Browser support and script or style attribute handling still need testing.
What are the CSP meta tag limitations?
frame-ancestors, report-uri and sandbox are not supported in a CSP meta tag. A meta policy applies only after the element is processed, and cannot use Report-Only. Prefer HTTP response headers.
Does a clean evaluation prove the policy is secure?
No. This is a review of one policy string, not a browser, syntax validator or bypass test. It cannot inspect your application, nonce reuse, trusted script behavior or interactions between multiple policies. Test all pages before enforcing changes.
References
Rules and formats checked against these official references on November 16, 2026.
Continue checking
For a website you own or are authorized to check, the free scanner reviews public configuration. Guest limit: 3 scans/day. Registered limit: 10 scans/day.