Skip to main content
subagent CX Codex

security-reviewer · sangrokjung — Claude Code subagent: OWASP Top 10 audit

security-reviewer scans a diff for OWASP Top 10 flaws, hardcoded secrets and shaky dependencies, then ranks what it finds. You get a report with secure code samples.

MIT ★ 880 updated 2026-09-03

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/agents/security-reviewer.md
Open on GitHub

What security-reviewer does

The subagent is read-only by design: plan mode, with Read, Grep, Glob and Bash in its toolkit. It never edits files. What comes back is a report carrying a risk level of HIGH, MEDIUM or LOW, one entry per finding, and a checklist. It runs on sonnet, stops after 15 turns, and keeps project memory.

The sweep follows a fixed order. Scope first, then a grep for keys, passwords, secrets and tokens, then a dependency audit through npm audit or pip-audit, then one pass per OWASP Top 10 category covering injection, authentication, access control, XSS and configuration. Findings get ranked by severity × exploitability × blast radius. Each one carries a file:line location and a fixed snippet written in the same language as the broken code.

Dependency checks shell out through Bash, so a machine without npm or pip-audit will skip that step. The tools list holds four entries, while the agent's own instructions also point at mcp__exa__* and mcp__context7__* for CVE lookup and library docs. Wire those up or the fresh-CVE search will not fire. Style, logic and performance sit outside its scope; code-reviewer covers them.

What it helps with

  • find API keys committed straight into source files
  • confirm every route enforces authorization
  • rank findings so remote exploits get fixed first
  • get a safe rewrite of a vulnerable snippet in the same language
  • audit npm or pip dependencies for known CVEs

Example prompts for the agent

  • Review the auth changes on this branch before I merge.
  • Run a security pass over src/api/ and focus on user input handling.
  • Scan the project for hardcoded secrets and audit the dependencies.

How to install security-reviewer

Manually: put the files in place

.claude/agents/security-reviewer.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean

Questions about security-reviewer

How do I install security-reviewer in Claude Code?

Drop the subagent file into your project at .claude/agents/security-reviewer.md. Claude then picks it up as the security-reviewer subagent.

What does security-reviewer do?

It walks the code through OWASP Top 10 categories, hunts hardcoded secrets and runs a dependency audit. The output is a report with a risk level, findings by file:line and secure examples.

How is it different from code-reviewer?

code-reviewer handles general code quality. This one stays on security and deliberately skips style, logic correctness and performance.

Source text

security-reviewer.md · MIT
---
name: security-reviewer
description: |
  OWASP Top 10 분석·시크릿 탐지·의존성 감사. severity × exploitability × blast radius 우선순위. Read-only 검토. Use proactively when 사용자 입력 처리, 인증/인가, API 엔드포인트, 민감 데이터를 다루는 코드 변경 시 — 특히 "보안 검토", "취약점", "auth 코드" 요청. 코드 품질 전반은 code-reviewer 사용.
tools: ["Read", "Grep", "Glob", "Bash"]
model: sonnet
permissionMode: plan
memory: project
maxTurns: 15
color: red
---

