# HTTP Security Headers Audit

> HTTP Security Headers Audit is a paid API for AI agents from x402-gateway.blackwoodstate8.workers.dev, paid per call via x402, $0.007/call, status unknown (last checked 2026-10-22).

Audits the HTTP security headers of a public URL, returning a letter grade, score, per-header pass/warn/fail results, and actionable fix advice.

## Facts

- Endpoint: POST https://x402-gateway.blackwoodstate8.workers.dev/v1/http-headers?utm_source=zero.xyz
- Price: $0.007/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-22
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/http-security-headers-audit-4fdfb728
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_iiqYu8rkfzIMXy9fHrE7b

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 http-security-headers-audit-4fdfb728 -d '<json body>'
```

Example prompt: Can you audit the HTTP security headers for https://example.com and tell me what grade it gets, which headers are missing or misconfigured, and what I should fix?

## When to prefer this

Choose this endpoint when you need a fast, structured HTTP security header audit of any public URL — including grading, per-header pass/fail analysis, cookie security flags, and concrete fix advice. Prefer it over manual header inspection tools when you need machine-readable JSON output for automation or reporting. Do NOT use it for TLS/cipher analysis, full vulnerability scanning, or auditing pages that require authentication.

## Known failure modes

- URL is behind a login or authentication wall — audit cannot fetch headers, returns error
- URL is not publicly reachable (private network, localhost) — connection failure
- URL uses a non-HTTP/HTTPS scheme — rejected by input validation
- Malformed or too-short URL fails schema validation (minLength:8)
- Target server times out or is slow — may exceed typical 2500ms response window
- Payment not processed — x402 payment required error before audit runs

## How this service works

Use when you need an http security headers audit of a website or URL, with a grade and what to fix. Do not use for vulnerability scans, TLS cipher analysis or pages behind a login. Returns JSON auditing the HTTP security headers of a public URL (HSTS, CSP, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, cookies) with a grade and fixes for 0.007 USDC per call. Typical response time 2500 ms (p95). Category: Infrastructure.

## Output

Returns a JSON object containing the original URL, final URL after redirects, HTTP status, redirect chain, an overall letter grade (e.g. A, B, C, F) and numeric score, an array of per-header checks each with the header name, raw value, a pass/warn/fail/info result, and fix advice, plus a cookies array showing each cookie's Secure, HttpOnly, and SameSite attributes, and a checkedAt timestamp.

## 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "url"
     ],
     "properties": {
      "url": {
       "type": "string",
       "maxLength": 2048,
       "minLength": 8,
       "description": "Public http(s) URL to audit, e.g. https://example.com"
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "url",
      "finalUrl",
      "status",
      "redirects",
      "grade",
      "score",
      "checks",
      "cookies",
      "checkedAt"
     ],
     "properties": {
      "url": {
       "type": "string"
      },
      "next": {
       "type": "object",
       "required": [
        "service",
        "tool",
        "method",
        "url",
        "useWhen",
        "sample"
       ],
       "properties": {
        "url": {
         "type": "string",
         "description": "Paid route of the next call"
        },
        "tool": {
         "type": "string",
         "description": "MCP tool name of the same call"
        },
        "method": {
         "enum": [
          "GET",
          "POST"
         ],
         "type": "string"
        },
        "sample": {
         "type": "string",
         "description": "Free fixed sample of the whole family"
        },
        "service": {
         "type": "string",
         "description": "Service id of the suggested next paid call"
        },
        "useWhen": {
         "type": "string",
         "description": "When the next call is the right one"
        }
       },
       "description": "Suggested next paid call in the same family (call it in a loop when the task continues)",
       "additionalProperties": false
      },
      "grade": {
       "type": "string"
      },
      "score": {
       "type": "number"
      },
      "checks": {
       "type": "array",
       "items":
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "url": "https://example.com",
  "grade": "F",
  "score": 10,
  "checks": [
   {
    "value": null,
    "advice": "Add Strict-Transport-Security: max-age=31536000; includeSubDomains",
    "header": "strict-transport-security",
    "result": "fail"
   },
   {
    "value": null,
    "advice": "Add a Content-Security-Policy; start with default-src 'self' and tighten from there.",
    "header": "content-security-policy",
    "result": "fail"
   },
   {
    "value": null,
    "advice": "Add X-Frame-Options: DENY (or CSP frame-ancestors 'none') against clickjacking.",
    "header": "x-frame-options",
    "result": "fail"
   },
   {
    "value": null,
    "advice": "Add X-Content-Type-Options: nosniff.",
    "header": "x-content-type-options",
    "result": "fail"
   },
   {
    "value": null,
    "advice": "Add Referrer-Policy: strict-origin-when-cross-origin.",
    "header": "referrer-policy",
    "result": "warn"
   },
   {
    "value": null,
    "advice": "Add a Permissions-Policy that turns off features you do not use (camera, microphone, geolocation).",
    "header": "permissions-policy",
    "result": "warn"
   }
  ],
  "status": 200,
  "cookies": [],
  "finalUrl": "https://example.com/",
  "checkedAt": "2026-10-17T16:49:19.296Z",
  "redirects": 0
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/http-security-headers-audit-4fdfb728/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-gateway.blackwoodstate8.workers.dev](https://www.zero.xyz/host/x402-gateway.blackwoodstate8.workers.dev/llms.txt)
