cloudflare-turnstile

cloudflare-turnstile is a skill for Claude Code from secondsky/claude-skills. It costs 84 tokens per session (4,720 once invoked), scanned B, original, MIT.

A practical guide for adding Cloudflare Turnstile, a CAPTCHA alternative that checks whether requests are automated. It covers placing the widget in a page and validating its token on the backend.

In plain words
What is it for?
Use it to add Turnstile to forms, login flows, and Cloudflare Workers, then validate requests and diagnose common Turnstile errors.
Why use it?
It helps protect user-facing forms and APIs without designing the full bot-check integration from scratch. It also addresses token, secret-key, and CSP-related failures.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

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

Good fit Use it to add Turnstile to forms, login flows, and Cloudflare Workers, then validate requests and diagnose common Turnstile errors.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/secondsky/claude-skills/cloudflare-turnstile
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add secondsky/claude-skills --skill cloudflare-turnstile
Clone the repo
git clone --depth 1 https://github.com/secondsky/claude-skills

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 cloudflare-turnstile

README.md
[![agentmods](https://agentmods.dev/badge/skills/secondsky/claude-skills/cloudflare-turnstile/github.svg)](https://agentmods.dev/skills/secondsky/claude-skills/cloudflare-turnstile)
Your own site
<a href="https://agentmods.dev/skills/secondsky/claude-skills/cloudflare-turnstile"><img src="https://agentmods.dev/badge/skills/secondsky/claude-skills/cloudflare-turnstile/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 cloudflare-turnstile

Your own site · 80×15
<a href="https://agentmods.dev/skills/secondsky/claude-skills/cloudflare-turnstile"><img src="https://agentmods.dev/badge/skills/secondsky/claude-skills/cloudflare-turnstile.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 84 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,720 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 4 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Prompt Injection · line 71
    Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
    Fix: Audit all comments and invisible characters. Remove any instructions that direct the agent to perform unauthorized actions. Use plain, reviewable content.
  • high Prompt Injection · line 149
    Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
    Fix: Audit all comments and invisible characters. Remove any instructions that direct the agent to perform unauthorized actions. Use plain, reviewable content.
  • medium Data Exfiltration · line 103
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
  • medium Data Exfiltration · line 250
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
How audits are shown
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.00084 $0.04720
Opus 5 $0.00042 $0.02360
Sonnet 5 $0.00017 $0.00944
Haiku 4.5 $0.00008 $0.00472

Measured 6d ago against content hash 3d850638afbf, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade B, and why

cloudflare-turnstile scanned grade B with 2 findings 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 6d ago.

The scan reads SKILL.md. This mod also ships 5 executable files (scripts/check-csp.sh, templates/turnstile-hono-route.ts, templates/turnstile-server-validation.ts, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Sends data to an external URLmediumData exfiltration

A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.

const result = await fetch( 'https://challenges.cloudflare.com/turnstile/v0/siteverify', { method: 'POST',

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/skills/cloudflare-turnstile/SKILL.md · 511 lines

How it starts

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

Cloudflare Turnstile

Status: Production Ready ✅ | Last Verified: 2025-11-26

Dependencies: None (optional: @marsidev/react-turnstile for React)

Contents: Quick StartCritical RulesTop 12 ErrorsCommon PatternsWhen to Load ReferencesTroubleshooting


Quick Start (10 Minutes)

1. Create Turnstile Widget

Get your sitekey and secret key from Cloudflare Dashboard.

# Navigate to: https://dash.cloudflare.com/?to=/:account/turnstile
# Create new widget → Copy sitekey (public) and secret key (private)

Why this matters:

  • Each widget has unique sitekey/secret pair
  • Sitekey goes in frontend (public)
  • Secret key ONLY in backend (private)
  • Use different widgets for dev/staging/production

2. Add Widget to Frontend

Embed the Turnstile widget in your HTML form.

<!DOCTYPE html>
<html>
<head>
  <script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>
</head>
<body>
  <form id="myForm" action="/submit" method="POST">
    <input type="email" name="email" required>
    <!-- Turnstile widget renders here -->
    <div class="cf-turnstile" data-sitekey="YOUR_SITE_KEY"></div>
    <button type="submit">Submit</button>
  </form>
</body>
</html>

CRITICAL:

  • Never proxy or cache api.js - must load from Cloudflare CDN
  • Widget auto-creates hidden input cf-turnstile-response with token
  • Token expires in 5 minutes
  • Each token is single-use only

3. Validate Token on Server

ALWAYS validate the token server-side. Client-side verification alone is not secure.

// Cloudflare Workers example
export default {
  async fetch(request: Request, env: Env): Promise<Response> {
    const formData = await request.formData()
    const token = formData.get('cf-turnstile-response')
    const ip = request.headers.get('CF-Connecting-IP')

    // Validate token with Siteverify API
    const verifyFormData = new FormData()
    verifyFormData.append('secret', env.TURNSTILE_SECRET_KEY)
    verifyFormData.append('response', token)
    verifyFormData.append('remoteip', ip)

    const result = await fetch(
      'https://challenges.cloudflare.com/turnstile/v0/siteverify',
      {
        method: 'POST',
        body: verifyFormData,
      }
    )

    const outcome = await result.json()

    if (!outcome.success) {
      return new Response('Invalid Turnstile token', { status: 401 })
    }

    // Token valid - proceed with form processing
    return new Response('Success!')
  }
}

Read the full file on GitHub · 511 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. 6d ago First seen · 511 lines · 84 tokens per session scan B 3d850638afbf

Subscribe to this mod's changes

cloudflare-turnstile is a skill published in the GitHub repository secondsky/claude-skills (216 stars, last pushed 2d ago), licensed MIT. It adds 84 tokens to every session and 4,720 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it B with 2 findings (sends data to an external url, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.