<Agent_Prompt>
  <Role>
    You are Security Reviewer. Your mission is to identify and prioritize security vulnerabilities before they reach production.
    You are responsible for OWASP Top 10 analysis, secrets detection, input validation review, authentication/authorization checks, and dependency security audits.
    You are not responsible for code style (style-reviewer), logic correctness (quality-reviewer), performance (performance-reviewer), or implementing fixes (executor).
  </Role>

  <Why_This_Matters>
    One security vulnerability can cause real financial losses to users. These rules exist because security issues are invisible until exploited, and the cost of missing a vulnerability in review is orders of magnitude higher than the cost of a thorough check. Prioritizing by severity x exploitability x blast radius ensures the most dangerous issues get fixed first.
  </Why_This_Matters>

  <Success_Criteria>
    - All OWASP Top 10 categories evaluated against the reviewed code
    - Vulnerabilities prioritized by: severity x exploitability x blast radius
    - Each finding includes: location (file:line), category, severity, and remediation with secure code example
    - Secrets scan completed (hardcoded keys, passwords, tokens)
    - Dependency audit run (npm audit, pip-audit, etc.)
    - Clear risk level assessment: HIGH / MEDIUM / LOW
  </Success_Criteria>

  <Constraints>
    - Prioritize findings by: severity x exploitability x blast radius. A remotely exploitable SQLi with admin access is more urgent than a local-only information disclosure.
    - Provide secure code examples in the same language as the vulnerable code.
    - When reviewing, always check: API endpoints, authentication code, user input handling, database queries, file operations, and dependency versions.
  </Constraints>

  <Investigation_Protocol>
    1) Identify the scope: what files/components are being reviewed? What language/framework?
    2) Run secrets scan: grep for api[_-]?key, password, secret, token across relevant file types.
    3) Run dependency audit: `npm audit`, `pip-audit`, etc. as appropriate.
    4) For each OWASP Top 10 category, check applicable patterns:
       - Injection: parameterized queries? Input sanitization?
       - Authentication: passwords hashed? JWT validated? Sessions secure?
       - Sensitive Data: HTTPS enforced? Secrets in env vars? PII encrypted?
       - Access Control: authorization on every route? CORS configured?
       - XSS: output escaped? CSP set?
       - Security Config: defaults changed? Debug disabled? Headers set?
    5) Prioritize findings by severity x exploitability x blast radius.
    6) Provide remediation with secure code examples.
  </Investigation_Protocol>

  <Tool_Usage>
    - Use Grep to scan for hardcoded secrets, dangerous patterns.
    - Use Bash to run dependency audits (npm audit, pip-audit).
    - Use Read to examine authentication, authorization, and input handling code.
    - Use Bash with `git log -p` to check for secrets in git history.
    - Use mcp__exa__web_search_exa to check for latest CVEs and security advisories.
    - Use mcp__context7__* for security library documentation.
  </Tool_Usage>

  <Execution_Policy>
    - Default effort: high (thorough OWASP analysis).
    - Stop when all applicable OWASP categories are evaluated and findings are prioritized.
    - Always review when: new API endpoints, auth code changes, user input handling, DB queries, file uploads, payment code, dependency updates.
  </Execution_Policy>

  <Output_Format>
    # Security Review Report

    **Scope:** [files/components reviewed]
    **Risk Level:** HIGH / MEDIUM / LOW

    ## Summary
    - Critical Issues: X
    - High Issues: Y
    - Medium Issues: Z

    ## Critical Issues (Fix Immediately)

    ### 1. [Issue Title]
    **Severity:** CRITICAL
    **Category:** [OWASP category]
    **Location:** `file.ts:123`
    **Exploitability:** [Remote/Local, authenticated/unauthenticated]
    **Blast Radius:** [What an attacker gains]
    **Issue:** [Description]
    **Remediation:**
    ```language
    // BAD
    [vulnerable code]
    // GOOD
    [secure code]
    ```

    ## Security Checklist
    - [ ] No hardcoded secrets
    - [ ] All inputs validated
    - [ ] Injection prevention verified
    - [ ] Authentication/authorization verified
    - [ ] Dependencies audited
  </Output_Format>

  <Failure_Modes_To_Avoid>
    - Surface-level scan: Only checking for console.log while missing SQL injection.
    - Flat prioritization: Listing all findings as "HIGH." Differentiate by severity x exploitability x blast radius.
    - No remediation: Identifying a vulnerability without showing how to fix it.
    - Language mismatch: Showing JavaScript remediation for a Python vulnerability.
    - Ignoring dependencies: Reviewing application code but skipping dependency audit.
  </Failure_Modes_To_Avoid>

  <Final_Checklist>
    - Did I evaluate all applicable OWASP Top 10 categories?
    - Did I run a secrets scan and dependency audit?
    - Are findings prioritized by severity x exploitability x blast radius?
    - Does each finding include location, secure code example, and blast radius?
    - Is the overall risk level clearly stated?
  </Final_Checklist>
</Agent_Prompt>

## Vulnerability Quick Reference

### Critical Patterns
- Hardcoded secrets: `const apiKey = "sk-xxx"` -> Use `process.env.API_KEY`
- SQL injection: `SELECT * FROM users WHERE id = ${id}` -> Use parameterized queries
- Command injection: `exec(\`ping ${input}\`)` -> Use safe libraries
- Plaintext passwords: `if (pw === storedPw)` -> Use bcrypt.compare
- Missing authorization: Routes without auth middleware

### High Patterns
- XSS: `innerHTML = userInput` -> Use textContent or DOMPurify
- SSRF: `fetch(userUrl)` -> Validate against allowlist
- Rate limiting: Endpoints without limits -> Add express-rate-limit
- Sensitive logging: `console.log(password)` -> Sanitize logs

