Skip to content
Skills Library
Security · Building & coding

security-headers

/security-headers

Set the HTTP response headers that constrain what a browser will execute, embed, and leak on behalf of your origin. Use when hardening a web app against cross-site scripting, clickjacking, or referrer leakage, or when a security scan flags missing headers.

Repository
AI-SKILLS ↗
Licence
MIT
Last repository change
05.09.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 05.09.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Set the HTTP response headers that constrain what a browser will execute, embed, and leak on behalf of your origin. Use when hardening a web app against cross-site scripting, clickjacking, or referrer leakage, or when a security scan flags missing headers.

Original author description

Set the HTTP response headers that constrain what a browser will execute, embed, and leak on behalf of your origin. Use when hardening a web app against cross-site scripting, clickjacking, or referrer leakage, or when a security scan flags missing headers.

How it works

  1. Method
  2. Litmus tests
  3. Boundaries
Original SKILL.md headings · 55 lines, 403 words
SKILL.md preview
---
name: security-headers
description: Set the HTTP response headers that constrain what a browser will execute, embed, and leak on behalf of your origin. Use when hardening a web app against cross-site scripting, clickjacking, or referrer leakage, or when a security scan flags missing headers.
---

# Security headers

Response headers are the cheapest defense a web app has: a few lines tell
every browser what your pages are allowed to do, and browsers enforce them
for free. Skip them and a single injected script runs with full origin
privileges, your page loads inside an attacker's iframe, and full URLs with
tokens leak to third parties through the referrer.

## Method

1. **Start Content Security Policy in report-only.** Ship
   `Content-Security-Policy-Report-Only` with a `report-uri` or
   `report-to` endpoint first, watch what breaks for a week, then switch to
   the enforcing `Content-Security-Policy`. Enforcing blind guarantees a
   production outage.
2. **Build the CSP around nonces, not `unsafe-inline`.** Set
   `script-src 'self' 'nonce-<random>'` and stamp the same nonce on every
   legitimate inline script per request. `unsafe-inline` on `script-src`
   defeats the entire header, so treat it as not shipping CSP at all.
3. **Block framing with `frame-ancestors 'none'`.** Prefer the CSP
   directive over the legacy `X-Frame-Options: DENY`, and set both while old
   browsers linger. This is what stops clickjacking, where your page is
   overlaid invisibly on an attacker's site.
4. **Trim the referrer to `strict-origin-when-cross-origin`.** This sends
   the full path same-origin, only the origin cross-origin over HTTPS, and
   nothing when downgrading to HTTP, so query-string tokens and internal
   paths stop leaking to external sites and analytics.
5. **Set `X-Content-Type-Options: nosniff`.** This stops the browser from
   MIME-sniffing a response into a script, closing the trick where an upload
   served as text gets reinterpreted and executed.
6. **Scope powerful features with `Permissions-Policy`.** Disable what the
   app never uses: `Permissions-Policy: camera=(), microphone=(),
   geolocation=()`. A compromised script then cannot reach hardware you were
   never going to touch.

## Litmus tests

- Does securityheaders.com or an observatory scan return an A with no
  missing critical header?
- Does the CSP contain zero `unsafe-inline` or `unsafe-eval` on
  `script-src`, or a written reason it must?
- Does a cross-origin navigation leak only the origin, never the full path,
  in the `Referer` request header?
- Is the same header set applied to error pages and API responses, not just
  the happy-path HTML?

## Boundaries

Headers constrain the browser: they do nothing for non-browser clients and
do not sanitize the input that caused an injection in the first place. CSP
is defense in depth behind output encoding, not a replacement for it. Where
a framework or edge platform injects headers, configure them in one place
and verify the actual response rather than trusting the setting.

Versions

RepositoryScoreLicence
This page · Amey-Thakur/AI-SKILLS90MIT
thisiskurubaran/DevSecOps100MIT
PIXARTSeu/Synapse95AGPL-3.0
fusengine/agents90MIT

Database snapshot: 13.11.2026 · package version e6ec546f81ba (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100http-security-headers
    Verify and configure HTTP response security headers. Use when reviewing web server configuration, reverse proxy setup, or application middleware that sets response headers.
  • 100security-headers-configuration
    Configures HTTP security headers to protect against XSS, clickjacking, and MIME sniffing attacks. Use when hardening web applications, passing security audits, or implementing Content Security Policy.
  • 100x-content-type
    Use when auditing HTTP response headers on any web server or CDN for security hardening.
  • 100security-headers-audit
    Use when auditing the HTTP security headers of a website URL — scores 6 headers (CSP, HSTS, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy) out of 100 and produces a legal-markdown report with the 3 top corrections.
  • 100security-headers-generator
    Generate security headers generator operations. Auto-activating skill for Security Fundamentals. Triggers on: security headers generator, security headers generator Part of the Security Fundamentals skill category. Use when working with security headers generator functionality.…
  • 95memstack-security-csp-headers
    Use this skill when the user says 'CSP', 'Content-Security-Policy', 'security headers', 'HSTS', 'X-Frame-Options', 'clickjacking', 'unsafe-inline', 'unsafe-eval', or needs to audit, generate, or fix HTTP security headers for a web application. Do NOT use for API route audits or dependency scanning.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.