Content Security Policy Builder

Your workspaceProcessed on your device

Separate sources with spaces. Use 'self', 'none', HTTPS hosts or directive-specific sources such as a script hash. Blank fields are omitted.

Inputs and output stay on this device.

A few things to know.

Creates one header up to 4,096 ASCII characters. Supports common resource, base, frame and form directives, HTTPS hosts, WSS connections, selected data and blob sources, SHA-256/384/512 sources for scripts and styles and optional HTTPS upgrades. Report-only output has no configured reporting endpoint. The builder does not load any listed source.

  1. Review the same-origin starter and select Enforce or Report only. Enter source lists for the resources your page actually uses.
  2. Select Build CSP header. Correct invalid sources and review notices for broad host patterns or omitted restrictions.
  3. Copy or download the HTTP response header. Test it on a staging page and review expected resources and browser violations.