security-headers
Skill2 starsChanged 4 months agoMITView on GitHub
Add or harden HTTP security headers on a web app or API — Content-Security-Policy, HSTS, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, and CORS — using the project's framework, to defend against XSS, clickjacking, and MIME sniffing. Use when the user says "add security headers", "set up CSP", "add HSTS", "configure CORS", "fix clickjacking", "harden the HTTP headers", or "pass a security headers scan".
7 other projects use a version of this.
Adopted by
Most recently taken up by
- manastalukdar/ai-devstudiotheir own version, first seen Oct 13, 2026
- ferr079/claude-code-cybersec-skillstheir own version, first seen Oct 12, 2026
- trezor/trezor-suitetheir own version, first seen Oct 8, 2026
- moh-obaida/ReadyVibe-Skillstheir own version, first seen Oct 8, 2026
- YepAPI/skillstheir own version, first seen Apr 12, 2026
- hereshecodes/secureskillstheir own version, first seen Mar 4, 2026
Used with
Projects with it also use accessibility.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
ElasticSkillaccessibility
Accessibility guidance for Kibana. Use this skill when working with or reviewing EUI components, resolving a11y-related (@elastic/eui) ESLint issues, and ensuring proper use of ARIA attributes, focus management, keyboard interactions, and accessible naming conventions.
Also in 3 projects that use this
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- trezor/trezor-suite★ 1.1ksame name
- harperaa/secure-claude-skills★ 16same name
- YepAPI/skills★ 8same name
- moh-obaida/ReadyVibe-Skills★ 2same name
- manastalukdar/ai-devstudio★ 1same name
- ferr079/claude-code-cybersec-skills★ 0same name
- hereshecodes/secureskills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository68 other files it gives its agents.
- a11ySkill
- api-docsSkill
- audit-logSkill
- benchmarkSkill
- bisectSkill
- cacheSkill
- changelogSkill
- cherry-pickSkill
- ci-setupSkill
- codeownersSkill
- commit-messageSkill
- connection-poolSkill
- contributingSkill
- coverageSkill
- db-migrateSkill
- dead-codeSkill
- debugSkill
- depsSkill
- diagramSkill
- dockerizeSkill
- docstringSkill
- e2eSkill
- env-exampleSkill
- error-handlingSkill
- explainSkill
- feature-flagSkill
- flaky-testSkill
- gitignoreSkill
- graceful-shutdownSkill
- graphqlSkill
- healthcheckSkill
- i18nSkill
- idempotencySkill
- licenseSkill
- lint-fixSkill
- loggingSkill
- migrateSkill
- mockSkill
- onboardSkill
- optimizeSkill
- paginationSkill
- pr-descriptionSkill
- pre-commitSkill
- profileSkill
- prune-branchesSkill
- rate-limitSkill
- readmeSkill
- rebaseSkill
- refactorSkill
- regexSkill
- releaseSkill
- resolve-conflictsSkill
- retrySkill
- review-diffSkill
- scaffoldSkill
- secrets-scanSkill
- seedSkill
- soft-deleteSkill
- sqlSkill
- squashSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 3 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 22
Lock down CORS to an allowlist: Never reflect arbitrary origins or pair Access-Control-Allow-Origin: * with credentials.
- Distinctive: line 27
Don't break the running app: CSP and CORS misconfigured will block legitimate assets or requests — prefer CSP report-only first and an …
- Very specific: line 28
Never set Access-Control-Allow-Origin: * together with credentials, and never reflect the request origin without validating it against an …
- Very specific: line 29
Avoid unsafe-inline/unsafe-eval in CSP.
- Distinctive: line 30
Only enable HSTS once HTTPS is fully working (it's hard to roll back), and extend the project's existing header mechanism instead of adding …
- Distinctive: line 31
After applying, summarize each header set, the CSP/CORS policy, whether CSP is report-only, and how to verify the headers and that nothing …
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Framework & header signals
!grep -rilE "express|fastify|koa|nestjs|next\\.config|helmet|flask|fastapi|django|secure\\.py|rails|spring|nginx|cors|csp|content-security-policy|strict-transport" --include='*.*' package.json pyproject.toml go.mod Gemfile next.config.* nginx.conf 2>/dev/null | grep -vE 'node_modules|\.git|dist|build' | head -10
Instructions
Add or harden security headers for the app in $ARGUMENTS (or the whole app if unspecified). Match the project's framework and where it currently sets headers. CSP and CORS can break a working app if set wrong, so apply them carefully and explain what each does.
Method
- Find where headers are set today. Look for an existing middleware (
helmet,django-csp, Railsdefault_headers, a reverse-proxy config) and extend it rather than adding a second, conflicting source. Prefer the idiomatic library (helmetfor Express/Fastify,securefor FastAPI/Flask, Spring Security headers) over hand-setting strings. - Set the low-risk headers first.
X-Content-Type-Options: nosniff,X-Frame-Options: DENY(or a frame-ancestors CSP),Referrer-Policy: strict-origin-when-cross-origin, andStrict-Transport-Securitywith a sanemax-age(only once HTTPS is fully in place — HSTS is sticky and hard to undo). These rarely break anything. - Build a Content-Security-Policy deliberately. This is the highest-value and highest-risk header. Start from
default-src 'self', then add only the origins the app genuinely loads from (scripts, styles, images, fonts, connect/XHR). Avoidunsafe-inline/unsafe-eval— prefer nonces/hashes. Offer to deploy it asContent-Security-Policy-Report-Onlyfirst so violations are reported without breaking the page. - Lock down CORS to an allowlist. Never reflect arbitrary origins or pair
Access-Control-Allow-Origin: *with credentials. Allow only the specific trusted origins, the methods/headers actually used, and setAllow-Credentialsonly when cookies/auth truly cross origins. - Verify before declaring done. Note how to check (curl
-I, a securityheaders.com-style scan, browser console for CSP violations) and confirm the app still loads — no blocked scripts/styles, no CORS errors in the console.
Rules
- Don't break the running app: CSP and CORS misconfigured will block legitimate assets or requests — prefer CSP report-only first and an explicit CORS allowlist, and verify the app still works.
- Never set
Access-Control-Allow-Origin: *together with credentials, and never reflect the request origin without validating it against an allowlist. - Avoid
unsafe-inline/unsafe-evalin CSP; use'self', nonces, or hashes, and scope each directive to the origins actually used. - Only enable HSTS once HTTPS is fully working (it's hard to roll back), and extend the project's existing header mechanism instead of adding a conflicting second one.
- After applying, summarize each header set, the CSP/CORS policy, whether CSP is report-only, and how to verify the headers and that nothing broke.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

