agentleFS
momentmakermomentmaker/kaijutsu/skills/core/security-audit/SKILL.md

security-audit

Skill3 starsChanged 6 months agoMITView on GitHub

Multi-agent security audit. Runs claude / codex / antigravity in parallel through three CVSS-aligned lenses (claude=auth+data flow, codex=injection+priv-esc, antigravity=dep+supply-chain). Wraps `jutsu swarm security-audit --pr <n>` (diff mode) or `jutsu swarm security-audit <path>...` (files mode). Output is a threat model with attack vectors + prioritized mitigations. --full mode defaults ON because security findings are high-stakes; the Pass-2 debate filters false-positives that would erode trust. Use when the user says "audit this for security", "threat model", "check for vulns", "review the auth flow", or invokes /security-audit.

  • Reads credentials

192 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use create-stories, story-done and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • lilangMaxSkill

    create-stories

    Break a single epic into implementable story files. Reads the epic, its GDD, governing ADRs, and control manifest. Each story embeds its GDD requirement TR-ID, ADR guidance, acceptance criteria, story type, and test evidence path. Run after /create-epics for each epic.

    Also in 11 projects that use this

  • lilangMaxSkill

    story-done

    End-of-story completion review. Reads the story file, verifies each acceptance criterion against the implementation, checks for GDD/ADR deviations, prompts code review, updates story status to Complete, and surfaces the next ready story from the sprint.

    Also in 11 projects that use this

  • nicepkgSkill

    community-led-growth

    Expert in community-led growth (CLG) - leveraging user communities to drive acquisition, retention, and expansion. Covers building developer communities, user groups, ambassador programs, and turning customers into advocates. Knows the difference between community as a feature vs community as a growth engine, and how to measure community ROI. Use when "community-led, CLG, ambassador program, champion program, user community, developer community, word of mouth, user group, " mentioned.

    Also in 5 projects that use this

  • nicepkgSkill

    ph-community-outreach

    Engage Reddit, Indie Hackers, Hacker News and other communities for Product Hunt launches. Use this skill to identify relevant communities, craft appropriate posts, and drive cross-platform engagement without appearing spammy.

    Also in 5 projects that use this

  • +7 more from lilangMax
  • +1 more from nicepkg

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 173 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before the first invocation in a repo:

    line 57
  2. Very specific:

    Default --max-cost $1.00. With 3 agents in --full --strict (the default), typical security-audit runs ~$0.30–1.00 depending on input size.

    line 122

“Common” is measured: kept by at least 6 in 10 of the 173 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

security-audit

Adversarial multi-agent security review. Different from pr-review's broad code review — security-audit's three lenses are explicitly InfoSec-shaped, the severity vocab is CVSS-aligned, and the output is a threat model rather than a code-review findings list.

How agents collaborate

LensAgentLooks for
Auth + data flowclaudeTrust boundaries, identity propagation, authorization vs authentication, data flow to sinks
Injection + priv-esccodexSQL/command/XSS injection, path traversal, SSRF, race conditions, crypto misuse
Dependency + supply-chainantigravityKnown CVEs, version drift, transitive trust, license compatibility

Severity vocab (CVSS-aligned):

  • critical — RCE, auth bypass, privilege escalation
  • high — data breach, integrity violation
  • medium — DoS, info disclosure, weak boundaries
  • low — defense-in-depth gap, timing leak
  • informational — worth noting but no exploitable path

Two input modes

# Diff mode — audit a PR
jutsu swarm security-audit --pr 42

# Diff mode — audit a local branch (no PR yet)
jutsu swarm security-audit --diff-from-branch origin/main

# Files mode — audit specific paths
jutsu swarm security-audit cmd/server/auth.go

# Files mode — audit a directory (multi-file concatenated)
jutsu swarm security-audit cmd/server/

# --quick to override the default --full mode
jutsu swarm security-audit --pr 42 --mode quick

