
Content security policy
Write, roll out and review CSP, Trusted Types, Permissions Policy and Fetch Metadata
Content security policy is an open-source agent skill for security. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.
- Scripts
- None
- Platforms
- Claude Code, Codex, Cursor
- GitHub stars
- 5
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Content security policy
This skill guides an agent through writing and reviewing the security headers a server sends to lock down web documents. It covers strict Content Security Policy using nonces, hashes and 'strict-dynamic', plus report-only rollouts that collect violations through report-to and report-uri before enforcement.
The workflow starts by inventorying a page's inline scripts, event handlers, frames and external script origins, then maps each one to the directive that governs it. It adds Trusted Types with named policies, sets a Structured Fields Permissions-Policy header with matching iframe allow attributes, and rejects cross-site requests using Sec-Fetch-* metadata with explicit exceptions. A closing checklist covers every HTML response, including error pages, and includes a test that asserts the headers on each route.
The skill is organized as a main guide with reference files for directives, versions, reporting, Trusted Types, Permissions Policy and Fetch Metadata. It works from the W3C specifications and includes upgrade paths from CSP 1.0, CSP Level 2 and Feature-Policy. It expects a server, middleware, reverse proxy or CDN that controls the response headers, and it includes TypeScript middleware sketches.
When your agent uses it
Content Security Policy Level 3: write strict CSP headers, plus the W3C Trusted Types, Permissions Policy and Fetch Metadata Request Headers a server sets and checks to lock down documents. Covers CSP Level 3 (current, Working Draft) with CSP Level 2 supported and CSP 1.0, X-Content-Security-Policy and X-WebKit-CSP legacy: directives, source lists, nonces and hashes, 'strict-dynamic', 'unsafe-hashes', report-to, report-uri, Report-Only, frame-ancestors and upgrade-insecure-requests. Trusted Types: require-trusted-types-for 'script' and the default policy. Permissions Policy: the structured header, allowlists and the iframe allow attribute, with Feature-Policy legacy. Fetch Metadata: Sec-Fetch-Site, -Mode, -Dest and -User for a resource isolation policy. Use when writing or reviewing security headers. Also CSP Embedded Enforcement, Mixed Content, Reporting API and Upgrade Insecure Requests.
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
From a static check of its 8 files (83 KB) on GitHub on 2 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the better-supabase plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add ScaleDockHQ/better-supabase
/plugin install better-supabase@better-supabaseOr copy only this skill to ~/.claude/skills/content-security-policy:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ScaleDockHQ/better-supabase.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/content-security-policy &&
cp -R "$tmp/.agents/skills/content-security-policy" ~/.claude/skills/content-security-policy &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/content-security-policy inside it instead.
Copy the skill folder to ~/.agents/skills/content-security-policy to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ScaleDockHQ/better-supabase.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/content-security-policy &&
cp -R "$tmp/.agents/skills/content-security-policy" ~/.agents/skills/content-security-policy &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/content-security-policy inside it instead.
Copy the skill folder to ~/.cursor/skills/content-security-policy to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ScaleDockHQ/better-supabase.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/content-security-policy &&
cp -R "$tmp/.agents/skills/content-security-policy" ~/.cursor/skills/content-security-policy &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/content-security-policy inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/ScaleDockHQ/better-supabase.git --path .agents/skills/content-security-policyOr copy the folder to ~/.gemini/skills/content-security-policy yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/content-security-policy:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ScaleDockHQ/better-supabase.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/content-security-policy &&
cp -R "$tmp/.agents/skills/content-security-policy" ~/.copilot/skills/content-security-policy &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/content-security-policy inside it instead.
Get the folder:
git clone --depth 1 https://github.com/ScaleDockHQ/better-supabase.gitThen copy better-supabase/.agents/skills/content-security-policy into your agent's skills folder as content-security-policy. Agents that support SKILL.md read one folder per skill.
What it does
- Strict CSP authoring
- Writes Content Security Policy headers built on nonces or hashes and 'strict-dynamic'.
- Report-only rollout
- Ships policies in report-only mode with report-to collection before enforcing them.
- Trusted Types setup
- Covers require-trusted-types-for, the trusted-types directive and named or default policies.
- Permissions-Policy configuration
- Sets feature allowlists in the Structured Fields header and iframe allow attributes.
- Fetch Metadata isolation
- Refuses cross-site requests using Sec-Fetch-Site, Mode, Dest and User headers.
- Legacy header upgrades
- Moves CSP 1.0, CSP Level 2 and Feature-Policy setups to current syntax.
Good for
- Add a strict Content-Security-Policy with nonces to our HTML responses
- Roll out Trusted Types in report-only mode for our frontend
- Review our existing security headers for weak script-src rules
- Lock down which browser features our iframes can use
- Block cross-site requests to our API using Fetch Metadata
Content security policy FAQ
Does the skill change my server code on its own?
It describes a workflow for the agent to write, deploy and review headers on the server side, following the steps and checks in the skill.
Which clients does Content security policy support?
It is a plain SKILL.md folder with no client-specific tooling, so it follows the shared agent skills format for all listed clients.
Are there scripts included?
No scripts are included in the skill folder.
Which sources does the guidance rely on?
It cites W3C specifications including CSP Level 3, Trusted Types, Permissions Policy, Fetch Metadata and Reporting API, with pinned revisions.
How do I install Content security policy in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/content-security-policy to use it in all your projects, or to .claude/skills/content-security-policy in one project. Or install the better-supabase plugin, which includes it: /plugin marketplace add ScaleDockHQ/better-supabase, then /plugin install better-supabase@better-supabase.
Does Content security policy run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Content security policy?
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.
What are the best alternatives to Content security policy?
The closest alternatives to Content security policy are Techstack security, Client side, Security, Security and Security review.
Where this comes from
- Description: from the skill's own SKILL.md.
More from ScaleDockHQ/better-supabase

Apply the CommonMark 0.31.2 spec when parsing or rendering Markdown
- Open source
- 5 GitHub stars
- Files and documents

Publish Agent Cards and run agent-to-agent calls over the A2A 1.0 protocol
- Open source
- 5 GitHub stars
- Developer tools

Lets an agent stream runs, tool calls and shared state to user-facing apps over AG-UI 1.0
- Open source
- 5 GitHub stars
- Developer tools

Lets an AI agent drive Chrome or Chromium through a fast browser automation CLI
- Open source
- 5 GitHub stars
- Browser automation

Guides an agent to write, review and validate SKILL.md skills against the Agent Skills
- Open source
- 5 GitHub stars
- Developer tools

Write, place, migrate and review AGENTS.md instruction files for coding agents
- Open source
- 5 GitHub stars
- Developer tools






