CSP Header Builder
NetworkBuild Content-Security-Policy headers with presets and validation
Select the resource types your page actually needs (scripts, styles, images, fonts) and specify allowed sources to build a `Content-Security-Policy` header, starting from a strict preset and loosening individual directives only where something genuinely requires it, rather than the other way around. There's also a validation path: paste an existing CSP header and get flagged issues like a missing `default-src`, use of `unsafe-inline`/`unsafe-eval`, or overly broad wildcard sources that weaken the policy more than intended. It generates the header value or meta tag only. Deploying it to your actual server response headers or HTML is still on you. A strict CSP genuinely can break a site that relies on inline scripts/styles or third-party embeds, so testing in report-only mode (`Content-Security-Policy-Report-Only`) before enforcing is worth doing rather than skipping. Nonce and hash placeholders for inline scripts are supported, though the real nonce/hash values still need to be generated server-side per request.
How to use CSP Header Builder
- 1.Select the resource types you need (scripts, styles, images, fonts) and specify allowed sources to build a `Content-Security-Policy` header.
- 2.Start from a strict preset and loosen individual directives only where your app actually needs external resources.
- 3.Paste an existing CSP header to validate it and catch overly permissive directives like `unsafe-inline` before shipping.
Frequently asked questions
Use via API, SDK, or MCP
cURL# Free: 1,000 req/day · Pro: 10,000 req/day
curl -X POST https://api.utilix.tech/v1/tools/csp-builder \
-H "Authorization: Bearer utx_live_..." \
-H "Content-Type: application/json" \
-d '{"directives":{"default-src":["'self'"],"script-src":["'self'","cdn.example.com"]}}'Get an API key from your dashboard · Full API docs →