Turnstile CSP Debugger

Turnstile CSP Debugger is an agent for Claude Code from secondsky/claude-skills. It costs 58 tokens per session (2,706 once invoked), scanned A, original, MIT.

A diagnostic agent that checks whether a website’s Content Security Policy, or CSP, allows Cloudflare Turnstile’s scripts, frames, and network requests to load. CSP is a browser security rule controlling which sources a page may use.

In plain words
What is it for?
Use it to validate CSP headers before deployment, investigate Turnstile error 200500, and troubleshoot widgets blocked by browser security rules.
Why use it?
It helps explain why a Turnstile widget fails to load even when the application code is otherwise correct. It identifies missing policy entries and suggests compatible changes.

Agent for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is ./scripts/check-csp.sh https://user-domain.com.

Part of the cloudflare-turnstile plugin — 1 skill, 1 command, 1 agent shipped together

Good fit Use it to validate CSP headers before deployment, investigate Turnstile error 200500, and troubleshoot widgets blocked by browser security rules.

Compare 6 agents from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/secondsky/claude-skills
agentmods
npx agentmods add agents/secondsky/claude-skills/csp-debugger

Made for: Claude Code.

Or install cloudflare-turnstile, the plugin that ships this one along with the rest of its 1 skill, 1 command, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Turnstile CSP Debugger

README.md
[![agentmods](https://agentmods.dev/badge/agents/secondsky/claude-skills/csp-debugger/github.svg)](https://agentmods.dev/agents/secondsky/claude-skills/csp-debugger)
Your own site
<a href="https://agentmods.dev/agents/secondsky/claude-skills/csp-debugger"><img src="https://agentmods.dev/badge/agents/secondsky/claude-skills/csp-debugger/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for Turnstile CSP Debugger

Your own site · 80×15
<a href="https://agentmods.dev/agents/secondsky/claude-skills/csp-debugger"><img src="https://agentmods.dev/badge/agents/secondsky/claude-skills/csp-debugger.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,706 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00058 $0.02706
Opus 5.5 $0.00023 $0.01082
Sonnet 5.5 $0.00012 $0.00541
Haiku 4.5 $0.00006 $0.00271

Measured 1mo ago against content hash d2f0dbe94d4f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

Turnstile CSP Debugger scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

async fetch(request: Request, env: Env): Promise<Response> {
plugins/cloudflare-turnstile/agents/csp-debugger.md · 339 lines

How it starts

The opening of the file, as written. The whole thing — 339 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Turnstile CSP Debugger Agent

Purpose

This agent validates Content Security Policy (CSP) headers for Cloudflare Turnstile compatibility. It analyzes existing CSP configurations, identifies missing directives, and provides specific fixes to resolve CSP-related widget failures (Error 200500).

When to Invoke

Use this agent when:

  • Error 200500: CSP blocking Turnstile iframe or scripts
  • CSP validation: User wants to verify CSP is Turnstile-compatible
  • Pre-deployment: Checking CSP configuration before launch
  • Widget not loading: Suspect CSP blocking resources
  • Policy updates: After changing CSP headers

Required CSP Directives

Turnstile requires these Content Security Policy directives:

Content-Security-Policy:
  script-src https://challenges.cloudflare.com;
  frame-src https://challenges.cloudflare.com;
  connect-src https://challenges.cloudflare.com;
  style-src 'unsafe-inline';

Critical: All three domains (script-src, frame-src, connect-src) are mandatory. Missing any will cause widget failure.

Diagnostic Workflow

Step 1: Run CSP Validation Script

Execute the check-csp.sh script to validate domain's CSP:

./scripts/check-csp.sh https://user-domain.com

Expected Output (success):

✅ script-src includes challenges.cloudflare.com
✅ frame-src includes challenges.cloudflare.com
✅ connect-src includes challenges.cloudflare.com
✅ style-src allows unsafe-inline or includes challenges.cloudflare.com

CSP is properly configured for Turnstile

Error Output (missing directives):

❌ script-src missing challenges.cloudflare.com
❌ frame-src missing challenges.cloudflare.com
✅ connect-src includes challenges.cloudflare.com
❌ style-src too restrictive

CSP configuration incomplete - Turnstile will fail to load

Step 2: Analyze Current CSP Configuration

Ask user for their current CSP implementation method:

Method 1: HTTP Header (Server configuration)

# Nginx
add_header Content-Security-Policy "script-src 'self' https://challenges.cloudflare.com; frame-src 'self' https://challenges.cloudflare.com;";

Read the full file on GitHub · 339 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 339 lines · 58 tokens per session scan A d2f0dbe94d4f

Subscribe to this mod's changes

Turnstile CSP Debugger is an agent published in the GitHub repository secondsky/claude-skills (231 stars, last pushed today), licensed MIT. It adds 58 tokens to every session and 2,706 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.