# Iterate cheap on synth prompt
jutsu swarm security-audit --replay <key>

The two modes are mutually exclusive — passing --pr AND positional file paths errors with a "pick one" hint.

--full defaults ON

Unlike other presets, security-audit runs --full mode (with Pass-2 round-robin debate) by default. Security findings have asymmetric cost: false-positives erode user trust faster than missed issues. The debate round filters false-positives by having each agent critique its peers.

Override to --mode quick only when you're doing a fast first-pass scan.

First-run consent

Before the first invocation in a repo:

jutsu swarm security-audit --grant-consent

Persists allow-multi-model: true to .kaijutsu/security-audit.yaml. Diffs/files go to remote model providers; explicit consent required.

Important caveat for security-audit specifically: the input may contain code that itself contains secrets, vulnerabilities, or proprietary IP. The pre-flight secrets-scan blocks any obvious credential leaks (.env files, AWS keys, etc.) — but it doesn't catch every form of sensitive data. If the audit target has compliance or NDA constraints, consider running on redacted excerpts or skip security-audit entirely in favor of a self-hosted setup (Phase 3+).

Reading the output

### Threat model

#### Auth bypass via missing token validation — critical (3/3 reviewers)
- **Where**: `cmd/server/auth.go:42-58`
- **Attack vector**: Anonymous request with no Authorization header reaches the protected handler because the middleware short-circuits on err != nil.
- **Impact**: Full account takeover for any user whose ID an attacker can guess.
- **Mitigation**: Treat ErrTokenMissing as 401 explicitly; don't let the err-handling fall through.

#### SQL injection in search query — high (2/3 reviewers)
- ...

#### Stale dependency with active CVE — medium (1/3 reviewers, antigravity)
- ...

### Disagreements
- 1/N rows are usually the highest-leverage. The antigravity-only finding
  on the stale dep would have been missed by single-lens review.

The disagreement table (rendered separately) shows which lens caught what. For security-audit, 1/N findings ARE the value — single-lens review misses cross-lens vulnerabilities.

Cache + collision prevention

Cache key is salted with the preset name, so a pr-review --pr 42 and security-audit --pr 42 produce distinct cache dirs:

  • .kaijutsu/pr-review-runs/<sha>/ (pr-review of PR 42)
  • .kaijutsu/security-audit-runs/<sha>/ (security-audit of PR 42)

Same diff can be reviewed by both presets without overwriting either's cache.

Composes

Chain naturally with:

  • pr-review — ran first; security-audit is the security-specific deep dive when pr-review surfaced security-adjacent concerns
  • decide — record any security tradeoffs surfaced (e.g., "we accepted medium-severity timing leak because mitigation cost > impact")
  • dcg — already in the kaijutsu core; runtime guard for destructive shell commands. security-audit catches design-level issues; dcg catches execution-level ones.

Hard rules

  • Never --post-comment for security-audit. The --post-comment flag is NOT registered on this subcommand — posting vuln details to a public PR is a leak. If you need to share findings, route them through your team's private channels.
  • CVSS severities are not a substitute for triage. A "high" finding from security-audit is multi-model output, not an actual CVSS-scored vulnerability. Use the output as the seed for a real triage process, not as the final verdict.
  • --allow-secrets is even more dangerous here than for pr-review. The audited code likely contains credentials by definition (auth flows, key handling). Consider redacting before running OR running on a sandboxed snapshot.

When NOT to use

  • General code review — use pr-review.
  • Spec/design review — use doc-review.
  • One-line auth fix — overkill; manual review is fine.
  • Compliance-grade audit — multi-model heuristic review is NOT a substitute for a real security audit by a human auditor. Use security-audit as a fast first-pass only.

Cost

Default --max-cost $1.00. With 3 agents in --full --strict (the default), typical security-audit runs ~$0.30–1.00 depending on input size. The debate round adds ~50% to base cost; the strict-filter adds another synthesis call. Override --max-cost higher for big audits.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.