Content Security Policy Builder
Choose trusted sources for your site, review what each directive controls, and save a defensive policy draft.
- Free
- Works Offline
- No Uploads
How to Draft a Content Security Policy
- Open the HTML, review Security Check, then select Continue.
- Open the sample or a compatible local policy text draft, or start with the default settings.
- Choose rules and add only the intended hosts and source tokens.
- Build Policy and review directive effects and any broad-source notices.
- Select Enforcing HTTP Header, Report-Only HTTP Header, or HTML Meta Policy. Copy or download the displayed text.
Content Security Policy Builder Features
- Start with a restrictive draft or open a supported policy text file.
- Set individual resource sources and review effective directives and broader permissions.
- Copy an enforcing HTTP header, a report-only suggestion, or an HTML meta alternative.
Formats and Compatibility
| Input | Guided source selections or a UTF-8 policy text file up to 16 KiB within the supported profile. |
|---|---|
| Output | Browser-based copy or text download for an enforcing HTTP header, report-only header or HTML meta alternative. |
| Browser | A modern browser with local file support. |
| Scope | A guided defensive profile with eleven directives and HTTP(S) host origins. Runs entirely offline. |
| Operating Systems |
Local Processing Without Uploads
This local CSP generator works offline with no upload. It never contacts the origins you enter.
Select Open Sample to see the workflow with the included example.
HTTP Header and HTML Meta
HTTP headers support embedding restrictions and a separate report-only mode. The HTML meta alternative enforces supported directives and omits frame-ancestors.
Review Effective Directives
Check which resource lists are explicit, which use default-src, and which document actions have no restriction.
Frequently Asked Questions
Can I use the CSP generator offline?
Yes. Extract the Tool ZIP and open ContentSecurityPolicyBuilder.html locally.
Which sites can I use this local CSP generator for?
Use it to draft policies for sites you own or manage.
Where can I use the free CSP generator?
Open the free workbench or save the offline Tool ZIP.
Can I use the CSP generator without uploading files?
Yes. Policy text and approved hostnames stay in your browser.
Can I use the CSP generator in browser mode?
Yes. Open the workbench in a compatible browser, even with the network offline after downloading the tool.
What does the CSP generator download contain?
The Tool ZIP contains the workbench. Download Policy saves the selected policy draft separately.
What makes this a content security policy builder?
It guides you through fetch sources and document controls, validates the supported subset, and describes the resulting effects.
When should I use the CSP header generator?
Use the HTTP header form when your deployment can set response headers. Report-Only monitors on a staging application and needs separate endpoint configuration for collected reports.
What does the HTML meta policy omit?
The meta alternative omits frame-ancestors. It enforces its supported directives from its position in the document head.
Does this tool work offline on Windows, macOS, Linux, and ChromeOS?
Yes. Local Studio tools run offline on Windows, macOS, Linux, and ChromeOS. Download the tool ZIP, extract it, and open the included HTML file in a supported browser. Your files are processed on your device without uploads.
Which browsers can I use with this offline tool?
Use a current version of Google Chrome, Microsoft Edge, Mozilla Firefox, or Safari where that browser is available for your operating system. Chrome is built into ChromeOS, and Safari is available on macOS.