Cloudflare's Security Audit Skill: A Pen Tester Inside Your Coding Agent

AI agents now write most of the code in many teams. The next question follows fast: how do you know the code is safe?

Ask the same agent to check its own work and you get a confident yes. Simon Høiberg makes this point in his video on seven free AI repos on GitHub: whoever does the work never gets to approve the work. Cloudflare’s security-audit skill builds the whole audit around this rule.

What the skill is

security-audit is an MIT-licensed skill for coding agents, published by Cloudflare. You install the skill, open your agent in a project and type “security audit this codebase”. The agent turns into an auditor and writes a report with machine-readable findings.

The skill seeded Cloudflare’s internal vulnerability discovery harness, described in Build your own vulnerability harness. The internal system grew into a fleet-wide, multi-stage pipeline. The public repo is the single-repo starting point. The repository has 80.5k stars. In the video, Høiberg notes almost 40,000 of those came in one month.

Why you need an audit skill

A plain “find bugs in my code” prompt fails in three ways:

  • The agent reads a few files and stops. Nobody tracks which parts of the code got checked.
  • The agent reports guesses as vulnerabilities. You spend hours on false positives.
  • The agent grades its own findings. Self-review agrees with itself.

The skill fixes each one. A coverage ledger tracks what got checked. A finding needs a full source trace to count as confirmed. A separate agent tries to prove every finding wrong.

How the audit runs

The audit has six phases.

  1. Reconnaissance. Agents map the architecture, trust boundaries, input surfaces and prior evidence. The output goes to architecture.md and coverage-ledger.json.
  2. Coverage-led hunting. Isolated hunters take units from the ledger. Each hunter goes after one class of attack and records each check. Coverage critics look for gaps.
  3. Candidate validation. Every unique candidate goes to a fresh verifier whose only job is to disprove the finding.
  4. Structured output. Findings land in findings.json and get validated against report-schema.json.
  5. Independent record verification. Fresh agents verify the final source claims. A material replacement gets another independent verifier.
  6. Target-neutral reporting. The skill writes REPORT.md, FINDINGS-DETAIL.md and NEEDS-VALIDATION.md from the verified records.

Two zero-dependency Node scripts guard the data. validate-coverage-ledger.cjs runs after every ledger update. validate-findings.cjs runs in phase 4 and after each phase 5 replacement.

Three verdicts

Each finding ends with one of three labels:

  • confirmed: a complete source trace and a bounded, observed result.
  • needs_validation: one exact unresolved fact, and no severity until someone resolves the fact.
  • rejected: a candidate the verifier disproved.

In the video demo, Høiberg ran the skill on a small demo app and got findings sorted into these three buckets. The split saves review time. You start with confirmed, check the open facts in needs_validation and skip rejected.

What the hunters look for

The skill ships one prompt file per attack area. The list covers more than web apps:

  • web protocols, request framing, caches and authentication
  • client-side DOM injection, messaging trust and prototype pollution
  • prompt injection and tool abuse in LLM-backed apps
  • supply chain, CI, release signing and plugins
  • cloud IAM, infrastructure-as-code, containers and serverless
  • RPC, serialization, queues and webhooks
  • tenant isolation, backups, exports and deletion
  • resource exhaustion and quota abuse
  • memory safety, binaries and kernels for native code
  • desktop and mobile apps, deep links, webviews and local IPC

Design rules worth copying

The README lists five principles. Each one works for human security reviews too.

  • Only confirm established boundary failures. A blocked lead stays in needs_validation with its open question.
  • The agent checking a finding never found the finding.
  • Severity comes from likelihood times impact. A missed checklist item alone carries no severity.
  • A missing second layer counts as a hardening note when the first layer already stops the attack.
  • Run the audit more than once.

The last rule has data behind the advice. In Cloudflare’s test runs, a single run found about half of the vulnerabilities all repeated runs found together. Runs are additive. A new run reads the previous ledger and findings, targets the gaps and rechecks changed source.

Installation

The skill installs through the Skills CLI. For the current project:

npx skills add https://github.com/cloudflare/security-audit-skill \
  --skill security-audit

For all projects on your machine:

npx skills add https://github.com/cloudflare/security-audit-skill \
  --skill security-audit \
  --global

Run npx skills --help to pick a specific agent or run without prompts.

Requirements

  • A coding agent whose model supports tool use and parallel sub-agents.
  • Node.js for the two validators.
  • An OS-enforced sandbox before the skill runs any target code: builds, tests, browsers, fuzzers. The sandbox needs external networking off, a clean allowlisted environment, resource limits and writes only to scratch paths.

Without the sandbox, the skill reads code only. Leads needing execution stay in needs_validation.

Usage

Start your agent in the codebase and ask:

security audit this codebase
find security vulnerabilities in ./src
do a security review, output to ~/audits/my-project

The skill has two modes. A direct audit or pen-test request runs the full audit. A security question or a focused review runs guidance mode, unless you ask for report files.

Full audits write to ~/security-audit-skill/<repo-name>/run-<N> by default. The skill writes inside your repository only when you pick a directory ignored by version control. Your source tree stays clean.

Costs and limits

  • A full audit spawns many sub-agents. Expect heavy token use on large codebases.
  • Agent findings need human review. Treat confirmed findings as strong leads, then fix and test them yourself.
  • One run covers about half of what repeated runs find. Budget for two or three runs on code you ship to production.