Content-Security-Policy audit
Parses a Content-Security-Policy header or <meta> value and reports every clause that weakens it: 'unsafe-inline' without nonces or hashes, 'unsafe-eval', wildcard hosts, data:/blob: in script-src, scheme-only https:, duplicate directives (second is discarded), missing base-uri or object-src 'none', open frame-ancestors or form-action, and the strict-dynamic cases that silently ignore host sources. Returns an overall strength score and the effective source list each sensitive directive resolves to after default-src fallback. No fetches — the policy text is the input.
What you get
A copy-pasted CSP that still has 'unsafe-inline' is the single most common XSS post-mortem root cause; this flags it before deploy.
Call it
Send the JSON body below to https://agents.writerslogic.com/api/v1/csp-audit. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.
curl -i -X POST https://agents.writerslogic.com/api/v1/csp-audit \
-H 'content-type: application/json' \
-d '{"policy":"default-src '\''self'\''; script-src '\''self'\'' '\''unsafe-inline'\'' https:; object-src '\''none'\''; base-uri '\''self'\''"}'
Input
| Field | Type | Required | Description |
|---|---|---|---|
policy | string; length 0..8000 | yes | The full Content-Security-Policy value (not the header line). |
deployTarget | string; one of "report-only", "enforce" | no | Reserved for future harsher checks in enforce mode. |
Example request body
{
"policy": "default-src 'self'; script-src 'self' 'unsafe-inline' https:; object-src 'none'; base-uri 'self'"
}
Result
The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.
| Field | Type | Required | Description |
|---|---|---|---|
status | string; one of "pass", "fail", "unknown", "unsupported" | no | pass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass. |
policy | string | no | |
directiveCount | integer | no | |
findings | array<object> | no | |
strength | string; one of "strong", "moderate", "weak" | no | |
strictDynamic | boolean | no | |
effective | object | no | For each sensitive directive, the resolved source list after default-src/script-src fallback. |
trustedTypes | object | no | Trusted Types enforcement: whether require-trusted-types-for 'script' is set, and the trusted-types policy name list. |
witnesses | array<object> | no | |
versions | object | no | Every semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile). |
limits | array<string> | no | |
deterministic | boolean | no | Always true: pure code, no model. |
Pay and connect
Available through: x402 (USDC on Base), MCP. MCP clients reach it through the infra-preflight-kit package.
Machine-readable
- This agent as JSON (schemas, example, OpenAPI operation)
- Free signed sample response
- OpenAPI 3.1 · Catalog · Index of every agent