跳到主内容
@wquguru
精选88Cloudflare 博客(RSS)产品发布/更新

Cloudflare推出Turnstile Spin

Agents can now set up your website’s security with Turnstile Spin

原文
发到 X
推荐理由

Agent落地能力的典型实践,展示了如何将传统API封装为Agent可执行的Skill,值得做AI基础设施和开发者工具的同学参考。

In 2023, Cloudflare declared itself free from CAPTCHAs with the launch of Turnstile, our privacy-first client-side challenge. Turnstile is free to use, works on any site (no need to proxy traffic through Cloudflare), and never asks a visitor to solve a puzzle. Now, we are launching Turnstile Spin, an agent-mediated end-to-end implementation of Turnstile.

2023年,Cloudflare推出了以隐私优先的客户端挑战Turnstile,宣布自己不再依赖验证码。Turnstile免费使用,适用于任何网站(无需将流量通过Cloudflare代理),且从不要求访客解决谜题。现在,我们推出Turnstile Spin,这是Turnstile的一种由AI代理介导的端到端实现方案。

Initially built with developers in mind, Turnstile requires a basic two-step implementation and understanding of frontend and backend development. First, you modify your frontend code to render the Turnstile widget; this allows Cloudflare to run the client-side challenges and issue a token. Second, you POST the token to our Siteverify API, which verifies the token and returns metadata about whether the visitor passed or failed the challenge. You can then act on this decision, like gating the login button until the visitor successfully solves a Turnstile challenge.

Turnstile最初是为开发者设计的,需要基本的两步实施过程以及对前端和后端开发的理解。首先,你需要修改前端代码以渲染Turnstile小部件;这使得Cloudflare能够运行客户端挑战并发放令牌。其次,你将令牌POST到我们的Siteverify API,该API会验证令牌并返回关于访客是否通过挑战的元数据。然后你可以基于此决策采取行动,例如在访客成功解决Turnstile挑战之前锁定登录按钮。

Turnstile now processes about three billion verifications on a typical weekday, and in one recent week more than 23,000 accounts created a new widget in the Cloudflare dashboard. This rapid adoption pushed us to evaluate how we can help users achieve full Turnstile validation seamlessly. Turnstile was built for developers, but demand for simple bot protection reaches far beyond people who write backend code every day. AI raises the stakes: it helps more people build applications, while giving attackers more ways to automate abuse. We wanted the same technology to make Turnstile easier to install correctly.

Turnstile目前每天平均处理约30亿次验证,在最近的一周内,有超过23,000个账户在Cloudflare仪表板中创建了新的Widget。这种快速采用促使我们评估如何帮助用户无缝实现完整的Turnstile验证。Turnstile是为开发者构建的,但对简单机器人防护的需求远远超出了那些每天编写后端代码的人。AI提高了门槛:它帮助更多人构建应用程序,同时也让攻击者有更多方式自动化滥用行为。我们希望同样的技术能让Turnstile更容易正确安装。

Turnstile Spin is our implementation of this new capability. You can use it to create the widget, embed it on your site, and embed Siteverify to relevant functions in your backend, just as you would manually. Spin also fixes improperly installed widgets and handles migrations from other CAPTCHA providers. You can start it from your Cloudflare dashboard, from Wrangler, or by pasting a public skill URL into your agent.

Turnstile Spin是我们对这一新能力的实现。你可以使用它来创建Widget、将其嵌入你的网站,并将Siteverify嵌入到你后端的相应功能中,就像手动操作一样。Spin还可以修复安装不当的Widget,并处理从其他验证码提供商的迁移。你可以从Cloudflare仪表板、Wrangler启动它,或者将公共技能URL粘贴到你的代理中。

Adapting Turnstile for the Era of AI Coding Agents

为AI编程代理时代适配Turnstile

When we first built Turnstile, web development followed a standard engineering pattern: developers wrote client-side interfaces and backend logic by hand. Turnstile’s setup naturally reflected that two-step workflow.

当我们最初构建Turnstile时,Web开发遵循标准的工程模式:开发者手工编写客户端界面和后端逻辑。Turnstile的设置自然反映了这种两步工作流程。

Today, the way web applications are built has fundamentally shifted. AI coding agents now enable anyone, from experienced engineers to first-time creators, to spin up functional sites in seconds. However, security workflows designed for manual development don't always align with prompt-driven building.

如今,Web 应用的构建方式发生了根本性转变。AI 编码代理现在使任何人都能在几秒钟内启动功能完整的网站,无论是经验丰富的工程师还是初次创作者。然而,为手动开发设计的安全工作流程并不总是与基于提示词的构建方式相契合。

To make Turnstile as effortless for AI builders as it has been for traditional web developers, we are introducing native support for AI agent workflows. Spin is designed to do that automatically. To check your own setup, open the Turnstile page in your account. If a widget has served traffic without backend validation, you will see a "Fix with Spin" action.

为了让 Turnstile 对 AI 构建者来说像对传统 Web 开发者一样轻松,我们引入了对 AI 代理工作流的原生支持。Spin 旨在自动实现这一目标。要检查您自己的设置,请在您的账户中打开 Turnstile 页面。如果某个小部件在没有后端验证的情况下已处理流量,您将看到一个“使用 Spin 修复”操作。

Meet Turnstile Spin

认识 Turnstile Spin

