security-audit

security-audit is a command for coding agents from halflength-ampleness75/claude-code-recipes. It costs 13 tokens per session (1,325 once invoked), scanned B, original, MIT.

A codebase security review based on the OWASP Top 10, a list of common web application security risks, plus checks for exposed secrets.

In plain words
What is it for?
Use it to inspect a project's technology stack, databases, authentication, external services, deployment setup, and common vulnerability areas.
Why use it?
It helps reveal missing access checks, unsafe data handling, weak cryptography, and credentials accidentally left in source code.

Command

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/halflength-ampleness75/claude-code-recipes/security-audit
Clone the repo
git clone --depth 1 https://github.com/halflength-ampleness75/claude-code-recipes

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/halflength-ampleness75/claude-code-recipes/security-audit.svg)](https://agentmods.dev/commands/halflength-ampleness75/claude-code-recipes/security-audit)
Your own site
<a href="https://agentmods.dev/commands/halflength-ampleness75/claude-code-recipes/security-audit"><img src="https://agentmods.dev/badge/commands/halflength-ampleness75/claude-code-recipes/security-audit.svg" alt="Measured on agentmods" height="20"></a>
Per session 13 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,325 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 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.00013 $0.01325
Opus 5 $0.00006 $0.00662
Sonnet 5 $0.00003 $0.00265
Haiku 4.5 $0.00001 $0.00133

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

Security

Grade B, and why

security-audit scanned grade B with 2 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 5d 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.

Downloads and executes remote codemediumSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

- Verify CI/CD pipeline integrity (no `curl | bash` patterns with unverified sources)

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- Verify CI/CD pipeline integrity (no `curl | bash` patterns with unverified sources)
commands/security-audit.md · 126 lines

How it starts

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

You are a security engineer performing an audit of this codebase. Systematically check for the OWASP Top 10 vulnerability categories and other common security issues.

Step 1 — Project Reconnaissance

Determine the project's tech stack:

  • Language(s) and framework(s) (check package.json, requirements.txt, go.mod, Cargo.toml, etc.)
  • Database(s) in use (ORM, raw SQL, NoSQL)
  • Authentication mechanism (JWT, sessions, OAuth, API keys)
  • External services and APIs
  • Deployment target (cloud provider, container, serverless)

This context determines which checks are relevant.

Step 2 — OWASP Top 10 Checks

A01: Broken Access Control

  • Search for routes/endpoints and verify authorization checks are present
  • Look for direct object references without ownership validation (e.g., /api/users/{id} without checking the caller owns that ID)
  • Check for missing role/permission checks on admin-only routes
  • Search for CORS configuration — look for overly permissive origins (*)
  • Check for path traversal in file operations (user input in file paths)

A02: Cryptographic Failures

  • Search for hardcoded secrets: grep for patterns like password\s*=\s*["'], secret, api_key, token, AWS_, PRIVATE_KEY
  • Check .env files are in .gitignore
  • Look for weak hashing: md5, sha1 used for passwords (should be bcrypt/argon2/scrypt)
  • Search for http:// URLs where https:// should be used
  • Check for sensitive data in logs (grep for console.log, logger, print near auth-related variables)

A03: Injection

  • SQL Injection: Search for string concatenation or template literals in SQL queries. Look for raw SQL that interpolates user input instead of using parameterized queries.
  • Command Injection: Search for exec, spawn, system, os.popen, subprocess with user-controlled input.
  • NoSQL Injection: Search for MongoDB queries built from user input without sanitization (e.g., $where, $regex from request body).
  • XSS: Search for dangerouslySetInnerHTML, innerHTML, v-html, |safe, mark_safe, or template rendering without escaping.

Read the full file on GitHub · 126 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. 5d ago First seen · 126 lines · 13 tokens per session scan B d0cf1d427652

Subscribe to this mod's changes

security-audit is a command published in the GitHub repository halflength-ampleness75/claude-code-recipes (2 stars, last pushed today), licensed MIT. It adds 13 tokens to every session and 1,325 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 2 findings (downloads and executes remote code, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.