{"uid":"cap_3wHfc6xqlf0USVWfDjdzm","slug":"dev-reference-csp-header-explainer-81daf970","name":"Dev Reference – CSP Header Explainer","description":"Parse a Content-Security-Policy header value, explain each directive and flag risky settings like unsafe-inline.","url":"https://dev-reference.x402tookit.com/csp-explain?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["value"],"properties":{"value":{"type":"string","description":"The header value, for example default-src 'self'; script-src 'self' 'unsafe-inline'"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"asOf":{"type":["null","string"]},"flags":{"type":["array","null"],"items":{"type":"object","properties":{"fix":{"type":["null","string"]},"message":{"type":["null","string"]},"severity":{"type":["null","string"]},"directive":{"type":["null","string"]}}}},"source":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"summary":{"type":["null","string"]},"verdict":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"lowCount":{"type":["null","number"]},"highCount":{"type":["null","number"]},"infoCount":{"type":["null","number"]},"directives":{"type":["array","null"],"items":{"type":"object","properties":{"policy":{"type":["null","number"]},"meaning":{"type":["null","string"]},"sources":{"type":["null","string"]},"directive":{"type":["null","string"]}}}},"disclaimer":{"type":["null","string"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"mediumCount":{"type":["null","number"]},"policyCount":{"type":["null","number"]},"directiveCount":{"type":["null","number"]}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_Fd2DZjr1cV5uKMa-7hc4B","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Parses a Content-Security-Policy header value, explains each directive in plain English, and flags risky settings like unsafe-inline with severity levels and fix suggestions.","exampleAgentPrompt":"Can you parse and explain this Content-Security-Policy header for me and flag any risky settings: \"default-src 'self'; script-src 'self' 'unsafe-inline'; img-src *\"?","exampleUseCases":[{"title":"Auditing a new site's CSP before launch","prompt":"Before we go live, can you analyze this Content-Security-Policy header and tell me if anything is dangerously permissive: \"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; connect-src *\"?"},{"title":"Understanding a third-party app's security policy","prompt":"I copied this CSP header from the app we're integrating with — can you explain what each directive does and highlight anything that looks risky: \"default-src 'none'; script-src cdn.example.com 'nonce-abc123'; style-src 'self' 'unsafe-inline'\"?"},{"title":"Debugging a broken CSP blocking resources","prompt":"Our site's Content-Security-Policy seems to be blocking some resources. Can you break down this header and explain what each part allows or restricts: \"default-src 'self'; img-src 'self' data:; font-src fonts.gstatic.com; report-uri /csp-report\"?"}],"resultDescription":"Returns a structured analysis including: a plain-English summary and overall verdict, a list of parsed directives each with its meaning and allowed sources, an array of risk flags with severity (high/medium/low/info), the problematic directive name, a human-readable message, and a suggested fix, plus counts of high/medium/low/info issues, total directive count, and a disclaimer about what was not checked.","failureModes":["Missing or empty 'value' query parameter returns an error","Malformed or non-CSP string may produce partial or degraded results (degraded: true in response)","Extremely long or complex CSP strings may hit processing limits","Unknown or experimental directives may appear in notChecked array"],"whenToPreferThis":"Choose this endpoint when you need a structured, machine-readable breakdown of a CSP header with severity-ranked risk flags and fix suggestions — ideal for automated security audits, developer tooling pipelines, or agent workflows that need to explain CSP policy to non-experts. Prefer it over generic LLM interpretation when you need consistent structured output with directive-level granularity and actionable remediation advice.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-29T13:12:38.303Z","isFirstParty":false,"canonicalSlug":"dev-reference-csp-header-explainer-81daf970"}