🔥 cloudflare/security-audit-skill:面向编码 Agent 的多阶段安全审计技能
英文标题:🔥 cloudflare/security-audit-skill
Cloudflare 发布了 security-audit-skill,这是一套将编码 Agent 转变为安全审计员的技能,可通过多个隔离 Agent 完成侦察、漏洞挖掘、候选验证、结构化输出和独立复核。该技能源自 Cloudflare 的漏洞发现 harness,并以单仓库审计为起点,采用六阶段流程生成可机器读取、可验证的安全发现记录。其核心机制包括覆盖率账本、独立验证者、JSON Schema 校验以及跨运行增量审计,旨在减少遗漏和错误确认。对于开发者而言,该工具要求具备支持工具调用和并行子 Agent 的编码 Agent、Node.js 以及受操作系统强制约束的沙箱环境。
中文
一项可将你的 Agent 转变为安全审计员的编码 Agent 技能。它通过编排相互隔离的 Agent,完成侦察、覆盖率驱动的漏洞挖掘、候选项验证、结构化输出、独立记录核验以及与目标无关的报告生成。
这是孕育出 Cloudflare 漏洞发现 harness 的技能,相关 harness 见 构建你自己的漏洞发现 harness。该 harness 后来发展为一个多阶段、全范围部署的系统;而这项技能则是其演进而来的单仓库起点。
该技能通过六个阶段运行结构化审计:
- 侦察 —— 在
architecture.md和coverage-ledger.json中梳理架构、信任边界、输入面、既有证据及确定性覆盖范围。 - 覆盖率驱动的漏洞挖掘 —— 从账本单元分配相互隔离的挖掘 Agent,记录其检查内容,并使用覆盖率审查 Agent 发现缺口。
- 候选项验证 —— 将每个唯一候选项交给一个新的验证 Agent,由其尝试证伪该候选项。
- 结构化输出 —— 将
confirmed、needs_validation和rejected记录写入findings.json,并依据report-schema.json对其进行验证。 - 独立记录核验 —— 由新的 Agent 验证最终的源码声明。存在实质性替换的记录还会获得另一名独立验证者。
- 与目标无关的报告生成 —— 从已验证记录和覆盖率账本中生成
REPORT.md、FINDINGS-DETAIL.md和NEEDS-VALIDATION.md。
父级协调 Agent 会在创建账本后、以及之后每次更新账本后运行 validate-coverage-ledger.cjs。它会在第 4 阶段运行 validate-findings.cjs,并在第 5 阶段每次替换记录后再次运行该程序。
各判定状态彼此明确区分:confirmed 具有完整的源码追踪和边界清晰的已观察结果;needs_validation 包含一个精确但尚未解决的事实,且不标注严重性;rejected 则记录已被证伪的候选项。
针对同一仓库的多次运行可以累积增益。该技能会利用此前的账本和发现结果定位缺口、重新验证已变更的源码,并延续针对当前源码的证据,同时不会将过时或未解决的工作视为已覆盖。
| 文件 | 用途 |
|---|---|
SKILL.md |
安装说明、核心原则、平台术语、工作流概览及审计反模式 |
RECONNAISSANCE.md |
第 1 阶段侦察提示词和综合分析说明 |
HUNTING.md |
第 2 阶段编排、漏洞挖掘方法和验证规则 |
ATTACK-CLASSES.md |
核心、通配及显而易见事项的攻击提示词 |
MEMORY-SAFETY-AND-BINARY.md |
面向原生目标的内存安全、二进制和内核漏洞挖掘类别 |
AI-AND-LLM.md |
面向由 LLM 支持目标的提示词注入、Agent/工具和输出处理漏洞挖掘类别 |
WEB-PROTOCOL-AND-AUTH.md |
面向 HTTP 协议和认证目标的 HTTP 请求分帧、缓存及认证协议漏洞挖掘类别 |
CLIENT-SIDE.md |
面向客户端/浏览器目标的 DOM 注入、消息信任、UI 欺骗和原型污染漏洞挖掘类别 |
SUPPLY-CHAIN-AND-RELEASE.md |
依赖项、CI、发布、签名、更新、插件和扩展漏洞挖掘类别 |
CLOUD-AND-DEPLOYMENT.md |
IAM、基础设施即代码、容器、Serverless、入口和运行时配置漏洞挖掘类别 |
PROTOCOLS-RPC-AND-MESSAGING.md |
RPC、序列化、队列、消息代理、Webhook 和流式协议漏洞挖掘类别 |
RESOURCE-EXHAUSTION-AND-AVAILABILITY.md |
共享资源、配额、队列、Worker 和运营支出漏洞挖掘类别 |
DATA-ISOLATION-AND-LIFECYCLE.md |
租户隔离、缓存、搜索、导出、备份、迁移、删除和恢复漏洞挖掘类别 |
DESKTOP-MOBILE-AND-LOCAL-IPC.md |
原生应用、深层链接、WebView、导出组件、辅助程序、守护进程和本地 IPC 漏洞挖掘类别 |
VALIDATION-AND-REPORTING.md |
第 3 至第 6 阶段的候选项验证、结构化输出、记录核验和报告生成 |
report-schema.json |
三种 findings.json 判定状态的 JSON Schema |
validate-findings.cjs |
用于第 4 和第 5 阶段 findings.json 的零依赖验证器 |
validate-findings.test.cjs |
发现记录验证器测试及与生产者兼容的 fixture 检查 |
validate-coverage-ledger.cjs |
用于第 1 至第 5 阶段 coverage-ledger.json 的零依赖验证器 |
validate-coverage-ledger.test.cjs |
覆盖率账本验证器测试 |
使用 Skills CLI 安装该技能:
npx skills add https://github.com/cloudflare/security-audit-skill \
--skill security-audit
使用 --global 可进行用户级安装:
npx skills add https://github.com/cloudflare/security-audit-skill \
--skill security-audit \
--global
运行 npx skills --help 可查看 Agent 选择和非交互式选项。
在你希望审计的代码库中启动编码 Agent(或将 Agent 指向该代码库),然后要求它执行安全审计:
security audit this codebase
find security vulnerabilities in ./src
do a security review, output to ~/audits/my-project
当请求匹配其触发条件时,该技能会自动激活,例如安全审计、查找漏洞、对代码进行渗透测试等。直接请求对代码库进行审计或渗透测试时,会使用完整审计模式。安全问题咨询和聚焦的漏洞分析默认使用指导模式,除非你要求生成报告产物。在完整审计模式下,如未指定输出目录,默认目录为 ~/security-audit-skill/<repo-name>/run-<N>。只有在你明确选择了一个被版本控制系统忽略的目录时,工作流才会在目标仓库内写入文件。
-
一个使用支持工具调用和并行子 Agent 的模型的编码 Agent
-
用于零依赖发现记录和覆盖率账本验证器的 Node.js
-
面向由目标控制的构建、测试、进程、浏览器、模拟器、模糊测试器和 fixture 的、由操作系统强制实施的沙箱。它必须禁用外部网络访问,使用经过净化的白名单环境,执行资源限制,并且仅允许写入分配的临时路径。若不具备这些控制措施,工作流将把线索保留为
needs_validation,而不会执行目标代码。 -
仅确认已确立的边界失效。 对于有源码依据但受阻的线索,应保留为
needs_validation,并记录其精确的未解决事实。 -
对抗性验证。 检查某项发现的 Agent 绝不能是发现该问题的 Agent。
-
严重性需要影响。 严重性取决于可能性 × 影响,而不是偏离检查清单的程度。
-
纵深防御缺口不是漏洞。 如果 A 层能够阻止攻击,缺少 B 层只是加固建议。
-
多次运行可提升覆盖率。 在我们的测试运行中,单次运行发现的漏洞数量约为重复运行最终发现总数的一半。
如有问题、反馈,或希望交流 AI 驱动安全工具的经验,请联系:security-ai-research@cloudflare.com
MIT —— 参见 LICENSE。
English / 原文
A coding-agent skill that turns your agent into a security auditor. It orchestrates isolated agents through reconnaissance, coverage-led hunting, candidate validation, structured output, independent record verification, and target-neutral reporting.
This is the skill that seeded Cloudflare's vulnerability discovery harness, described in Build your own vulnerability harness. The harness grew into a multi-stage, fleet-wide system; this skill is the single-repo starting point it evolved from.
The skill runs a structured audit in six phases:
- Reconnaissance -- map architecture, trust boundaries, input surfaces, prior evidence, and deterministic coverage in
architecture.mdandcoverage-ledger.json. - Coverage-led hunting -- assign isolated hunters from ledger units, record their checks, and use coverage critics to find gaps.
- Candidate validation -- give every unique candidate to a fresh verifier that tries to disprove it.
- Structured output -- write
confirmed,needs_validation, andrejectedrecords tofindings.jsonand validate them againstreport-schema.json. - Independent record verification -- fresh agents verify final source claims. Material replacements receive another independent verifier.
- Target-neutral reporting -- derive
REPORT.md,FINDINGS-DETAIL.md, andNEEDS-VALIDATION.mdfrom the verified records and coverage ledger.
The parent runs validate-coverage-ledger.cjs after creating the ledger and after each later ledger update. It runs validate-findings.cjs in Phase 4 and again after every Phase 5 replacement.
The verdicts are distinct: confirmed has a complete source trace and bounded observed result, needs_validation has an exact unresolved fact and no severity, and rejected records a disproved candidate.
Multiple runs against the same repo are additive. The skill uses prior ledgers and findings to target gaps, revalidate changed source, and carry forward current-source evidence without treating stale or unresolved work as covered.
| File | Purpose |
|---|---|
SKILL.md |
Setup, core principles, platform terminology, workflow overview, and audit anti-patterns |
RECONNAISSANCE.md |
Phase 1 reconnaissance prompts and synthesis instructions |
HUNTING.md |
Phase 2 orchestration, hunting methodology, and validation rules |
ATTACK-CLASSES.md |
Core, wildcard, and obvious-things attack prompts |
MEMORY-SAFETY-AND-BINARY.md |
Memory-safety, binary, and kernel hunting classes for native targets |
AI-AND-LLM.md |
Prompt-injection, agent/tool, and output-handling hunting classes for LLM-backed targets |
WEB-PROTOCOL-AND-AUTH.md |
HTTP request-framing, cache, and authentication-protocol hunting classes for HTTP-protocol and auth targets |
CLIENT-SIDE.md |
DOM-injection, messaging-trust, UI-redress, and prototype-pollution hunting classes for client-side/browser targets |
SUPPLY-CHAIN-AND-RELEASE.md |
Dependency, CI, release, signing, update, plugin, and extension hunting classes |
CLOUD-AND-DEPLOYMENT.md |
IAM, infrastructure-as-code, container, serverless, ingress, and runtime-configuration hunting classes |
PROTOCOLS-RPC-AND-MESSAGING.md |
RPC, serialization, queue, broker, webhook, and streaming-protocol hunting classes |
RESOURCE-EXHAUSTION-AND-AVAILABILITY.md |
Shared resource, quota, queue, worker, and operator-spend hunting classes |
DATA-ISOLATION-AND-LIFECYCLE.md |
Tenant isolation, cache, search, export, backup, migration, deletion, and restore hunting classes |
DESKTOP-MOBILE-AND-LOCAL-IPC.md |
Native app, deep-link, webview, exported-component, helper, daemon, and local-IPC hunting classes |
VALIDATION-AND-REPORTING.md |
Phases 3–6 candidate validation, structured output, record verification, and reporting |
report-schema.json |
JSON schema for all three findings.json verdicts |
validate-findings.cjs |
Zero-dependency validator for findings.json in Phases 4 and 5 |
validate-findings.test.cjs |
Findings-validator tests and producer-compatible fixture checks |
validate-coverage-ledger.cjs |
Zero-dependency validator for coverage-ledger.json in Phases 1–5 |
validate-coverage-ledger.test.cjs |
Coverage-ledger validator tests |
Install the skill with the Skills CLI:
npx skills add https://github.com/cloudflare/security-audit-skill \
--skill security-audit
Use --global for a user-level installation:
npx skills add https://github.com/cloudflare/security-audit-skill \
--skill security-audit \
--global
Run npx skills --help for agent-selection and non-interactive options.
Start your coding agent in (or pointed at) the codebase you want to audit, then ask it to do a security audit:
security audit this codebase
find security vulnerabilities in ./src
do a security review, output to ~/audits/my-project
The skill activates automatically when the request matches its trigger (security audit, find vulnerabilities, pen-test the code, etc.). A direct codebase audit or pen-test request uses full audit mode. Security questions and focused vulnerability work use guidance mode unless you request report artifacts. In full audit mode, an unspecified output directory defaults to ~/security-audit-skill/<repo-name>/run-<N>. The workflow writes inside the target repository only when you explicitly select a directory that version control ignores.
-
A coding agent with a model that supports tool use and parallel sub-agents
-
Node.js for the zero-dependency findings and coverage-ledger validators
-
An OS-enforced sandbox for target-controlled builds, tests, processes, browsers, emulators, fuzzers, and fixtures. It must disable external networking, use a sanitized allowlisted environment, enforce resource limits, and allow writes only to assigned scratch paths. Without these controls, the workflow keeps the lead as
needs_validationinstead of executing target code. -
Only confirm established boundary failures. Keep a source-grounded blocked lead as
needs_validationwith its exact unresolved fact. -
Adversarial validation. The agent that checks a finding is never the agent that found it.
-
Severity requires impact. Likelihood x impact, not deviation from a checklist.
-
Defense-in-depth gaps are not vulnerabilities. If Layer A prevents the attack, the absence of Layer B is a hardening note.
-
Multiple runs improve coverage. In our test runs, a single run found roughly half of the vulnerabilities that repeated runs found in total.
Questions, feedback, or comparing notes on AI-driven security tooling: security-ai-research@cloudflare.com
MIT -- see LICENSE.