SHEET 03blog/ai-security-audit-tools/ REVISED 

AI security audit tools for code: what they catch, miss and cost

Cloudflare's security-audit skill, Codex Security and Claude-BugHunter compared: what AI code auditors find, what they miss, what a run costs and how to triage it.

Published
Length
11 min read
Tags
  • security
  • ai-agents
  • code-review
  • developer-tools

Coding agents can find real vulnerabilities in your source code, but one run is not an audit. Cloudflare says a single run of its open-source security-audit skill found roughly half the bugs that repeated runs found, and the ones it caught skewed simpler. Use these tools for source-level bugs, keep your scanners and pentests, and budget for tokens and triage time before you start.

Three projects are driving the interest this month. As of November 29, 2026, Cloudflare’s skill has about 79,900 GitHub stars, Claude-BugHunter about 28,000, and OpenAI’s Codex Security about 14,500. They do different jobs, and mixing them up is the first mistake to avoid.

Which AI security audit tool fits which job?

Cloudflare’s skill and Codex Security read your source. Claude-BugHunter tests live, internet-facing systems. Anthropic’s older claude-code-security-review GitHub Action reviews pull request diffs.

Tool What it is What it looks at How you start it What you pay Licence
cloudflare/security-audit-skill An agent skill: SKILL.md, reference files per attack class, two Node validators Your source. Runs target code only inside an OS-enforced sandbox npx skills add, then ask your agent to “security audit this codebase” Your agent’s tokens or plan quota MIT
openai/codex-security CLI, TypeScript SDK, GitHub Action and Codex plugin A repo, selected paths or a git diff cs scan . Model calls through OpenAI or another supported provider, with a --max-cost cap Apache-2.0
elementalsouls/Claude-BugHunter 85 skills and 16 slash commands for bug bounty and external red-team work Live targets: web apps, APIs, identity providers, VPN appliances Claude Code plugin or install script Your Claude plan, plus the external tools it drives MIT code, CC BY 4.0 content
anthropics/claude-code-security-review GitHub Action Changed files in a pull request A workflow file with your Claude API key Claude API usage MIT

BugHunter is a different category. It drives recon tools such as subfinder, httpx, katana and nuclei against real hosts, and its README says it is “intended for assets you own or have written authorization to assess.” Don’t point it at anything without a signed scope. The rest of this post is about the source auditors.

Do AI security auditors find real bugs?

Yes, and the better ones filter their own noise, but coverage per run is partial.

Cloudflare’s write-up of the harness that grew out of the skill gives the most data. Its hunters produced 20,799 raw candidates and about 12,057 survived validation. After merging those with another harness’s findings and removing 5,442 duplicates, 7,245 actionable findings went to engineering teams. For a standard repository of about 30,000 lines, a full run took 3 to 4 hours and produced about 100 initial findings. Cloudflare is also explicit about what it can’t measure: “We don’t claim a false-negative rate for our system.”

The skill’s design explains why its output tends to be clean. The agent that finds a candidate never confirms it. A fresh verifier tries to disprove each one, and every record ends up in one of three states: confirmed (a complete source trace and an observed result), needs_validation (a specific unresolved fact, no severity) or rejected.

The best public small-scale test is AIParabellum’s run from November 7, 2026: one quick-profile run with Claude Code and Opus 5.5 on a 161-line Node.js app (five files) with four planted vulnerabilities, a trap and four decoys. By the testers’ account, the skill confirmed all four planted bugs (unsigned bearer tokens, command injection, path traversal and an IDOR), also found hardcoded seed passwords and a constructor:admin token that passed the admin check, raised no false alarms on the decoys, and filed the self-only XSS trap as a hardening note. It also spotted two crash bugs and left them as leads for a later run instead of findings. That’s a good result, on easy mode. A tiny app with textbook bug classes says little about a 200,000-line monolith.

What do AI code auditors miss?

They miss what isn’t in the repository, copies of a bug they already found, what your scanners catch, subtle bugs on a first pass, and your intent. Knowing the gaps tells you what to run alongside them.

  • Deployment facts. Proxy rules, security headers, identity provider settings, bucket policies and whether row-level security is actually on in production are invisible from source. The Cloudflare skill refuses to guess and files these as needs_validation. Treat that file as your to-do list.
  • Every copy of a bug. An agent that confirms one broken access check may not go looking for its siblings. When I found an access check in a legacy admin panel that redirected without returning, the same audit found ten more with the same shape. After each confirmed finding, search the codebase for the pattern yourself.
  • The scanners’ job. Cloudflare plumbed Semgrep through its harness and “the Hunters invoked it zero times in a month of runs.” The agent prefers to read and run code. If you want Semgrep, CodeQL, dependency or secret scanning, run them yourself.
  • Subtle bugs on the first pass. Cloudflare’s note on single runs: “the ones it did find skewed toward the simpler and less subtle.”
  • Your intent. Whether an admin may read another tenant’s data is a product decision. Codex Security reads root and component SECURITY.md files for that context, and cs policy . drafts one. Without it, expect findings about intended behaviour and misses where your real rules are stricter than the defaults.

