Blog
Cloudflare security audit skillAI security audit codebasehunter validator agents

How to Run Cloudflare's Security Audit Skill on Your Code

Use Cloudflare's open-source security audit skill with a coding agent: hunters flag exploits, validators try to disprove them, then you prove and patch.

Portrait of Luis Chavez-Mattos
Edited by Luis Chavez-Mattos, Director, Product··RSS

For Security and Engineering

A man in a vintage jersey dissolves into a motion streak while holding a crisp fan of printed report pages.

How do I use an AI coding agent to find and fix vulnerabilities in my app?

Install Cloudflare's open-source security audit skill into your project, then tell your coding agent to run a full security audit. The skill sends many "hunter" agents through your code to flag anything that might be exploitable. A separate "validator" agent then tries to disprove each flag. Whatever survives is a real candidate. You prove it with a test, fix it, and open a pull request. It is the same process attackers use with AI, run by you first.

TL;DR

  • Attackers now use AI to find flaws quickly, so the practical defense is to run the same hunt on your own app first.
  • The workflow has two roles: a hunter that casts a very wide net, and a validator whose only job is to disprove each finding.
  • Cloudflare's open-source skill packages that whole process and installs with a single npx command (the exact command is in the skill's readme).
  • A real run on a large open-source project used 18 hunters and ended with one low-severity finding, which is a normal and healthy result.
  • A finding that survives validation is not yet proven. Write a test that reproduces it, then fix it in the same session.
  • Decide your audit rhythm in advance: on every pull request, on a weekly schedule, or both.

Why should I hack my own app first?

The pace of attacks has changed. The video this article draws on cites two examples. The FBI recently warned about a hacking agent that can go from choosing a target to full privileged access on a machine in under three hours. A researcher also used a coding agent to find a critical vulnerability in the Java programming language in about an hour. The same source mentions a PHP vulnerability that had gone unnoticed for years until AI-assisted searching surfaced it.

AI is not behind every attack, but it lets people search wider and deeper than before. If attackers can move that fast, waiting for an annual review is a weak plan. The idea is simple: go through the same process an attacker would, before your app reaches production, and patch what you find.

This does not replace other security measures. It is one universal habit that works no matter what you are building.

How do attackers find vulnerabilities with AI?

They use two kinds of agents, in sequence.

  1. The hunter. One agent combs through the application and its source code, if available. It flags anything that even loosely resembles an exploit, including things it is not confident about. Breadth matters here because real exploits tend to be subtle.
  2. The validator. For every item the hunter flagged, a separate agent plays devil's advocate and tries to prove it is not actually an exploit. If it cannot disprove it, the finding stays on the list.

Most of what the hunter flags is junk, and the validator throws it out. That is the point. The researcher who found the Java flaw reportedly followed this pattern: the hunter produced a lot of noise, the second agent disqualified most of it, and one real finding was left to confirm.

Cloudflare's write-up on its own approach makes the key design rule explicit. The validator cannot log findings of its own. Its sole job is to aggressively disprove the hunter's theory. If a hunter grades its own homework, it will confidently validate everything it produces.

What five questions should the hunter ask?

The hunter needs a frame. These five questions are what attackers ask constantly. The list is not exhaustive, but it is comprehensive, and you do not need the answers yourself.

  1. Can someone get in who should not be able to, through logging in or logging out?
  2. Can one user see another user's data in any way?
  3. Are any passwords or API keys exposed, whether in the app, the source code, the database, or anywhere else?
  4. Can a stranger trick the AI inside your app? A message or a GitHub issue used as input could carry a prompt injection attack (hidden instructions that make the AI do something you did not intend).
  5. Can someone run up your bill or crash your application?

If you build or manage anything with logins, customer data, or an AI feature, these are the right five worries.

How do I install and run Cloudflare's security audit skill?

A "skill" is a packaged set of instructions that a coding agent such as Claude Code can load when a task calls for it. Cloudflare open-sourced a security audit skill that follows the hunter and validator process described above. The source reports it had almost 80,000 stars on GitHub. Cloudflare also published a blog post explaining how it finds, proves, and patches vulnerabilities, and the skill is built on those strategies.

The steps:

  1. Open the repository (the project folder) you want to audit in your coding agent's terminal.
  2. Run the install command from the skill's readme. It is a single npx command, like any other skill you add to a coding agent. Copy it from the readme rather than from a third-party article, since commands change.
  3. Tell your agent you want a full security audit. It should recognize that the skill applies. You can also name the skill explicitly.
  4. Say where the report should be saved.
  5. Decide whether you have a sandbox. A sandbox is an isolated machine where it is safe to run exploit attempts. If you have one, the skill can use it to prove exploits automatically. If not, tell the agent not to run exploits.

