Cloudflare/Security-Audit-Skill
https://github.com/cloudflare/security-audit-skill📌 Cloudflare 開源:讓 Coding Agent 變成資安稽核員
TL;DR:Cloudflare 開源六階段安全稽核 skill,用對抗式驗證把 agent 的幻覺漏洞壓到最低。
讓 AI agent 幫你找程式碼漏洞聽起來很誘人,但沒有結構化流程約束,它很容易把「可能有問題」寫成「確認漏洞」。Cloudflare 開源的 security-audit-skill,正是為了解決這個信任問題而生。
🤔 從單一 repo 起步的稽核框架
這個 skill 是 Cloudflare 用來建構其漏洞發現框架(在部落格〈Build your own vulnerability harness〉中描述)的起點。原始的 harness 後來演化成一套多階段、跨整個機群的系統,而這個開源 skill 保留了最初單一 repo 版本的核心流程,讓任何使用 coding agent 的人都能套用同一套稽核方法。
🧩 六階段流程,責任分離是核心設計
整個稽核拆成六個階段:Reconnaissance(繪製架構、信任邊界、輸入介面,寫入 architecture.md 與 coverage-ledger.json)、Coverage-led hunting(依覆蓋清單指派獨立的 hunter agent,並用 coverage critic 找出遺漏)、Candidate validation(每個候選漏洞都交給一個全新的 verifier 嘗試證偽)、Structured output(產出 confirmed / needs_validation / rejected 三種紀錄,並用 schema 驗證)、Independent record verification(獨立 agent 再次驗證最終的來源證據,重大修改需再經一輪獨立驗證)、Target-neutral reporting(依驗證後紀錄產出 REPORT.md、FINDINGS-DETAIL.md、NEEDS-VALIDATION.md)。
三種判定的邊界很明確:confirmed 需要完整的來源追溯與有界限的實際觀測結果;needs_validation 代表存在一個明確但尚未解決的事實,且不給嚴重性評級;rejected 則是已被證偽的候選。設計原則上,Cloudflare 強調「只確認已證實的邊界失效」、「驗證漏洞的 agent 絕不是發現漏洞的那個 agent」、「嚴重性必須來自實際影響,而非偏離檢查清單」,以及「深度防禦缺口不算漏洞」——若上層防護已擋下攻擊,下層缺失只算加固建議。官方也提到,在他們的測試中,單次執行大約只能找到多次重複執行合計發現漏洞數的一半。
📌 怎麼用
透過 Skills CLI 安裝:
npx skills add https://github.com/cloudflare/security-audit-skill --skill security-audit
加上 --global 可做使用者層級安裝。安裝後,只要對 agent 提出類似「security audit this codebase」「find security vulnerabilities in ./src」的請求即可觸發。直接要求稽核或滲透測試會進入完整稽核模式;未指定輸出目錄時預設寫入 ~/security-audit-skill/<repo-name>/run-<N>,只有在明確指定且該目錄被版本控制忽略時,才會寫進目標 repo 內部。
⚠️ 執行需要沙箱環境,缺了它結果只能停在待驗證
這個流程需要一個支援工具呼叫與平行子代理的 coding agent、Node.js(跑零依賴的驗證腳本),以及一個系統層級強制隔離的沙箱,用於執行目標程式碼相關的建置、測試、fuzzing、瀏覽器與模擬器。沙箱必須關閉對外連網、使用清理過的白名單環境、限制資源,並只允許寫入指定的暫存路徑。若沒有這些控制,工作流程會把相關線索保留在 needs_validation,而不會去實際執行目標程式碼。
🎯 實務啟示
想在自己的程式碼庫上跑一輪 AI 資安稽核,這個開源 skill 提供了現成、責任分離明確的流程骨架,比自己臨時拼湊 prompt 可靠得多;但務必先準備好隔離沙箱,且官方也建議多跑幾輪以提升覆蓋率,別指望單次執行就能找齊漏洞。
🔗 來源
- 標題:Cloudflare/Security-Audit-Skill
- 作者/機構:Cloudflare(Hacker News 使用者 donk8r 提交)
- 連結:https://github.com/cloudflare/security-audit-skill
#Cloudflare #SecurityAudit #AIAgent #OpenSource #AppSec #VulnerabilityResearch #CodingAgent #DevSecOps #LLMSecurity #PenTesting
原始資料 Hacker News · 收集於 2026-09-17
摘要原文
security-audit 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. What it does The skill runs a structured audit in six phases: Reconnaissance -- map architecture, trust boundaries, input surfaces, prior evidence, and deterministic coverage in architecture.md and coverage-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 , and rejected records to findings.json and validate them against report-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 , and NEEDS-VALIDATION.md from 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. Files 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 Installation 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. Usage 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. Requirements 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_validation instead of executing target code. Design principles Only confirm established boundary failures. Keep a source-grounded blocked lead as needs_validation with 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. Contact Questions, feedback, or comparing notes on AI-driven security tooling: security-ai-research@cloudflare.com License MIT -- see LICENSE . (181 points, 36 comments on Hacker News)
由 claude-code/sonnet 自動生成