security-review

Complete a security review of the pending changes on the current branch.

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/majorcontext/moat/security-review
Clone the repo
git clone --depth 1 https://github.com/majorcontext/moat

Made for: Claude Code.

Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,279 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 98% copy Near-identical to another mod 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.00012 $0.02279
Opus 5 $0.00006 $0.01140
Sonnet 5 $0.00002 $0.00456
Haiku 4.5 $0.00001 $0.00228

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

Security

Grade A, and why

security-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 yesterday.

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.

Origin

This is a copy

98% identical to security-review — 11 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.claude/commands/security-review.md · 192 lines

How it starts

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

You are a senior security engineer conducting a focused security review of the changes on this branch.

GIT STATUS:

!`git status`

FILES MODIFIED:

!`git diff --name-only origin/HEAD...`

COMMITS:

!`git log --no-decorate origin/HEAD...`

DIFF CONTENT:

!`git diff --merge-base origin/HEAD`

Review the complete diff above. This contains all code changes in the PR.

OBJECTIVE: Perform a security-focused code review to identify HIGH-CONFIDENCE security vulnerabilities that could have real exploitation potential. This is not a general code review - focus ONLY on security implications newly added by this PR. Do not comment on existing security concerns.

CRITICAL INSTRUCTIONS:

  1. MINIMIZE FALSE POSITIVES: Only flag issues where you're >80% confident of actual exploitability
  2. AVOID NOISE: Skip theoretical issues, style concerns, or low-impact findings
  3. FOCUS ON IMPACT: Prioritize vulnerabilities that could lead to unauthorized access, data breaches, or system compromise
  4. EXCLUSIONS: Do NOT report the following issue types:
    • Denial of Service (DOS) vulnerabilities, even if they allow service disruption
    • Secrets or sensitive data stored on disk (these are handled by other processes)
    • Rate limiting or resource exhaustion issues

SECURITY CATEGORIES TO EXAMINE:

Input Validation Vulnerabilities:

  • SQL injection via unsanitized user input
  • Command injection in system calls or subprocesses
  • XXE injection in XML parsing
  • Template injection in templating engines
  • NoSQL injection in database queries
  • Path traversal in file operations

Authentication & Authorization Issues:

  • Authentication bypass logic
  • Privilege escalation paths
  • Session management flaws
  • JWT token vulnerabilities
  • Authorization logic bypasses

Crypto & Secrets Management:

  • Hardcoded API keys, passwords, or tokens
  • Weak cryptographic algorithms or implementations
  • Improper key storage or management
  • Cryptographic randomness issues
  • Certificate validation bypasses

Injection & Code Execution:

  • Remote code execution via deseralization
  • Pickle injection in Python
  • YAML deserialization vulnerabilities
  • Eval injection in dynamic code execution
  • XSS vulnerabilities in web applications (reflected, stored, DOM-based)

Data Exposure:

  • Sensitive data logging or storage
  • PII handling violations
  • API endpoint data leakage
  • Debug information exposure

Additional notes:

  • Even if something is only exploitable from the local network, it can still be a HIGH severity issue

ANALYSIS METHODOLOGY:

Phase 1 - Repository Context Research (Use file search tools):

  • Identify existing security frameworks and libraries in use
  • Look for established secure coding patterns in the codebase
  • Examine existing sanitization and validation patterns
  • Understand the project's security model and threat model

Phase 2 - Comparative Analysis:

  • Compare new code changes against existing security patterns
  • Identify deviations from established secure practices
  • Look for inconsistent security implementations
  • Flag code that introduces new attack surfaces

Phase 3 - Vulnerability Assessment:

  • Examine each modified file for security implications
  • Trace data flow from user inputs to sensitive operations
  • Look for privilege boundaries being crossed unsafely
  • Identify injection points and unsafe deserialization

REQUIRED OUTPUT FORMAT:

You MUST output your findings in markdown. The markdown output should contain the file, line number, severity, category (e.g. sql_injection or xss), description, exploit scenario, and fix recommendation.

For example:

Vuln 1: XSS: foo.py:42

  • Severity: High
  • Description: User input from username parameter is directly interpolated into HTML without escaping, allowing reflected XSS attacks
  • Exploit Scenario: Attacker crafts URL like /bar?q=alert(document.cookie) to execute JavaScript in victim's browser, enabling session hijacking or data theft
  • Recommendation: Use Flask's escape() function or Jinja2 templates with auto-escaping enabled for all user inputs rendered in HTML

Read the full file on GitHub · 192 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. yesterday First seen · 192 lines · 12 tokens per session scan A 3a8ef448b77d

Subscribe to this mod's changes

security-review is a command published in the GitHub repository majorcontext/moat (46 stars, last pushed 18d ago), licensed MIT. It adds 12 tokens to every session and 2,279 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 98% identical to security-review, differing in 11 lines, and is treated as a copy.