Turnstile Spin turns a two-part setup into a guided workflow with your coding agent. You choose where you want protection, and the agent finds the relevant frontend and backend code, proposes a plan, and waits for your approval. It then completes both sides of the integration together. Someone without backend experience can finish the setup correctly, while an experienced developer can skip repetitive work and catch missing steps.

Turnstile Spin 将两步设置转化为与您编码代理配合的引导式工作流。您选择需要保护的位置,代理会找到相关的前端和后端代码,提出计划并等待您的批准。然后它同时完成集成两侧的工作。没有后端经验的人可以正确完成设置,而有经验的开发人员则可以跳过重复性工作并发现遗漏的步骤。

Spin does not send your application code to Cloudflare or ask Cloudflare to change it remotely. The agent you already use, whether Claude Code, Cursor, Codex, or something else, makes the approved changes inside your codebase. The only new resource in your Cloudflare account is the Turnstile widget. Validation stays in your backend, next to the application logic that decides what happens after a challenge.

Spin 不会将您的应用程序代码发送到 Cloudflare,也不会要求 Cloudflare 远程更改它。您已经使用的代理(无论是 Claude Code、Cursor、Codex 还是其他工具)会在您的代码库内部进行经批准的更改。您的 Cloudflare 账户中唯一的新资源是 Turnstile 小部件。验证仍保留在后端,位于决定挑战后发生什么的应用程序逻辑旁边。

Spin can adapt to whichever of three contexts it finds in your codebase:

Spin 可以适应您在代码库中发现的三种上下文中的任何一种:

1. Fresh install

1. 全新安装

No CAPTCHA in place. The agent embeds the widget on your frontend and wires Siteverify into your backend from scratch.

尚未部署 CAPTCHA。代理在前端嵌入小部件,并从零开始在您的后端接入 Siteverify。

2. Widget recovery

2. 小部件恢复

Cloudflare monitors Siteverify calls for each widget, and any widget with no server-side validation gets a "Fix with Spin" banner in your dashboard. The agent uses the same secret and adds the missing step to your backend, while the widget keeps serving traffic. This flow pre-empts the kind of support tickets people used to send about their Turnstile setups.

Cloudflare 监控每个小部件的 Siteverify 调用,任何没有服务器端验证的小部件都会在您的仪表板中获得一个“使用 Spin 修复”横幅。代理使用相同的密钥,并在您的后端添加缺失的步骤,同时小部件继续处理流量。此流程可预防人们过去因 Turnstile 设置而发送的支持工单类型。

3. Migration from CAPTCHA

3. 从 CAPTCHA 迁移

The agent detects the existing markers, proposes a substitution plan, and applies it after you approve. Existing Turnstile migration paths in the docs still cover the tool-specific details.

代理检测现有标记,提出替换计划,并在您批准后应用。文档中现有的 Turnstile 迁移路径仍然涵盖特定工具的详细信息。

You can start Spin from the dashboard, Cloudflare Wrangler, or your agent directly through our skill. Typically, you'll use a combination of the three, by starting from the dash and pasting the skill into your agent, which will use Wrangler to facilitate the steps for you.

您可以从仪表板、Cloudflare Wrangler 或通过我们的技能直接由您的代理启动 Spin。通常,您会结合使用这三种方式:从仪表板开始,将技能粘贴到您的代理中,代理将利用 Wrangler 为您简化相关步骤。

Early results

早期成果

People began using Spin as soon as it reached the dashboard. Since its release in July, the dashboard has recorded more than 65,000 successful Spin widget creations, and developers have copied the generated prompt more than 30,000 times. This rapid adoption has demonstrated that bringing Turnstile directly into AI workflows fills a real, immediate need for builders.

Spin 一上线仪表板,人们就开始使用它。自七月发布以来,仪表板已记录超过 65,000 次成功的 Spin 组件创建,开发者复制生成的提示词超过 30,000 次。这种快速普及表明,将 Turnstile 直接引入 AI 工作流满足了构建者真实且迫切的需求。

Those results also reflect the biggest lesson I learned while building Spin as an intern: an intuitive idea still needs time, feedback, and repeated simplification. Early in my internship, Bryan Becker advised me to share work before it felt finished, and Marina Elmore kept pushing me back to the customer's question whenever I overcomplicated the answer. I followed that advice by showing rough versions early, testing them with the team, and cutting as many steps as possible in the path of simpler security for our customer.

这些结果也反映了我在实习期间构建 Spin 时学到的最重要一课:一个直观的想法仍需时间、反馈和反复简化。在实习初期,Bryan Becker 建议我在作品尚未完成时就分享出来;每当我把答案复杂化时,Marina Elmore 总会把我拉回用户的问题本身。我遵循了这一建议,尽早展示粗略版本,与团队进行测试,并尽可能减少通往更简单安全路径的步骤。

Try Turnstile today through Spin

今天通过 Spin 体验 Turnstile

Turnstile is free for everyone, so try out Spin to deploy or fix Turnstile widgets in minutes. If you don’t have a Cloudflare account, you can create one with no further setup. Check out the docs for more details, and don’t hesitate to send us feedback.

Turnstile 对所有人免费,因此您可以试用 Spin,在几分钟内部署或修复 Turnstile 组件。如果您没有 Cloudflare 账户,可以立即创建一个,无需额外设置。请查阅文档了解更多详情,并欢迎随时向我们提供反馈。

更进一步:量化金融体系

看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力

进入量化体系 →

关联讨论

同一事件的更多信源

相似阅读

关联信息,但可能不是同一事件