senapati
Documentation index

Security Headers

Fetches a page, follows its redirects, and grades the headers of the final response. Each security header gets a check with a pass, warn or fail and a one-line reason; the score starts at 100 and loses a fixed number of points per missing or weak header; the grade is the score mapped to the letters people know from securityheaders.com. Every finding carries the fix.

POST/api/security-headersCosts 1 creditAPI key

Grade the security headers of a page (1 credit)

The scoring scheme

CheckDeductionWhen
Plain HTTP25The final response is not HTTPS (HSTS then does not apply)
Strict-Transport-Security20 / 5Missing or no valid max-age / max-age under six months
Content-Security-Policy25 / 15Missing / report-only
CSP weaknesses10 / 5 / 10 / 5'unsafe-inline' without a nonce or hash / 'unsafe-eval' / no default-src or script-src / wildcard or bare-scheme script source
Framing15 / 10Neither X-Frame-Options nor CSP frame-ancestors / an unsupported X-Frame-Options value
X-Content-Type-Options10Missing or not nosniff
Referrer-Policy10 / 10 / 5Missing / unsafe-url / a leaky value such as no-referrer-when-downgrade
Permissions-Policy10 / 5Missing / only the old Feature-Policy
Information leaks5 eachServer with a version number, X-Powered-By, X-AspNet-Version
Cookies5 / 5A cookie without Secure on HTTPS / a session-like cookie without HttpOnly

Deprecated headers (X-XSS-Protection other than 0, Expect-CT, Public-Key-Pins) and missing Cross-Origin-Opener-Policy / Cross-Origin-Resource-Policy are reported but do not change the score.

Grades

gradescore
A+95 to 100
A85 to 94
B70 to 84
C55 to 69
D40 to 54
E25 to 39
Funder 25

Issue codes

codetypeMeans
SITE_NOT_HTTPSerrorThe final response came over plain HTTP
HSTS_MISSING / HSTS_INVALID / HSTS_DISABLEDerrorNo Strict-Transport-Security, no valid max-age, or max-age=0
CSP_MISSINGerrorNo Content-Security-Policy
CLICKJACKING_UNPROTECTEDerrorNo X-Frame-Options and no frame-ancestors
NOSNIFF_MISSINGerrorNo X-Content-Type-Options: nosniff
FETCH_FAILEDerrorThe page could not be fetched; no grade
HSTS_SHORT_MAX_AGEwarningmax-age under 15552000 seconds
CSP_REPORT_ONLYwarningOnly a report-only policy
CSP_UNSAFE_INLINE / CSP_UNSAFE_EVAL / CSP_NO_DEFAULT_SRC / CSP_WILDCARD_SOURCEwarningThe policy allows what it should block
XFO_INVALID / NOSNIFF_INVALIDwarningA value browsers do not honour
REFERRER_POLICY_MISSING / _UNSAFE / _WEAK / _INVALIDwarningReferrer-Policy absent or leaky
PERMISSIONS_POLICY_MISSING / FEATURE_POLICY_DEPRECATEDwarningNo Permissions-Policy
SERVER_VERSION_DISCLOSED / X_POWERED_BY_DISCLOSED / ASPNET_VERSION_DISCLOSEDwarningHeaders that reveal the stack
PUBLIC_KEY_PINS_DEPRECATEDwarningHPKP is unsupported and dangerous
COOKIE_WITHOUT_SECURE / SESSION_COOKIE_WITHOUT_HTTPONLYwarningCookie flags missing
HSTS_NO_SUBDOMAINSinfoHSTS without includeSubDomains
X_XSS_PROTECTION_DEPRECATED / EXPECT_CT_DEPRECATEDinfoObsolete headers still sent
COOKIE_WITHOUT_SAMESITEinfoCookies without a SameSite attribute

Request

JSON body
FieldTypeDescription
url*stringFull URL to analyze

Authenticate with API key. Send it as the X-API-Key header.

curl -X POST "https://api.senapati.io/api/security-headers" \
  -H "X-API-Key: $SENAPATI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://github.com/"}'

Response

Every success is wrapped in { "data": … } with a request_id; the fields below describe data. See Errors for the failure shape.

