Security headers skill for Claude Code, Codex and Cursor
The security-headers agent skill writes CSP, HSTS and other security header config for Cloudflare, Vercel, Netlify, nginx and Next.js. It needs no CLI.
security-headers is an Agent Skills SKILL.md from squirrelscan that writes HTTP security header configs: a CSP, HSTS and security headers generator for coding agents. It covers Cloudflare, Vercel, Netlify, nginx and Next.js in Claude Code, Codex, Cursor and other agents. It is standalone: it needs neither the squirrel CLI nor the hosted squirrelscan MCP server, and verifies live headers with curl.
New to skills? Start with the skills overview.
What it does
- Checks what a website sends now with
curl -sI, and notes whether the app, the CDN or the host sets each header. - Proposes a baseline from OWASP’s secure headers project: HSTS,
X-Content-Type-Options, a starter Content-Security-Policy,X-Frame-Options,Referrer-PolicyandPermissions-Policy. - Rolls CSP out safely: report-only first, then nonces or hashes, then each legitimate origin, then enforcing.
- Starts HSTS with a short
max-ageon a website you are unsure about, and addspreloadonly when every subdomain is HTTPS for good. - Writes the config where the platform wants it:
next.config.ts,vercel.json, Netlify_headers, nginxadd_headerlines or a Cloudflare Transform Rule. - Warns about platform traps, such as nginx dropping parent
add_headerlines in a nestedlocationand duplicate headers from the origin and the CDN. - Says which headers WordPress, Shopify and Webflow owners cannot set, instead of promising them.
- Verifies with
curland, if the squirrel CLI is installed, the matching audit rules in passive mode.
Questions it answers
- Add security headers to Next.js
- Set up a CSP
- Fix missing HSTS and Referrer-Policy headers
- How do I add a Content-Security-Policy without breaking my website?
- How do I set security headers on Cloudflare, Vercel, Netlify or nginx?
- What should my X-Frame-Options and frame-ancestors be?
- Is it safe to add HSTS preload?
- How do I check which security headers my website sends?
Install
Works with any Agent Skills tool (Claude Code, Codex, Cursor, Gemini CLI, Amp and others):
npx skills add squirrelscan/skills --skill security-headersThe plugin installs all the skills and the hosted squirrelscan MCP server:
/plugin marketplace add squirrelscan/skills/plugin install squirrelscan@squirrelscannpx skills add puts the skill in .agents/skills/. To add the MCP server too, configure it in ~/.codex/config.toml. See squirrelscan for Codex.
Run npx skills add, then use the Cursor plugin from the skills repository or the one-click MCP link. See squirrelscan for Cursor.
Gemini CLI, GitHub Copilot, Amp and other Agent Skills tools: run npx skills add, then add the MCP server. See coding agents.
Requirements
None. This skill needs neither the squirrel CLI nor the hosted squirrelscan MCP server. curl is enough. The CLI is optional, for verification.
Example prompts
Paste one of these into your coding agent:
Add security headers to my Next.js appSet up a CSP for https://example.com, report-only firstFix missing HSTS and Referrer-Policy headers on our nginx configThe agent checks the live headers with curl, writes the config for your platform, rolls CSP out in report-only mode and re-checks the live response.
How it works
- See what is sent now with
curl -sIon a page, not only the homepage. - Pick the baseline set of headers.
- Roll out CSP: report-only, nonces or hashes, add legitimate origins, then enforce.
- Put the headers where the platform wants them.
- Verify with
curl, check the console for CSP violations on the main flows and, optionally, confirm with the squirrel CLI audit rules.
Related skills
security-audit: leaks, exposed files, cookies and probes.supabase-security-audit: Supabase Row Level Security and exposed keys.website-ci-gate: gate header regressions in CI.
Related rules and guides
Source on GitHub
skills/security-headers: the skill folder- README.md
- SKILL.md