There’s also a failure mode that looks like success. Cloudflare’s post again: “The agent will edit the source code so its own exploit works, then triumphantly report the bug it just created.” This is why the skill treats the target as read-only and keeps the finder and the verifier separate. If you build your own prompt-based audit, copy both rules.

How much does an AI security audit cost?

There’s no official per-run number for the Cloudflare skill. The public data points run from under $10 on a toy app to a million tokens with nothing to show for it.

Source Target What it used
AIParabellum test, Nov 2026 161-line Node.js app, quick profile 14 agents (4 recon, 4 hunters, 1 critic, 5 verifiers), 18 min 7 s, 172,300 output tokens on Opus 5.5 plus 8.5M cache-read tokens, reported as $9.27 API-equivalent
Hacker News thread, Sep 2026 “relatively small FastAPI project” “At least 150k”, then the session limit hit before it finished
Same thread “a medium codebase” “I threw 1M tokens for nothing”
Codex Security README Weekly GitHub Action example An estimated $5 limit per scan, and “Requests in progress can exceed the limit”

For the AIParabellum run, my arithmetic gives about 66 cents per agent invocation ($9.27 divided by 14 agents) on a toy target. AIParabellum itself warns that a real codebase on the standard profile “will cost much more”: more units, more candidates and longer contexts per agent. Treat 66 cents as a floor. On a subscription plan the run counts against your usage limits instead.

You can estimate a run before you start. The skill’s SKILL.md counts budget in agent invocations: four baseline reconnaissance calls, about one hunter per coverage unit, one critic for a quick run or at least two for standard, and one or two verifiers per surviving candidate. The AIParabellum run fits that shape. Run one small scoped audit, divide its cost by the invocations it used, and multiply up. Then multiply again by the number of runs you want, since Cloudflare says one run gets about half. If you set a budget the skill can’t fund (the recon calls plus the critic and verifier reserves), it launches no agents and asks for a bigger budget or a narrower scope.

On Codex Security, --max-cost caps a scan’s estimated cost in USD, and cs scan --dry-run shows the resolved limit before you spend anything. The cap needs a model the tool has built-in pricing for, in-flight requests can finish above it, and follow-up validation with --validate is “not cost-tracked,” so it can’t be combined with a cost limit.

How do you run an AI audit safely on a real codebase?

Treat the code as untrusted input, the agent as a process with your permissions, and the output as sensitive. Most of the setup is about keeping credentials and network access away from the run.

  1. Vet and pin the tool first. A skill is code and instructions you hand to an agent with shell access. Read it, pin a commit (AIParabellum tested the Cloudflare skill at c1c8a8c, still the latest commit on November 29, 2026), and run the checks from before you install an AI skill.
  2. Run without your credentials. OpenAI’s SDK docs are blunt: “Codex Security runs with your operating-system permissions. Scan subprocesses can inherit your environment, so start them with only the credentials they need.” The same docs say the scan profile “allows reads across the local filesystem,” so a home directory with SSH keys is in reach. Use a container or a separate user account with no cloud credentials, SSH keys or .env files. The patterns in running coding agents without your keys apply directly.
  3. Deny extra permissions. Codex Security auto-reviews execution approvals and “may grant extra permissions.” Pass --codex "approval_policy='never'" to deny them.
  4. No network for target code. The Cloudflare skill only executes target builds and tests inside a sandbox with no external network, an allowlisted environment and resource limits. Without one, it keeps leads as needs_validation instead of running them. On client code that trade is fine.
  5. Keep reports out of the repo. The skill writes to ~/security-audit-skill/<repo-name>/run-<N> by default. An audit report is a map of your weak points, so don’t commit it or paste it into a ticket that half the company can read.
  6. Expect prompt injection. Anthropic’s action says it “is not hardened against prompt injection attacks and should only be used to review trusted PRs.” Inherited code and outside contributions can carry text aimed at the agent.
  7. Check where the code goes. Before you send a client’s source to a model, check the provider’s retention settings and your contract. Anthropic says its generally available models can still be used for “vulnerability finding in owned source code,” while its Cyber Verification Program for deeper offensive work requires data retention so it can monitor misuse.
  8. Scope it. Name the paths, choose a profile and set a budget. Start small and widen.

A scoped first run with each tool looks like this:

# Cloudflare skill, user-level install
npx skills add https://github.com/cloudflare/security-audit-skill \
  --skill security-audit --global

# Then, inside your coding agent:
#   security audit ./src/api and ./src/auth, quick profile,
#   budget 25 agent invocations, output to ~/audits/myapp