A sample prompt you can adapt:

Use the Cloudflare security audit skill to run a full security audit
of this repository. Write the final report to ./security-report.md.
There is no sandbox on this machine, so do not execute any exploits.
Run the hunters and validators only, and list what could not be disproven.

If you are not a developer, this is a request to hand to your engineering team, along with the five questions above.

What does a real audit run look like?

The creator ran the skill on Archon, his largest open-source project. A few things stand out.

  • It is noisy, and that is fine. On a decent-size codebase the terminal fills with files being written and sub-agents starting. That means the audit is being thorough.
  • It starts with recon. A couple of reconnaissance sub-agents gather context so the skill knows how many hunters it needs and how to prompt each one.
  • It runs in parallel. It first started 12 hunters, then invoked more after those finished, for 18 in total. Think of them as one hunter split up for speed.
  • There is one validator per finding. Each potential exploit gets its own devil's advocate.
  • The result was small. One issue survived, and it was low severity. For a mature project, that is a good outcome. A long list of serious bugs would be the worrying result.

The surviving finding was in the authentication service, which handles logging in and out. Note that "survived" does not mean "proven." Without a sandbox, the audit only checked the code on paper.

How do I prove a finding and fix it?

Start a separate session so the work is clean, and give the agent the report, since it has no context otherwise. Then prove the bug before you change anything.

In the example, the agent wrote a test that did four things: logged in with a dummy username and password, saved the session cookie, logged out, and then sent the saved cookie to the app's verify endpoint. If the app still treated that old cookie as valid after logout, the bug is real. The test showed that it was.

How you prove a finding depends on the finding. Options include unit tests, integration tests, or having the agent walk through the app as a user would. After proving it, the agent fixed the bug in the same session, and the work ended as a pull request (a proposed code change that someone reviews before it is merged). That closes the loop: hunt, disprove, prove, patch.

How often should I run a security audit?

The source leaves this up to you. You can run it on every pull request, on a schedule such as once a week, or both. Here is a reasonable way to think about it.

RhythmGood forTrade-off
Every pull requestCatching new flaws as they are introducedA full audit of a large codebase is a big task, so this can be slow and costly
Weekly scheduleSteady coverage with predictable effortA flaw can sit for days before it is caught
Before a launch or after big changes to login or permissionsThe riskiest momentsDoes nothing between those events

My suggestion, not a rule from the source: pick one baseline rhythm and add an extra run whenever you touch login, permissions, or anything that handles secrets.

What are the limits of this approach?

  • The audit finds what the agent can reason about in code. It does not replace penetration testing, secure design, or a security review by people.
  • Without a sandbox, findings stay unproven until you test them yourself.
  • Hunters over-report on purpose, so expect most flags to be discarded. Do not read a long hunter log as a long list of problems.
  • You still need to read the report and the fix. An agent that writes the patch can also get it wrong.

Could I build my own audit tracker instead of using a spreadsheet?

Findings from each audit need an owner, a severity, a status, and a date, and that quickly outgrows a pasted report. With Remy, you can describe a small internal tool in plain English, such as a findings tracker with severity levels, assignees, a "proven / fixed / verified" status, and a role-based login so only your team sees it, and have it built and deployed as a full-stack app. Remy apps are standard TypeScript in a git repository you own, so you can point a coding agent and the Cloudflare skill at that code like any other project.

Frequently Asked Questions

5 questions

Do I need to be a developer to use this?

The skill runs inside a coding agent in a project's repository, so someone comfortable with a terminal needs to run it. Non-developers can still drive the process by asking their engineering team to run the audit and by supplying the five questions as the focus.

Does the audit run real attacks against my app?

Not by default in the example shown. The creator told the agent there was no sandbox and not to execute exploits, so the run only did hunting and validation on the code. If you have a sandbox, the skill can use it to prove exploits automatically.

What if the audit finds nothing?

That is a good result. The example run on a mature open-source project found a single low-severity issue after 18 hunters. A clean or near-clean report suggests the obvious problems are handled, though it does not guarantee your app is secure.

Why does a separate validator matter?

A hunter that reviews its own findings tends to confirm all of them. Cloudflare's design gives the validator one job, which is to disprove the hunter's theory, and it cannot log findings of its own. That separation filters out noise so you spend time only on what survives.

Where do I find the install command?

In the skill's readme on GitHub. The command is a single npx install, the same kind used for other coding agent skills. Use the readme version, since it will stay current.

How we source, write, and correct our articles. Editorial standards

Related articles

Straight to your inbox.
New pieces as they publish. No noise.