Security / LOCAL TOOL

Content Security Policy Inspector & Builder

Parse, normalize, and review Content Security Policy directives with a local restrictive baseline.

Runs locally — input is never uploaded
Paste a Content-Security-Policy header value
Directives0 selected
ResultReady when you are

WHAT IT DOES

Read the policy as a browser will enforce it.

Paste a Content-Security-Policy header value to normalize its directives and review high-impact gaps such as unsafe script execution, universal script hosts, duplicate directives, unrestricted plugin content, and missing embedding, base URL, or form protections. The builder action loads a deliberately restrictive baseline as editable policy text; it is a starting point to adapt to the resources a real site needs, not a promise that an unmodified header will fit every application.

Why use it?

Use it to make an existing Content-Security-Policy easier to review and identify local-text warnings before testing the policy in your application.

How to use this tool

  1. Paste the header's policy value and inspect it, or load Safe baseline as a starting point.
  2. Review directive-specific warnings and edit allowed sources to match resources the application actually needs.
  3. For example, a missing frame-ancestors directive is not supplied by default-src. Review these independently rather than assuming one restrictive directive protects everything.
  4. Test the policy on a non-production deployment and inspect browser violations before enforcement. The baseline does not discover your resource requirements or certify the site's security.

Details and limitations

  • Duplicate directive names are called out because browsers honor the first occurrence and ignore later attempts to replace it.
  • script-src is read through its default-src fallback before unsafe-inline, unsafe-eval, and wildcard checks are evaluated.
  • frame-ancestors, base-uri, and form-action are checked independently because none of them inherits a missing value from default-src.
  • The copied result is a normalized Content-Security-Policy header assembled only from the directives that were entered or loaded locally.

COMMON QUESTIONS

CSP Inspector questions

Will the safe baseline work unchanged on every site?
No. It intentionally begins restrictive and must be reviewed against the scripts, styles, images, fonts, connections, forms, and embedding behavior the site actually requires. Test a policy in report-only mode before enforcing it on production.
Why are duplicate directives a problem?
A browser uses the first occurrence of a directive and ignores later duplicates. Appending a stricter second script-src therefore does not override an earlier permissive one.
Does the inspector request any source listed by the policy?
No. Hosts, schemes, nonces, and hashes are treated as policy tokens. Nothing in the policy is fetched or executed.