csp
Skill0 starsChanged 7 months agoMITView on GitHub
Audit and implement Content-Security-Policy for web apps. Use when working on CSP headers, nonce or hash wiring, inline script/style removal, report-only rollout, or stack-specific CSP setup after running /csp audit or /csp implement.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- ChristopherAlphonse/calphonse-skillstheir own version, first seen Nov 2, 2026
- qian-gugugaga/Character_Skill_Producertheir own version, first seen Jun 6, 2026
- cocart-headless/cocart-skillstheir own version, first seen Apr 16, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- qian-gugugaga/Character_Skill_Producer★ 281same name
- ChristopherAlphonse/calphonse-skills★ 1same name
- cocart-headless/cocart-skills★ 1same 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.
The file
Show its rules and text
We split this skill into the rules it gives an agent
21 rules. About 0 are common, 15 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈15
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use this skill to inspect a project for CSP exposure, design a stronger policy, and apply it safely.
- Very specific: line 12
Run /csp audit when you need discovery and recommendations.
- Very specific: line 13
Run /csp implement when you want the policy wired into the app.
- Distinctive: line 15
Prefer a report-only rollout first unless the user explicitly asks to enforce immediately.
- Very specific: line 29
Keep object-src 'none' unless the app genuinely needs plugins.
- Very specific: line 30
Add base-uri 'self' and a frame-ancestors policy.
- Distinctive: line 31
Prefer nonces for per-request inline code, hashes for static inline code, and refactoring for event handlers.
- Very specific: line 32
Treat unsafe-eval as a last resort, usually only for development or legacy tooling.
- Very specific: line 33
Start with Content-Security-Policy-Report-Only when the impact is uncertain.
- Distinctive: line 34
Prefer report-only plus browser-console verification before enforcing production changes.
- Distinctive: line 35
Treat any exception as temporary until it is justified by a real runtime need.
- Distinctive: line 50
Read mdn-csp-guide.md first for the canonical CSP model and browser behavior.
- Distinctive: line 51
Read content-security-policy-complete.md for the extended CSP knowledge base.
- Distinctive: line 52
Read github-skill-summary.md to borrow security-workflow patterns.
- Distinctive: line 53
Read github-security-patterns.md for the actionable audit habits.
- Distinctive: line 54
Read detect-stack.md to identify the stack quickly.
- Distinctive: line 55
Read audit-checklist.md to catalog resources.
- Distinctive: line 56
Read common-principles.md for policy design rules.
- Distinctive: line 57
Read the matching stack reference before editing headers or nonce plumbing.
- Distinctive: line 58
Use implement-flow.md to make the change and test it.
- Distinctive: line 71
When finishing an audit, provide:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Content Security Policy
Overview
Use this skill to inspect a project for CSP exposure, design a stronger policy, and apply it safely.
Run /csp audit when you need discovery and recommendations.
Run /csp implement when you want the policy wired into the app.
Prefer a report-only rollout first unless the user explicitly asks to enforce immediately.
Workflow
- Detect the stack and rendering model.
- Audit every CSP-relevant surface.
- Classify each item as refactor, nonce, hash, allowlist, or remove.
- Draft the tightest practical policy.
- Implement the policy and verify that the app still renders.
- Re-run the audit after each CSP change to catch regressions.
Core Rules
- Eliminate
unsafe-inlinefromscript-srcwhenever a practical alternative exists. - Keep
object-src 'none'unless the app genuinely needs plugins. - Add
base-uri 'self'and aframe-ancestorspolicy. - Prefer nonces for per-request inline code, hashes for static inline code, and refactoring for event handlers.
- Treat
unsafe-evalas a last resort, usually only for development or legacy tooling. - Start with
Content-Security-Policy-Report-Onlywhen the impact is uncertain. - Prefer report-only plus browser-console verification before enforcing production changes.
- Treat any exception as temporary until it is justified by a real runtime need.
What To Inspect
- Server entry points and header middleware
- HTML templates and component render paths
- Inline
<script>and<style>blocks - Inline event handlers such as
onclick eval,new Function, template compilation, and string-based script injection- Script, style, image, font, connect, frame, worker, and media origins
- Third-party widgets, analytics, and payment providers
- Deployment layer headers that may need to be updated alongside app code
How To Work
- Read mdn-csp-guide.md first for the canonical CSP model and browser behavior.
- Read content-security-policy-complete.md for the extended CSP knowledge base.
- Read github-skill-summary.md to borrow security-workflow patterns.
- Read github-security-patterns.md for the actionable audit habits.
- Read detect-stack.md to identify the stack quickly.
- Read audit-checklist.md to catalog resources.
- Read common-principles.md for policy design rules.
- Read the matching stack reference before editing headers or nonce plumbing.
- Use implement-flow.md to make the change and test it.
Rationalizations To Reject
- "We can leave
unsafe-inlinefor now." - "The inline script is tiny, so it is harmless."
- "We only need the allowlist in production."
- "The browser console warning is just noise."
- "We can add a wide domain wildcard and tighten it later."
- "The site works in report-only, so we do not need to remove the inline code."
Output Shape
When finishing an audit, provide:
- the detected stack
- a resource catalog
- inline-code findings
- recommended fixes
- the final CSP header
When implementing, provide:
- files changed
- how nonce or hash propagation works
- any residual exceptions or report-only items
Stack References
- MDN CSP Guide Notes
- CSP Knowledge Base
- GitHub Skill Summary
- GitHub Security Patterns
- Next.js
- Nuxt
- SvelteKit
- Remix
- Astro
- Express
- Fastify
- NestJS
- Hono
- Django
- Rails
- Laravel
- Spring Boot
- Nginx
- Apache
- Vercel
- Netlify
- Cloudflare
- Static HTML
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.

