sec-review

sec-review is a command for Claude Code from 0xrafasec/ai-workflow. It costs 0 tokens per session (1,456 once invoked), scanned A, original, MIT.

A command for reviewing code for security problems, either in changes compared with a Git branch or across a whole project. A branch is a separate line of development in Git.

In plain words
What is it for?
Use it for reviewing a diff against main or another branch, scanning all source files, or limiting a full security scan to one directory.
Why use it?
It gives a structured way to look for common security risks in either recent changes or the entire codebase.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: mentions subagents.

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/0xrafasec/ai-workflow/sec-review
Clone the repo
git clone --depth 1 https://github.com/0xrafasec/ai-workflow

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 sec-review

README.md
[![agentmods](https://agentmods.dev/badge/commands/0xrafasec/ai-workflow/sec-review.svg)](https://agentmods.dev/commands/0xrafasec/ai-workflow/sec-review)
Your own site
<a href="https://agentmods.dev/commands/0xrafasec/ai-workflow/sec-review"><img src="https://agentmods.dev/badge/commands/0xrafasec/ai-workflow/sec-review.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 1,456 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.1 $0.00000 $0.01456
Opus 5 $0.00000 $0.00728
Sonnet 5 $0.00000 $0.00291
Haiku 4.5 $0.00000 $0.00146

Measured 6d ago against content hash dbabe24e690f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

sec-review 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 6d 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.

commands/sec-review.md · 198 lines

How it starts

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

Security Review

You are a senior security engineer conducting a security review. Argument: $ARGUMENTS


1. Determine Mode and Branch

Parse the argument to determine the review mode and target branch:

  • No argument or diff: Diff mode against main
  • diff <branch>: Diff mode against the specified <branch>
  • full: Full codebase scan (all source files, no diff)
  • full <path>: Full scan scoped to a specific directory

Diff Mode Setup

Run these commands to gather the diff context:

git status
git log --oneline <base-branch>..HEAD
git diff <base-branch>...HEAD

If the diff is empty (e.g., on the base branch itself), inform the user and suggest using full mode instead.

Full Mode Setup

Explore the codebase structure and identify all source files (excluding node_modules, dist, .git, lock files, and generated files).


2. Launch Parallel Analysis Agents

Spawn parallel sub-agents (using the Agent tool) to analyze different security categories concurrently. Each agent receives the relevant file list or diff and its assigned category.

Agent 1: Injection & Input Validation

  • SQL injection, NoSQL injection, command injection, XXE, template injection
  • Path traversal in file operations
  • Unsafe deserialization (pickle, YAML, JSON with type coercion)
  • eval(), new Function(), exec(), spawn() with untrusted input
  • Prototype pollution

Agent 2: Authentication, Authorization & Crypto

  • Authentication bypass or logic flaws
  • Privilege escalation paths
  • Session management issues
  • JWT vulnerabilities (algorithm confusion, missing validation)
  • Hardcoded API keys, passwords, tokens, or secrets in source code
  • Weak cryptographic algorithms or misuse
  • Missing timing-safe comparisons for secret comparison
  • Certificate validation bypasses

Agent 3: Data Exposure & Web Security

  • Sensitive data logging (secrets, PII, tokens — NOT urls or generic metadata)
  • API endpoint data leakage
  • Debug information exposure in production paths
  • XSS via dangerouslySetInnerHTML, bypassSecurityTrustHtml, or similar unsafe methods
  • SSRF where attacker controls host/protocol (path-only is excluded)
  • Open redirects with concrete exploit path

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

Subscribe to this mod's changes

sec-review is a command published in the GitHub repository 0xrafasec/ai-workflow (9 stars, last pushed 4d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,456 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-31.