Skip to content
TrustedSkillsbeta
Back to all skills

Content Security Policy Generator

Listed
jeremylongshore·vlatest·security·MIT

Generates secure Content Security Policies to mitigate XSS attacks based on website structure and desired content sources.

Install on your platform

Showing Claude Code. One command installs this skill into any of the agents below.

  1. 1

    Run this in your project

    terminal
    $ npx skills add jeremylongshore/tons-of-skills-marketplace --skill content-security-policy-generator -a claude-code
  2. Uses the open-source skills CLI and needs Node.js. Add -g to install it for your user instead of this project.

What we know about this skill

Publisher

jeremylongshore

Taken from the source listing. We haven't verified who controls this account.

Install target

Live repository

Not pinned. Installing fetches whatever the repository holds at the time you run the command.

Nobody has reviewed this code. TrustedSkills indexes and links skills; it does not audit, run or scan them. A skill runs with whatever access you give your agent — read the source before you install it.

Automated safety checks

scanned

We could not read this skill's source, so none of the checks below were run.

Not scanned. none of the 396 skills in the repository match this slug — it was most likely renamed or removed upstream after the registry indexed it Source recorded as jeremylongshore/claude-code-plugins-plus-skills.
This is a static scan, not a review. It reads the skill's files; it does not run them, and it cannot tell you whether the skill is any good or whether the code does what its description says. A skill runs with whatever access you give your agent.
What each check looks for →

About this skill

What it does

This skill generates Content Security Policy (CSP) headers. CSPs are a crucial security mechanism that helps protect web applications from cross-site scripting (XSS) and other code injection attacks by defining allowed sources for various resources like scripts, stylesheets, and images. The generator simplifies the process of creating these policies based on your application's needs.

When to use it

  • Securing a new website: Generate a baseline CSP when launching a new web project.
  • Hardening an existing site: Improve the security posture of an older website by implementing or refining its CSP.
  • Responding to security audits: Quickly create CSPs as part of addressing recommendations from security assessments.
  • Enforcing stricter resource loading: Control exactly where your application can load resources from, mitigating potential vulnerabilities.

Key capabilities

  • Generates CSP headers based on provided directives.
  • Simplifies the creation of complex CSP rules.
  • Helps mitigate XSS and other code injection attacks.

Example prompts

  • "Generate a Content Security Policy that allows scripts only from example.com."
  • "Create a CSP allowing images from data: URLs and example.net."
  • "I need a CSP for a site using inline styles and fonts from Google Fonts, please generate one."

Tips & gotchas

The generated CSP may require adjustments based on your specific application's needs and dependencies. Thoroughly test any changes to your CSP in a staging environment before deploying them to production.