A community-driven registry for Claude, Cursor, Windsurf, Cline & more. Not affiliated with Anthropic.
Are you the author? Sign in to claim
An AI-powered security review GitHub Action using Claude to analyze code changes for security vulnerabilities.
An AI-powered security review GitHub Action using Claude to analyze code changes for security vulnerabilities. This action provides intelligent, context-aware security analysis for pull requests using Anthropic's Claude Code tool for deep semantic security analysis. See our blog post here for more details.
Add this to your repository's .github/workflows/security.yml:
name: Security Review
permissions:
pull-requests: write # Needed for leaving PR comments
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 }}
This action is not hardened against prompt injection attacks and should only be used to review trusted PRs. We recommend configuring your repository to use the "Require approval for all external contributors" option to ensure workflows only run after a maintainer has reviewed the PR.
| Input | Description | Default | Required |
|---|---|---|---|
claude-api-key | Anthropic Claude API key for security analysis. Note: This API key needs to be enabled for both the Claude API and Claude Code usage. | None | Yes |
comment-pr | Whether to comment on PRs with findings | true | No |
upload-results | Whether to upload results as artifacts | true | No |
exclude-directories | Comma-separated list of directories to exclude from scanning | None | No |
claude-model | Claude model name to use. Defaults to Opus 4.1. | claude-opus-4-1-20250805 | No |
claudecode-timeout | Timeout for ClaudeCode analysis in minutes | 20 | No |
run-every-commit | Run ClaudeCode on every commit (skips cache check). Warning: May increase false positives on PRs with many commits. | false | No |
false-positive-filtering-instructions | Path to custom false positive filtering instructions text file | None | No |
custom-security-scan-instructions | Path to custom security scan instructions text file to append to audit prompt | None | No |
| Output | Description |
|---|---|
findings-count | Total number of security findings |
results-file | Path to the results JSON file |
claudecode/
├── github_action_audit.py # Main audit script for GitHub Actions
├── prompts.py # Security audit prompt templates
├── findings_filter.py # False positive filtering logic
├── claude_api_client.py # Claude API client for false positive filtering
├── json_parser.py # Robust JSON parsing utilities
├── requirements.txt # Python dependencies
├── test_*.py # Test suites
└── evals/ # Eval tooling to test CC on arbitrary PRs
The tool automatically excludes a variety of low-impact and false positive prone findings to focus on high-impact vulnerabilities:
The false positive filtering can also be tuned as needed for a given project's security goals.
Follow the Quick Start guide above. The action handles all dependencies automatically.
To run the security scanner locally against a specific PR, see the evaluation framework documentation.
By default, Claude Code ships a /security-review slash command that provides the same security analysis capabilities as the GitHub Action workflow, but integrated directly into your Claude Code development environment. To use this, simply run /security-review to perform a comprehensive security review of all pending changes.
The default /security-review command is designed to work well in most cases, but it can also be customized based on your specific security needs. To do so:
security-review.md file from this repository to your project's .claude/commands/ folder.security-review.md to customize the security analysis. For example, you could add additional organization-specific directions to the false positive filtering instructions.It is also possible to configure custom scanning and false positive filtering instructions, see the docs/ folder for more details.
Run the test suite to validate functionality:
cd claude-code-security-review
# Run all tests
pytest claudecode -v
For issues or questions:
MIT License - see LICENSE file for details.
1000+ skills curated from Anthropic, Vercel, Stripe, and other engineering teams
Claude Code skill for YouTube creators — channel audits, video SEO, retention scripts, thumbnails, content strategy, Sho
Design enforcement with memory — keeps your UI consistent across a project
AI image generation skill for Claude Code -- Creative Director powered by Gemini