response: 200 OKSecurityHeadersData
{
"request_id": "req_82dbb873",
"timestamp": "2026-10-28T07:37:53.236086+00:00",
"data": {
"url": "https://github.com/",
"final_url": "https://github.com/",
"status_code": 200,
"redirect_count": 0,
"fetch_status": "ok",
"error": null,
"grade": "A",
"score": 90,
"checks": [
{
"header": "strict-transport-security",
"present": true,
"value": "max-age=31536000; includeSubdomains; preload",
"status": "pass",
"message": "max-age 31536000s, includeSubDomains, preload"
},
{
"header": "content-security-policy",
"present": true,
"value": "default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com github.githubassets.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net productionresultssa1.blob.core.windows.net productionresultssa2.blob.core.windows.net productionresultssa3.blob.core.windows.net productionresultssa4.blob.core.windows.net productionresultssa5.blob.core.windows.net productionresultssa6.blob.core.windows.net productionresultssa7.blob.core.windows.net productionresultssa8.blob.core.windows.net productionresultssa9.blob.core.windows.net productionresultssa10.blob.core.windows.net productionresultssa11.blob.core.windows.net productionresultssa12.blob.core.windows.net productionresultssa13.blob.core.windows.net productionresultssa14.blob.core.windows.net productionresultssa15.blob.core.windows.net productionresultssa16.blob.core.windows.net productionresultssa17.blob.core.windows.net productionresultssa18.blob.core.windows.net productionresultssa19.blob.core.windows.net productionresultssa30.blob.core.windows.net productionresultssa31.blob.core.windows.net productionresultssa32.blob.core.windows.net github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-staging.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com wss://production-copilot-host.webpubsub.azure.com wss://production-copilot-host-centralus.webpubsub.azure.com wss://production-copilot-host-centralus-02.webpubsub.azure.com wss://production-copilot-host-westus.webpubsub.azure.com api.github.com/cmc_internal/api/ edge.fullstory.com rs.fullstory.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com www.youtube-nocookie.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com user-images.githubusercontent.com private-user-images.githubusercontent.com opengraph.githubassets.com repository-images.githubusercontent.com marketplace-screenshots.githubusercontent.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com explore-feed.github.com *.googleusercontent.com objects-origin.githubusercontent.com *.githubusercontent.com images.ctfassets.net/8aevphvgewt8/; manifest-src 'self'; media-src github.com user-images.githubusercontent.com secured-user-images.githubusercontent.com private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com github.githubassets.com assets.ctfassets.net/8aevphvgewt8/ videos.ctfassets.net/8aevphvgewt8/; script-src github.githubassets.com 'sha256-6AKuI+cDd1MoUL1u4eqrA9PXmnPAkOB4h7421hPUUm0='; style-s",
"status": "pass",
"message": "13 directives"
},
{
"header": "x-frame-options",
"present": true,
"value": "deny",
"status": "pass",
"message": "Framing restricted by CSP frame-ancestors"
},
{
"header": "x-content-type-options",
"present": true,
"value": "nosniff",
"status": "pass",
"message": "nosniff"
},
{
"header": "referrer-policy",
"present": true,
"value": "origin-when-cross-origin, strict-origin-when-cross-origin",
"status": "pass",
"message": "strict-origin-when-cross-origin"
},
{
"header": "permissions-policy",
"present": false,
"value": null,
"status": "fail",
"message": "Not set"
},
{
"header": "cross-origin-opener-policy",
"present": false,
"value": null,
"status": "info",
"message": "Not set; COOP is optional"
},
{
"header": "cross-origin-resource-policy",
"present": false,
"value": null,
"status": "info",
"message": "Not set; CORP is optional"
},
{
"header": "server",
"present": true,
"value": "github.com",
"status": "pass",
"message": "No version disclosed"
},
{
"header": "x-xss-protection",
"present": true,
"value": "0",
"status": "pass",
"message": "Disabled, as recommended"
}
],
"headers": {
"date": "Wed, 28 Oct 2026 07:37:51 GMT",
"content-type": "text/html; charset=utf-8",
"vary": "X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With, X-GitHub-Client-Version, Accept-Language, Sec-Fetch-Site,Accept-Encoding, Accept, X-Requested-With",
"content-language": "en-US",
"etag": "W/\"642a29fce453b2194915188ee734977a\"",
"cache-control": "max-age=0, private, must-revalidate",
"strict-transport-security": "max-age=31536000; includeSubdomains; preload",
"x-frame-options": "deny",
"x-content-type-options": "nosniff",
"x-xss-protection": "0",
"referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
"content-security-policy": "default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com github.githubassets.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net productionresultssa1.blob.core.windows.net productionresultssa2.blob.core.windows.net productionresultssa3.blob.core.windows.net productionresultssa4.blob.core.windows.net productionresultssa5.blob.core.windows.net productionresultssa6.blob.core.windows.net productionresultssa7.blob.core.windows.net productionresultssa8.blob.core.windows.net productionresultssa9.blob.core.windows.net productionresultssa10.blob.core.windows.net productionresultssa11.blob.core.windows.net productionresultssa12.blob.core.windows.net productionresultssa13.blob.core.windows.net productionresultssa14.blob.core.windows.net productionresultssa15.blob.core.windows.net productionresultssa16.blob.core.windows.net productionresultssa17.blob.core.windows.net productionresultssa18.blob.core.windows.net productionresultssa19.blob.core.windows.net productionresultssa30.blob.core.windows.net productionresultssa31.blob.core.windows.net productionresultssa32.blob.core.windows.net github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-staging.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com wss://production-copilot-host.webpubsub.azure.com wss://production-copilot-host-centralus.webpubsub.azure.com wss://production-copilot-host-centralus-02.webpubsub.azure.com wss://production-copilot-host-westus.webpubsub.azure.com api.github.com/cmc_internal/api/ edge.fullstory.com rs.fullstory.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com www.youtube-nocookie.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com user-images.githubusercontent.com private-user-images.githubusercontent.com opengraph.githubassets.com repository-images.githubusercontent.com marketplace-screenshots.githubusercontent.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com explore-feed.github.com *.googleusercontent.com objects-origin.githubusercontent.com *.githubusercontent.com images.ctfassets.net/8aevphvgewt8/; manifest-src 'self'; media-src github.com user-images.githubusercontent.com secured-user-images.githubusercontent.com private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com github.githubassets.com assets.ctfassets.net/8aevphvgewt8/ videos.ctfassets.net/8aevphvgewt8/; script-src github.githubassets.com 'sha256-6AKuI+cDd1MoUL1u4eqrA9PXmnPAkOB4h7421hPUUm0='; style-s",
"server": "github.com",
"accept-ranges": "bytes",
"x-github-request-id": "C83E:2C8978:10C1644:166BF80:6AE1A650",
"x-github-edge-region": "iad",
"transfer-encoding": "chunked"
},
"headers_count": 20,
"cookies": [
{
"name": "_gh_sess",
"secure": true,
"http_only": true,
"same_site": "Lax"
},
{
"name": "_octo",
"secure": true,
"http_only": false,
"same_site": "Lax"
},
{
"name": "logged_in",
"secure": true,
"http_only": true,
"same_site": "Lax"
}
],
"lookup_failed": false,
"issues_found": [
{
"code": "PERMISSIONS_POLICY_MISSING",
"type": "warning",
"message": "No Permissions-Policy: the page and anything it embeds may use the camera, microphone, geolocation and other powerful features."
}
],
"elapsed_ms": 783
}
}