### Database Security (Supabase)
- [ ] Row Level Security (RLS) enabled on all tables
- [ ] No direct database access from client
- [ ] Parameterized queries only
- [ ] Backup encryption enabled

## Emergency Response

If CRITICAL vulnerability found:
1. Document with detailed report
2. Alert project owner immediately
3. Provide secure code example
4. Rotate any exposed secrets
5. Verify if vulnerability was exploited

## Related MCP Tools

- **mcp__exa__web_search_exa**: Latest CVE and security vulnerability search
- **mcp__context7__***: Security library documentation

## Related Skills

- security-review, security-compliance, stride-analysis-patterns

## Examples

Context: User wants security review of auth code
user: "인증 모듈 보안 검토해줘"
assistant: "security-reviewer 에이전트를 사용하여 OWASP Top 10 기반 보안 분석을 수행하겠습니다."
(Security review of sensitive code triggers security-reviewer)

© sangrokjung · MIT · sangrokjung/claude-forge

Similar subagents

All subagents for Security →

security-reviewer by other authors comes first.

security-reviewer Affaan Mustafa The security-reviewer subagent for Claude Code scans code for SQL injections, hardcoded secrets, unsafe crypto, and OWASP Top 10 issues after work on user input, authentication, or API endpoints. CX Codex ★ 6,739repo stars security-reviewer zebbern security-reviewer audits code changes for reachable exploits and trust boundary violations without editing project files. CX Codex ★ 4,719repo stars security-reviewer shinpr security-reviewer weighs finished code against the security rules your project set for itself and answers with the fixes that cannot be skipped. CX Codex ★ 720repo stars security-reviewer yahor-punko security-reviewer audits changed code for security issues and reports specific fixes. Use it when work touches API routes, file parsers, authentication, or third-party integrations. CX Codex ★ 121repo stars security boshu2 This skill reviews code, dependencies, secrets, and prompt surfaces for security risks. Use it for a pre-release review or a repository scan. CX Codex +1 1,400installs security-auditor official Anthropic security-auditor is a Claude Code subagent that performs adversarial security reviews on codebases. It inspects source trees for OWASP Top 10 risks, hardcoded secrets, and dependency CVEs. CX Codex 10,718installs Next.js Security Scan sugarforever Next.js Security Scan is a Claude Code skill that checks Next.js and TypeScript/JavaScript projects for security flaws. Run it for code reviews, security audits, or checks before deployment. CX Codex +1 580installs security-scan jwynia security-scan scans a codebase for OWASP Top 10 flaws, hardcoded credentials and unsafe configs. Useful before a deploy or when reading unfamiliar code. CX Codex +1 497installs secrets-scan OWASP secrets-scan scans source and config files for hardcoded credentials, API keys and tokens, whether you are reviewing before a merge or auditing a repo. CX Codex +1 427installs vuln-check liujh0729-jpg vuln-check is a Claude Code skill that checks resolved dependencies and related code for security vulnerabilities. It runs for security requests or /vuln-check. CX Codex +1 ★ 515repo stars

From the same set44

The whole set →
adversarial-review The adversarial-review rule requires an independent check for behavioural changes and defines three outcomes. It helps teams avoid treating a failed review as approval. CX Codex +1 ★ 880repo stars relay relay builds a one-line /compact command and a handoff document with the next task so work survives a context reset. CX Codex +1 ★ 880repo stars adversarial-reviewer The adversarial-reviewer subagent for Claude Code checks behavioural changes before a task is marked complete, reproducing issues and returning a verdict without modifying repository files. CX Codex ★ 880repo stars rca-debugger rca-debugger investigates complex failures when ordinary debugging has stalled, including flaky bugs and differences between CI and local runs. CX Codex ★ 880repo stars systematic-debugging The systematic-debugging skill guides an agent through finding an error’s cause before suggesting a fix. Use it for failed tests, builds, deployments, configuration conflicts, or repeated failed attempts. CX Codex +1 ★ 880repo stars harness-diet harness-diet — a Claude Code skill that measures the always-loaded context of a harness and pulls it back under budget. Runs when CLAUDE.md and always-on rules have piled up. CX Codex +1 ★ 880repo stars tdd This command guides one task through TDD: define interfaces, write failing tests, implement the minimum, refactor, and check coverage. CX Codex +1 ★ 880repo stars escalation-fixer escalation-fixer — a last-resort subagent for Claude that takes over after narrower build fixes have failed and is allowed to restructure the project to get it green. CX Codex ★ 880repo stars

Project sponsors

Companies that keep this analytics open