security-scan

security-scan is a command for Claude Code from kid-sid/claude-spellbook. It costs 0 tokens per session (916 once invoked), scanned A, original, MIT.

A code security review based on a checklist and OWASP, a widely used guide to common web-application security risks. It checks areas such as injection, login sessions, and permission handling.

In plain words
What is it for?
Run it to inspect SQL, command execution, template output, password storage, tokens, endpoint permissions, and resource-access checks.
Why use it?
It helps expose vulnerabilities in changed code or, when there are no changes, in the source directory. The review points to risky patterns that need developer attention.

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/kid-sid/claude-spellbook/security-scan
Clone the repo
git clone --depth 1 https://github.com/kid-sid/claude-spellbook

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-scan

README.md
[![agentmods](https://agentmods.dev/badge/commands/kid-sid/claude-spellbook/security-scan.svg)](https://agentmods.dev/commands/kid-sid/claude-spellbook/security-scan)
Your own site
<a href="https://agentmods.dev/commands/kid-sid/claude-spellbook/security-scan"><img src="https://agentmods.dev/badge/commands/kid-sid/claude-spellbook/security-scan.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 916 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.00000 $0.00916
Opus 5 $0.00000 $0.00458
Sonnet 5 $0.00000 $0.00183
Haiku 4.5 $0.00000 $0.00092

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

Security

Grade A, and why

security-scan 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 4d 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.

.claude/commands/security-scan.md · 104 lines

How it starts

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

Audit code against the security skill checklist and OWASP best practices.

Instructions

  1. Determine scope:

    • If the user specifies files/directories, scan those
    • If no scope given, scan git diff (staged + unstaged changes)
    • If no changes, scan the src/ directory
  2. For each file in scope, check against these categories:

A. Injection (OWASP A03)

  • SQL queries use parameterized statements, not string concatenation
  • No eval(), exec(), Function() with dynamic input
  • No shell=True or backtick execution with user input
  • Template rendering uses auto-escaping (XSS prevention)
  • LDAP, XML, and OS command inputs are sanitized

B. Authentication & Session (OWASP A07)

  • Passwords hashed with bcrypt/scrypt/argon2 (not MD5/SHA1)
  • Session tokens are cryptographically random, sufficient length
  • JWT secrets are not hardcoded
  • Token expiration is enforced
  • Failed login attempts are rate-limited

C. Authorization (OWASP A01)

  • Every endpoint checks authorization, not just authentication
  • Resource access verifies ownership (IDOR prevention)
  • Admin endpoints have explicit role checks
  • No privilege escalation through parameter manipulation
  • Default deny — new endpoints require explicit permission grants

D. Data Exposure (OWASP A02)

  • No hardcoded secrets, API keys, passwords, or tokens
  • Sensitive data not logged (passwords, tokens, PII)
  • Error responses don't leak stack traces or internal paths
  • PII is encrypted at rest
  • API responses don't over-expose fields (use DTOs/serializers)

E. Security Misconfiguration (OWASP A05)

  • CORS is restrictive (not * in production)
  • Security headers set (CSP, HSTS, X-Frame-Options, etc.)
  • Debug mode disabled in production configs
  • Default credentials changed
  • Unnecessary HTTP methods disabled

F. Dependencies (OWASP A06)

  • No known vulnerable dependencies (check lock files)
  • Dependencies are pinned to specific versions
  • No unnecessary dependencies with large attack surface

Read the full file on GitHub · 104 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. 4d ago First seen · 104 lines · 0 tokens per session scan A ae9cb1adcdcc

Subscribe to this mod's changes

security-scan is a command published in the GitHub repository kid-sid/claude-spellbook (187 stars, last pushed 29d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 916 tokens. 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-30.