{"ok":true,"result":{"slug":"csp-header-generator","name":"CSP Header Generator","summary":"Build a Content-Security-Policy from directive lines (as header, meta tag, Nginx and Apache config) with a security analysis, or analyse an existing policy for risky settings.","description":"Build a Content-Security-Policy header from presets and directives, with nonces and hashes, then copy it for Nginx, Apache or a meta tag, or analyse a policy.","method":"POST","endpoint":"/api/v1/tools/csp-header-generator","plan":"free","mcpName":"csp_header_generator","input":{"type":"object","additionalProperties":false,"properties":{"mode":{"type":"string","description":"build: assemble a policy from `directives`. analyse: break down and grade an existing `policy`.","default":"build","enum":["build","analyse"],"maxLength":200000},"directives":{"type":"string","description":"build mode: one directive per line, name then space-separated sources, e.g. \"script-src 'self' https://cdn.example.com\". Supported: default-src, script-src, style-src, img-src, connect-src, font-src, frame-src, media-src, worker-src, manifest-src, object-src, base-uri, form-action, frame-ancestors. Keywords need their quotes ('self', 'none', 'unsafe-inline', 'nonce-…', 'sha256-…').","maxLength":20000},"upgradeInsecureRequests":{"type":"boolean","description":"build mode: add upgrade-insecure-requests.","default":false},"reportUri":{"type":"string","description":"build mode: report-uri value, an https:// URL or a path starting with /.","maxLength":2048},"reportTo":{"type":"string","description":"build mode: report-to endpoint name defined in a Reporting-Endpoints header.","maxLength":100},"reportOnly":{"type":"boolean","description":"build mode: output Content-Security-Policy-Report-Only instead of an enforcing policy.","default":false},"policy":{"type":"string","description":"analyse mode: the policy, with or without a 'Content-Security-Policy:' prefix, or a <meta> tag.","maxLength":20000}}},"example":{"mode":"build","directives":"default-src 'self'\nscript-src 'self' https://cdn.example.com\nobject-src 'none'\nframe-ancestors 'none'","upgradeInsecureRequests":true},"randomOutput":false,"network":false,"docs":"https://pithlab.com/developers/tools/csp-header-generator","page":"https://pithlab.com/tools/csp-header-generator"}}