checks has one row per header looked at; headers is everything the server sent (lower-cased, repeats joined) except Set-Cookie, which is parsed into cookies.

data · SecurityHeadersData
FieldTypeDescription
url*string
final_url*string | null
status_code*integer | null
redirect_count*integer
fetch_status*stringok when the final response was read
error*string | null
grade*"A+" | "A" | "B" | "C" | "D" | "E" | "F" | nullFrom the score: A+ 95 and up, A 85, B 70, C 55, D 40, E 25, else F
score*integer | null100 less a fixed deduction for each missing or weak header
checks*HeaderCheck[]
↳ header*string
↳ present*boolean
↳ value*string | null
↳ status*"pass" | "warn" | "fail" | "info" | "n/a"
↳ message*string
headers*dict<string, string>Every response header, lower-cased, except Set-Cookie
headers_count*integer
cookies*CookieInfo[]
↳ name*string
↳ secure*boolean
↳ http_only*boolean
↳ same_site*string | null
lookup_failed*booleanTrue when the page could not be fetched; retry before acting
issues_found*Finding[]
↳ code*stringStable machine-readable code, e.g. CERT_EXPIRED
↳ type*"error" | "warning" | "info"error: clients or browsers reject it; warning: it works but is weaker than it should be; info: a note, not a defect
↳ message*stringWhat was found and why it matters
elapsed_msintegerdefault 0

Errors

  • 401missing or invalid API key / token
  • 402not enough credits on the account
  • 422the request body or a parameter failed validation
  • 429plan rate limit exceeded

Nested objects

data.checks[] · HeaderCheck
FieldTypeDescription
header*string
present*boolean
value*string | null
status*"pass" | "warn" | "fail" | "info" | "n/a"
message*string
data.cookies[] · CookieInfo
FieldTypeDescription
name*string
secure*boolean
http_only*boolean
same_site*string | null
data.issues_found[] · Finding
FieldTypeDescription
code*stringStable machine-readable code, e.g. CERT_EXPIRED
type*"error" | "warning" | "info"error: clients or browsers reject it; warning: it works but is weaker than it should be; info: a note, not a defect
message*stringWhat was found and why it matters

Notes

  • The final response is graded, so http://example.com that redirects to HTTPS is judged on the HTTPS page. final_url and redirect_count say where it landed.
  • 'unsafe-inline' in script-src is not held against a policy that also carries a nonce, a hash or 'strict-dynamic', because browsers ignore it then.
  • Browsers apply the last Referrer-Policy value they recognise, and so does the check.
  • Several Content-Security-Policy headers apply together, so a source is counted as allowed only when every policy that governs scripts allows it, and frame-ancestors in any of them covers framing. For headers that may only be sent once, the first value counts.
  • Up to 100 headers are read and values are cut at 4,000 characters. Only headers are inspected; the body is not read.
  • A report with lookup_failed: true could not fetch the page; retry it before acting on it.