security-audit

security-audit is a command for Claude Code from alifanov/darkflow. It costs 22 tokens per session (1,430 once invoked), scanned A, original, MIT.

A scheduled security review for a software project that checks GitHub’s vulnerability and secret alerts, analyzes code, and checks the running application.

In plain words
What is it for?
Use it to find vulnerable dependencies, unsafe code, exposed secrets, and security problems in a live app.
Why use it?
It brings several security checks into one review and turns each important finding into a trackable task.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/alifanov/darkflow/security-audit
Clone the repo
git clone --depth 1 https://github.com/alifanov/darkflow

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for security-audit

README.md
[![agentmods](https://agentmods.dev/badge/commands/alifanov/darkflow/security-audit.svg)](https://agentmods.dev/commands/alifanov/darkflow/security-audit)
Your own site
<a href="https://agentmods.dev/commands/alifanov/darkflow/security-audit"><img src="https://agentmods.dev/badge/commands/alifanov/darkflow/security-audit.svg" alt="Measured on agentmods" height="20"></a>
Per session 22 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,430 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00022 $0.01430
Opus 5 $0.00011 $0.00715
Sonnet 5 $0.00004 $0.00286
Haiku 4.5 $0.00002 $0.00143

Measured 3d ago against content hash 6057af7276b5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

security-audit scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

templates/.claude/commands/darkflow/security-audit.md · 155 lines

How it starts

The opening of the file, as written. The whole thing — 155 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Weekly security pass. It covers both halves that used to be separate routines: what GitHub already knows (Dependabot, code scanning, secret scanning) and what only a reading of the code finds. The GitHub half is cheap and runs first — it is also the half that can already have a fix waiting.

The cost of folding the daily vulnerability-check into this weekly run is response time: a Dependabot advisory can now sit for up to seven days instead of one. Accepted knowingly.

Step 1 — Read project config

Load the project config (contract in .darkflow.d/claude.mdProject config). Uses: language.

Step 2 — GitHub alerts

REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner)

Fetch open alerts from all three surfaces. Any of them may return 404 or 403 when the feature is off or the token lacks scope — that means "no findings from that surface", not an error to stop on.

gh api -X GET "/repos/${REPO}/dependabot/alerts"      -f state=open --paginate 2>/dev/null || echo "[]"
gh api -X GET "/repos/${REPO}/code-scanning/alerts"   -f state=open --paginate 2>/dev/null || echo "[]"
gh api -X GET "/repos/${REPO}/secret-scanning/alerts" -f state=open --paginate 2>/dev/null || echo "[]"

Derive a stable identifier per alert — it is what dedup in Step 4 matches on:

  • Dependabot: security_advisory.ghsa_id + affected package name and version range
  • Code scanning: rule.id + file path + line
  • Secret scanning: secret type + the locations array — never the secret value itself

Step 3 — Code review

/security-review

Step 4 — Deduplicate, then file

Read every task in the project, not just this routine's own:

~/.darkflow/df task list --state all --format compact

The same weakness reaches two audits from two directions — a missing rate limit is a security finding and an architecture one — and filtering by --source would let it land twice. Skip a finding when it matches an existing task or one a human already closed without a merged fix (rejected). Re-file only when a previously-fixed problem has demonstrably regressed.

Read the full file on GitHub · 155 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 155 lines · 22 tokens per session scan A 6057af7276b5

Subscribe to this mod's changes

security-audit is a command published in the GitHub repository alifanov/darkflow (2 stars, last pushed 4d ago), licensed MIT. It adds 22 tokens to every session and 1,430 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.