Claude Code Security Reviewer
An Anthropic GitHub Action that checks pull request changes for vulnerabilities with Claude and leaves comments
Install
name: Security Review
permissions:
pull-requests: write
contents: read
on:
pull_request:
jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 2
- uses: anthropics/claude-code-security-review@main
with:
comment-pr: true
claude-api-key: ${{ secrets.CLAUDE_API_KEY }}Save as .github/workflows/security.yml and add the CLAUDE_API_KEY secret.
This is third-party code. Review the repository files before installing.
What it does
The action runs on a pull request, gives Claude only the changed files and looks for security issues: injections, auth flaws, secret leaks, weak crypto, XSS, unsafe deserialization. Findings are posted as comments on specific lines with an explanation and fix advice. A separate filter drops noisy findings such as DoS and rate limiting. Scan and filter instructions can be extended with your own files, and the same logic is available in Claude Code via /security-review.
Who it is for. For GitHub teams that want an extra security pass on every PR.
Good fit when
- You want automatic vulnerability checks on PRs
- Classic SAST produces too many false positives
- You want checks tuned to your company's rules
Not a fit when
- PRs come from untrusted external contributors without prior approval
- You need deterministic, reproducible scan results
Example request
Add automatic Claude security review of PRs to this repositoryLimitations
It needs an Anthropic API key enabled for both the Claude API and Claude Code; Anthropic accounts and billing are not available from Russia. The authors state the action is not hardened against prompt injection, so use it only on trusted PRs. Results are non-deterministic and do not replace a full audit.
How to disable. Delete .github/workflows/security.yml or remove the action step from the workflow.
Security check
- Sends code changes to the Anthropic API
- Posts PR comments and is not hardened against prompt injection
README in short
The README provides a ready workflow, a prompt injection warning and an input table: model, timeout, excluded directories, custom instructions. It describes the Python architecture, review stages and vulnerability classes. The /security-review command in Claude Code and its customization are covered separately. MIT licensed.
FAQ
Is the whole repository scanned?
No, for PRs only changed files are analyzed.
Can I use it without GitHub Actions?
Yes, Claude Code has a /security-review command you can customize by copying security-review.md into .claude/commands/.
Related
NVIDIA's open stack for running OpenClaw, Hermes and LangChain Deep Agents in OpenShell sandboxes with network policy and managed inference
Static code analysis with rules that look like source code, plus a built-in MCP server for AI agents
Trail of Bits skills
Trail of Bits Skills Marketplace
Trail of Bits plugin marketplace for security work: smart contracts, C/C++ and Rust review, Semgrep, CodeQL and fuzzing
A cybersecurity skill library: forensics, incident response, pentesting, cloud and malware analysis mapped to MITRE ATT&CK and NIST