Cloudflare security-audit: Audit Your Repo in 6 Phases
Cloudflare's security-audit skill has Claude Code or Codex audit your repo in six phases. Install it, scope a first audit, and read its three verdicts.
Cloudflare’s security-audit lets Claude Code or Codex review your own codebase. The skill bundles instructions and helper scripts for a six-phase review. Each lead goes to a different agent for verification, and the report separates confirmed bugs from leads that still need evidence.
I checked the README and
SKILL.mdon December 2, 2026, against the September 15 (Taipei time) revision of cloudflare/security-audit-skill, commitc1c8a8c. The examples use skills CLI 1.9.1, and the installedSKILL.mddescribes the workflow for the revision you get.
The Public Skill Reviews One Repo at a Time
Cloudflare released security-audit under the MIT license. The README traces Cloudflare’s internal vulnerability scanner back to the skill it used on one repository. The internal system later expanded to check across repositories.
The skill uses your existing agent’s model and quota. The README requires an agent that can call tools and delegate to subagents in parallel. Its two output validators need Node.js.
If you’ve used OpenAI’s cs scan, that’s a standalone command-line tool with its own setup and reporting. See the Codex Security tutorial.
I treat this as a source-code review. Under SKILL.md, any verification stays local, and deployed services are outside the scope. A formal penetration test is separate work.
Who Does What in the Six-Phase Review?
Under the write-isolation rules in SKILL.md, the main agent coordinates the review and is the only one that writes shared files. Subagents read the code and check the leads. The three branches in the diagram are the possible outcomes of the first verification.
flowchart TD
A[Recon and ledger] --> B[Hunt by unit]
B --> C[Fresh agent verifies]
C --> D{Verdict}
D --> E[confirmed]
D --> F[needs_validation]
D --> G[rejected]
E & F & G --> H[Write findings.json]
H --> I[Fresh agent rechecks]
I --> J[Write reports]
The coverage ledger, coverage-ledger.json, tracks which parts of the repo each review has reached. The first phase maps the code’s structure, inputs, and trust boundaries, where access or privileges change. Coverage checks look for entry points the ledger missed.
The first verifier checks whether the lead holds up. The second pass checks the source locations and evidence in findings.json before those records go into the report.
Without the Required Sandbox, the Review Stays Source-Only
Under SKILL.md, building the project, running tests, and executing code all require an OS-enforced sandbox. The sandbox must meet these conditions.
- Block external network access.
- Start with an empty environment and load only allowlisted environment variables.
- Keep the code and toolchain read-only and allow writes only in assigned scratch directories.
- Cap CPU, memory, process count, file size, disk use, and runtime.
If any of those controls is missing, the review stays source-only. Leads that depend on running code go under needs_validation, along with the missing condition.
I think those controls are a lot to ask of a typical development environment. Even for a source-only review, I’d restrict the agent’s access to SSH keys and tokens. The Claude Code sandbox guide shows how.
Project settings in an unfamiliar repo can trigger commands before the review begins. Here’s what Claude Code and Codex run when you open an untrusted repo.
According to SKILL.md, usage grows with the number of units to review and leads to check. I’d start with code I know well. It’s easier to spot missing evidence when you already know how the code works.
Reports go outside the repo by default. They include vulnerability locations and reproduction details, so check who should see the report before sharing it.
Step 1. Install the Skill and Check Its Commit
skills is a command-line tool that installs skills in the Agent Skills format. I pin the CLI version, name the agent, and set DISABLE_TELEMETRY=1 to turn off its usage stats. From the root of the project you want to audit, install it for Claude Code:
1
DISABLE_TELEMETRY=1 npx -y skills@1.9.1 add cloudflare/security-audit-skill --skill security-audit --agent claude-code -y
For Codex, change the agent to codex:
1
DISABLE_TELEMETRY=1 npx -y skills@1.9.1 add cloudflare/security-audit-skill --skill security-audit --agent codex -y
I tried both installs in an empty project. The Claude Code copy was in .claude/skills/security-audit and the Codex copy in .agents/skills/security-audit.
Both installs created skills-lock.json at the project root. Here’s an excerpt of the entry for security-audit.
1
2
3
4
5
{
"source": "cloudflare/security-audit-skill",
"commit": "c1c8a8c1471069fb0e188eeaff69b8e8db6564a8",
"skillPath": "skills/security-audit/SKILL.md"
}
The commit field records what you installed. Compare it with the revision in the note at the top.
A project-level install leaves the skill directory and skills-lock.json in the repo. The README also documents user-level installs.
The skills CLI warns that a skill can use your agent’s existing permissions. Review the skill’s files before you use it.
I checked this commit. It contains two validators and their tests, along with documentation, the license, and a JSON schema that defines the report format.
Those scripts use the built-in Node.js modules fs, path, and util. For the permissions to check when adding third-party tools, see Agent Skill and MCP security risks.
The uninstall command removes the copies from the agent directories and updates skills-lock.json.
1
DISABLE_TELEMETRY=1 npx -y skills@1.9.1 remove security-audit -y
Step 2. Distinguish Guidance From a Full Audit
Under SKILL.md, general security questions and focused code reviews use guidance mode. A full audit produces report files. If the request could mean either, the agent asks which mode you want.
| Request | Mode | Writes report files? |
|---|---|---|
| Ask about specific code or investigate a known issue | Guidance | No |
| Request a full review or an audit report | Full audit | Yes |
The README gives three examples that specify the scope or report location.
1
2
3
security audit this codebase
find security vulnerabilities in ./src
do a security review, output to ~/audits/my-project
SKILL.md describes three review profiles. They differ in scope and how much code gets a second look.
| Profile | What to expect in the report |
|---|---|
quick | Partial coverage from a single pass |
standard (default) | Coverage checks across passes, with any gaps reported |
deep | More narrowly defined review units, with a second independent pass over units a previous audit covered whose source hasn’t changed |
A report can also cover a directory, a subsystem, or the changes between two commits.
The budget is optional. You can set one, or the main agent may propose one for a large target. It’s measured in agent calls, and if it runs out, the audit may still be incomplete.
The default report location is ~/security-audit-skill/<repo-name>/run-<N>, with the next available number as N. Output inside the repo requires a user-selected directory that version control ignores in full.
Step 3. Read the Scope Before the Findings
I start with the scope at the top of REPORT.md and the coverage summary at the end. Together, they tell you what the audit checked and what it skipped. An empty confirmed list means this run confirmed no vulnerabilities, not that the code has none.
| File | What you’ll find there |
|---|---|
REPORT.md | Scope, security summary, findings, hardening notes, and coverage |
FINDINGS-DETAIL.md | Source traces and reproduction records for confirmed bugs rated medium or higher |
NEEDS-VALIDATION.md | What’s missing from each lead and how to check it |
findings.json | Machine-readable records for all three verdicts |
coverage-ledger.json | The status of each review unit |
architecture.md | A map of the codebase and its trust boundaries |
run-metadata.json | Review scope, profile, budget, and commit |
The verdict tells you how far the evidence goes.
| Verdict | What the evidence shows | Severity rating? |
|---|---|---|
confirmed | A complete source trace and a concrete result observed locally | Yes |
needs_validation | The source points to an issue, but a key fact is missing | No |
rejected | Verification disproved the lead | No |
A needs_validation lead might depend on a deployment setting or on how a proxy behaves. Under SKILL.md, the report identifies the missing fact so the system owner can check the configuration or verify it in an isolated local environment.
rejected records stay in findings.json so a later review can recognize a disproved lead. New evidence can put the relevant code back up for review.
For a confirmed bug, the severity rating is capped at the impact the evidence shows. Under SKILL.md, critical means an unauthenticated attacker can execute code, access an entire data store, or take over arbitrary accounts.
For each confirmed bug, REPORT.md describes the impact, the rule the code needs to enforce, and the smallest fix. The hardening notes also point out protections already in place. The maintainer makes the changes.
Fix the Bugs, Then Revisit Coverage Gaps
After a fix, add a regression test that fails if the bug comes back. I’d then check the coverage ledger for any work the last review deferred.
According to the README, a repeat audit uses the previous coverage ledger and findings.json. In Cloudflare’s own tests, a single run found roughly half of the bugs found across repeated runs.
SKILL.md still requires earlier confirmed records to be checked again. If the relevant code has changed, the evidence has to match the current source.
Further Reading
- cloudflare/security-audit-skill: source, README, and SKILL.md.
- Build your own vulnerability harness: how Cloudflare grew this skill into its internal vulnerability harness.
- Codex Security Tutorial: Scan Your Own Repo With cs scan: scan a repo with OpenAI’s command-line tool.
- Claude Code Sandbox Setup: Keep SSH Keys and Tokens Out: keep agent commands away from keys and tokens.
- What Claude Code and Codex Run When You Open an Untrusted Repo: read this before auditing someone else’s repo.
- Agent Skill and MCP Security Risks: 5 Cases, a Checklist: a checklist before installing third-party skills.
- OWASP Agentic Top 10 Checklist: Audit Your AI Workflow: ten yes-or-no checks for your coding agent, MCP, and CI.
- How to Write an Agent Skill: SKILL.md, Triggers, Tests: what files a skill is made of.
