Why it matters
A Content-Security-Policy is the strongest defence against cross-site scripting, but only if it's strict. One 'unsafe-inline', a wildcard host or a CDN that serves old JSONP endpoints can make the whole policy decorative.
This evaluator applies the CSP Level 3 rules, including how each directive falls back to default-src, and flags the patterns security reviewers look for. The URL tester uses the spec's source-matching rules, so you can check a third-party script before it breaks in production. The Security Headers tool writes policies; this one checks them.
How it works
- InputA Content-Security-Policy header
- In your browserEach directive checked against CSP3 rules
- OutputA grade, findings and a URL tester
Where it fits in a designer's workflow
- Plan
- Design
- Build
- Test
- Launch
By the numbers
Show the numbers as a table
| Policy | Grade | Fail | Worth fixing | Pass |
|---|---|---|---|---|
| Sample | D | 2 | 4 | 0 |
| Strict example | A+ | 0 | 0 | 4 |
How to use it
- Paste a Content-Security-Policy header or just its value.
- Read the findings, most serious first.
- Check the effective rule for each resource type.
- Test a URL to see whether it would be allowed.
FAQ
What's a strict CSP?
One that allows scripts only with nonces or hashes (plus 'strict-dynamic'), sets object-src 'none' and base-uri 'none' or 'self'. Host allow-lists alone are often bypassable.
Why is a meta tag CSP flagged?
A CSP in a <meta> tag can't use frame-ancestors, report-uri or sandbox, and only applies to content after the tag. A header is better.
Does it fetch my site?
No. It only reads the policy you paste.
What's the difference from the Security Headers tool?
That tool generates headers. This one evaluates an existing CSP in depth and tests URLs against it.