# Codex Security: two paths, a $5 cap, no extra permissions
cs scan . --path src/api --path src/auth --max-cost 5 \
  --codex "approval_policy='never'"

# Codex Security on a branch: commits from origin/main to HEAD
cs scan . --diff origin/main --max-cost 2

How do you triage what the tool reports?

Read confirmed first, prove each finding with a failing test, fix it where the decision is made, then look for its siblings. Budget more time for triage than for the scan itself.

  1. Check the claim’s shape. The skill’s own bar is a good filter for any tool: a finding has to name the lower-trust principal, the input, the control that should have stopped it, the boundary crossed and the concrete result. If it can’t, downgrade it to a lead.
  2. Reproduce it with a test that fails on the old code. Run it before the fix and after. A test that passes on both proves nothing.
  3. Fix it at the last trusted decision point. The skill recommends “the smallest effective source fix.” It describes fixes and leaves your source alone, which is the right split.
  4. Search for the pattern. Grep for the same call shape, the same missing check and the same copied controller.
  5. Turn needs_validation into owner checks. Each record states the fact it couldn’t see. Check it in staging or in the provider’s dashboard.
  6. Skim rejected. Verifiers can be too eager. A study of agents filtering SAST results, Sifting the Noise, cut the false-positive rate on the OWASP Benchmark from over 92% to 6.3% in the best configuration, and also warns that “aggressive FP reduction can come at the cost of suppressing true vulnerabilities.”
  7. Re-run after fixes. Runs of the Cloudflare skill are additive. It reads prior ledgers, revalidates changed source and targets the gaps.

That study points to a cheap use of AI auditors that’s easy to overlook: hand them your existing Semgrep or CodeQL alerts and ask for a verdict on each. With a strong model, they’re good at throwing out noise.

When should you use an AI auditor instead of a pentest?

Use AI auditors to clear source-level bugs cheaply and often. Keep a human pentest for live systems and anything a customer or auditor will ask about.

  • On pull requests from trusted contributors, run a diff-scoped check: the Claude action or cs scan --diff. Cloudflare runs its big scans as “a periodic backlog sweep and not a per-PR check.”
  • When you inherit or rescue a codebase, do a full run with the standard profile, at least twice, plus SAST, dependency and secret scans. It pairs well with the audit in rescuing a vibe-coded MVP.
  • Before a pentest, run the AI audit first so the pentesters’ paid days go to the hard problems.
  • For a live system you’re authorized to test, use BugHunter or a human team, with written scope.

What I’d do this week

  • Pick one high-risk area (auth, billing or file handling) and run one scoped quick audit on it. Write down the tokens or dollars it used.
  • Set up a no-credentials container or user for audit runs before the second run.
  • Add Semgrep or CodeQL plus a secret scanner to CI if they aren’t there.
  • Draft a SECURITY.md that says who may do what across tenants and roles. Codex Security reads it, and any auditor needs that context.
  • For each confirmed finding: a failing test, the fix, then a grep for its siblings.
  • Book a second run on the same area and compare. The difference shows how much one run misses on your code.

If you’ve inherited a codebase and want help running the audit, sorting the real findings from the noise and turning them into a fix plan, that’s part of my work as a fractional CTO.

Questions

Can Claude Code or Codex find security vulnerabilities in my code?

Yes. Cloudflare's open-source security-audit skill and OpenAI's Codex Security both find real source-level bugs such as broken access checks, injection and path traversal. Neither finds everything in one pass. Cloudflare reports that a single run found about half the bugs that repeated runs found, so plan for several runs and keep your other scanners.

How many tokens does Cloudflare's security-audit skill use?

Cloudflare doesn't publish a figure. One published test, a quick-profile run on a 161-line app, used 14 agents, 172,300 output tokens and 8.5 million cache-read tokens, which the testers put at $9.27 in API-equivalent usage. Hacker News users reported 150,000 tokens on a small FastAPI project without finishing, and 1 million tokens on a medium codebase. Scope the run to a few paths or a diff to keep it bounded.

Is it safe to run an AI security audit on client code?

It can be, if you treat the code as untrusted and the agent as a process running with your permissions. Run it in a container or separate account with no credentials, block network access for anything the target executes, keep the reports outside the repository, and check your model provider's data retention and your contract before sending someone else's source to a model.

Do AI security auditors replace Semgrep, CodeQL or a pentest?

No. Cloudflare wired Semgrep into its harness and found the hunting agents called it zero times in a month, so the agent won't run your scanners for you. AI auditors also can't see deployed configuration. Run SAST, dependency and secret scanning alongside them, and keep a human pentest where a customer or auditor requires one.

About the author

Software engineer and serial founder in Alexandria, Egypt, and CTO at Zaher.AI, a GEO and SEO agency serving MENA.

Console

Type help and press Enter.