# Dev Reference – CSP Header Explainer

> Dev Reference – CSP Header Explainer is a paid API for AI agents from dev-reference.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-29).

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.

## Facts

- Endpoint: GET https://dev-reference.x402tookit.com/csp-explain?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/dev-reference-csp-header-explainer-81daf970
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_3wHfc6xqlf0USVWfDjdzm

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability dev-reference-csp-header-explainer-81daf970
```

Example prompt: 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 *"?

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

Parse a Content-Security-Policy header value, explain each directive and flag risky settings like unsafe-inline.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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"
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/dev-reference-csp-header-explainer-81daf970/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from dev-reference.x402tookit.com](https://www.zero.xyz/host/dev-reference.x402tookit.com/llms.txt)
