TLTan LeAI, cloud & automation for legacy systems · CalgaryLet’s talk
← All notes

Security skills for coding agents: what I installed, what I skipped, and why

Three ways to point an AI coding agent at security: Cloudflare's security-audit skill for my own code, Claude-BugHunter for offensive testing, and Codex Security for CI. What each one does and the guardrails I keep.

Tried itRan it myself on a demo or prototype.

A security tool for a coding agent can mean two very different things. One reads your own source code and reports what is wrong with it. The other probes a running system from the outside, the way an attacker or a bug bounty hunter would. I looked at three tools this week. I use one, I chose not to install one, and I am keeping the third for CI later.

The three tools at a glance

ToolWhat it looks atDirectionMy decision
Cloudflare security-audit skillYour codebaseDefensive, static reviewInstalled, tried on real repos
Claude-BugHunterLive targets on the internetOffensive testingRead it, did not install
Codex Security (cs)Your codebaseDefensive, CLI scanLater, for CI

Cloudflare security-audit: the one I use

A Claude Code skill that runs a multi-phase audit of a codebase and returns findings in a machine-readable format, each one checked on its own before it is reported.

Install for every project (what I did, so I can audit any repo without adding files to it):

npx skills add https://github.com/cloudflare/security-audit-skill --skill security-audit -g -a claude-code

Drop -g and run it inside a repo to install it only there. It then lands in that repo’s .claude/skills/, so watch that you do not commit it by accident.

If npx skills fails, install it by hand:

git clone https://github.com/cloudflare/security-audit-skill "$env:TEMP\sas"
# copy the folder that holds SKILL.md to:
#   %USERPROFILE%\.claude\skills\security-audit\

Restart Claude Code, type /skills to check it is there, then open Claude Code in the repo you want to check and say “security audit this codebase”.

The guardrails I add

  • One repo at a time. Open Claude Code inside the product repo itself, not a parent workspace folder, so the audit only reads product code.
  • Never let it run the app. To prove a finding, the skill may try to start the app. On one of my .NET APIs, dotnet run reads a production connection string and calls Database.Migrate() at startup. So every audit prompt ends with: “do not run the app or any database command; static analysis only.”
  • On Windows, nothing gets “proven”, and that is fine. Claude Code only has an OS sandbox on macOS, Linux and WSL2. On Windows the run-it-to-prove-it step does not happen, so findings come back as needs_validation instead of confirmed. For a repo that can reach production, I prefer it that way.
  • Read SKILL.md first. A skill is third-party text that sits in the agent’s context. I skim it once before I install it.

Lesson. A security tool that “validates” findings by running your code needs the same care as a new team member on day one. The safe default is static analysis, with a human deciding what gets run.

Claude-BugHunter: the one I skipped

A large Claude Code plugin (v2.1.0 when I read it): 85 skills and 16 slash commands. 58 of the skills are hunt-* skills built from 681 publicly disclosed HackerOne reports, one per bug class (XSS, IDOR, SSRF, OAuth, and so on). It adds attack playbooks for enterprise systems exposed to the internet (M365/Entra, Okta, SharePoint, vCenter, SSL VPN appliances) and reporting helpers such as a 7-question triage gate, CVSS scoring and PII redaction in evidence. Skills load by topic, so you never call them by name. A HackerOne account is optional.

It is an offensive toolkit, meant only for targets you are allowed to test: an in-scope bug bounty program, a pentest with a signed contract, or your own lab.

What I found when I read the repo, beyond the marketing line:

  • “Scope is locked in code, read-only by default” is true for the engine only. The Python engine (engine.py --hunt and the cbh CLI) enforces a default-deny allowlist, and state-changing proofs need an explicit --allow-intrusive flag. When the skills just load into a normal chat, they are knowledge in the context. Nothing in code stops the agent from sending a request out of scope. /autopilot --yolo removes most checkpoints.
  • The scope lock is still being hardened. On the day I read it, a scope bypass had just been fixed: a backslash in the URL authority (admin.example.com\@www.example.com) passed the check as one host while the request went to another.
  • Its own SECURITY.md says to review before trusting. Their lint checks structure and leaked secrets, not prompt injection. They recommend pinning to a reviewed tag instead of tracking main.
  • Small Windows catch: the bundled HackerOne MCP server starts with python3, which does not exist on many Windows machines.

Why I skipped it: I do not do bug bounty or external red-team work. Checking my own and my clients’ code is a code-review job, and the Cloudflare skill does that without putting attack playbooks into my agent’s context. If I ever take on an authorized pentest, I would read it again, pinned to a tag.

Codex Security: for CI, later

OpenAI’s security scanner as a CLI. It needs a paid OpenAI API key or a ChatGPT account.

npm install --global @openai/codex-security
cs login
cs scan .

A CLI that scans a folder is the shape that fits a CI pipeline, which a chat-driven skill is not. I have not run it yet.

How I choose

flowchart TD
  Q{What am I checking?} -->|My own source code| S[Static review]
  Q -->|A live system I am<br/>authorized to test| O[Offensive testing]
  S -->|Interactive, in Claude Code| A[Cloudflare security-audit]
  S -->|Every PR, in CI| C[Codex Security]
  O --> B[Claude-BugHunter<br/>pinned, scope file, read-only]

Takeaways

  • Decide the direction first: reviewing your code and attacking a running system are different jobs with different risk.
  • Every security skill is third-party code in your agent’s context. Read it, and pin it.
  • “Validate by running” is the riskiest part of any audit tool. On repos that can reach production, keep it static and say so in the prompt.