Security as a blocking constraint, not a checklist.
An AI-powered security review GitHub Action that analyzes code changes for vulnerabilities using Anthropic's Claude for deep, context-aware semantic analysis. The code-review pillar of Warden, the AI-Driven Development Lifecycle (AIDLC) security platform by Techanv Consulting.
- Overview
- Where Warden Fits
- Features
- Quick Start
- How It Works
- Example Output
- Configuration
- Security Analysis Capabilities
- Claude Code Integration: /security-review
- Custom Scanning Configuration
- Local Development & Testing
- Security Considerations
- License & Attribution
- Support
Warden integrates security directly into AI-assisted development. Rather than treating security as an afterthought checklist, Warden bakes protective guardrails into every stage of AI-powered coding — preventing violations from proceeding without human review.
This repository is the code-review pillar: a GitHub Action that runs on pull requests, uses Claude to understand what changed and why, and surfaces real, high-impact security findings as inline PR comments.
Note: Warden calls the Anthropic Claude API under the hood. References to the
anthropicSDK, theANTHROPIC_API_KEYenvironment variable, the@anthropic-ai/claude-codeCLI, andclaude-*model IDs are functional and intentionally preserved.
Warden enforces security across the three phases of the AI-Driven Development Lifecycle (AIDLC):
| Phase | Focus | This Action |
|---|---|---|
| Inception | Threat modeling | — |
| Construction | Code review | ✅ You are here |
| Operations | Deployment & monitoring | — |
- AI-Powered Analysis — Claude's reasoning detects vulnerabilities with deep semantic understanding, not just pattern matching.
- Diff-Aware Scanning — For PRs, only analyzes changed files.
- Inline PR Comments — Posts findings on the exact lines of code.
- Contextual Understanding — Understands code intent and purpose, reducing noise.
- Language Agnostic — Works with any programming language.
- False-Positive Filtering — Advanced filtering focuses attention on real, high-impact issues.
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: techanvconsulting/warden-action@main
with:
comment-pr: true
claude-api-key: ${{ secrets.CLAUDE_API_KEY }}Add your Anthropic Claude API key as the CLAUDE_API_KEY repository secret. The key must be enabled for both the Claude API and Claude Code usage.
- PR Analysis — When a pull request opens, Claude analyzes the diff to understand what changed.
- Contextual Review — Claude examines the changes in context, understanding purpose and security implications.
- Finding Generation — Issues are identified with explanations, severity ratings, and remediation guidance.
- False-Positive Filtering — Low-impact and false-positive-prone findings are filtered out to reduce noise.
- PR Comments — Findings are posted as review comments on the specific lines of code.
claudecode/
├── github_action_audit.py # Main audit entrypoint 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 scans on arbitrary PRs
| Input | Description | Default | Required |
|---|---|---|---|
claude-api-key |
Anthropic Claude API key for security analysis. Must 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 analysis in minutes | 20 |
No |
run-every-commit |
Run on every commit (skips cache check). May increase false positives on PRs with many commits. | false |
No |
false-positive-filtering-instructions |
Path to custom false-positive filtering instructions file | None | No |
custom-security-scan-instructions |
Path to custom security scan instructions file to append to the audit prompt | None | No |
warden-url |
Warden platform base URL to push findings to (e.g. https://warden.example.com). Leave empty to skip. |
None | No |
warden-token |
Warden CI access token used to upload findings (Setting → CI Token in Warden). | None | No |
Set warden-url and warden-token to push every finding into your Warden
instance through its CI ingest API, so PR-review results land in the dashboard
alongside the rest of the scanner fleet (Semgrep, Trivy, gitleaks, …). The
upload runs after the scan and never fails the build — it no-ops if the URL
or token is unset.
- uses: techanvconsulting/warden-action@v1
with:
claude-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
warden-url: https://warden.example.com
warden-token: ${{ secrets.WARDEN_CI_TOKEN }}Each finding maps to a Warden SAST finding under the warden-ai scanner:
severity (HIGH → High, …), file/line → location, exploit_scenario appended
to the description, recommendation → remediation, cwe → rule. PR scans are
tagged with the merge-request id so they appear in the PR's shift-left view.
| Output | Description |
|---|---|
findings-count |
Total number of security findings |
results-file |
Path to the results JSON file |
- Injection — SQL, command, LDAP, XPath, NoSQL injection, XXE
- Authentication & Authorization — broken auth, privilege escalation, IDOR, bypass logic, session flaws
- Data Exposure — hardcoded secrets, sensitive data logging, information disclosure, PII handling
- Cryptography — weak algorithms, improper key management, insecure randomness
- Input Validation — missing validation, improper sanitization, buffer overflows
- Business Logic — race conditions, TOCTOU issues
- Configuration — insecure defaults, missing security headers, permissive CORS
- Supply Chain — vulnerable dependencies, typosquatting risks
- Code Execution — RCE via deserialization, pickle injection, eval injection
- Cross-Site Scripting (XSS) — reflected, stored, and DOM-based
By default, low-impact and false-positive-prone findings are excluded to focus on high-impact issues:
- Denial-of-Service vulnerabilities
- Rate-limiting concerns
- Memory/CPU exhaustion
- Generic input validation without proven impact
- Open redirects
Filtering can be tuned per project — see Custom Scanning Configuration.
- Contextual understanding of semantics and intent, not just patterns
- Lower false positives through AI reasoning about actual exploitability
- Detailed explanations of why something is vulnerable and how to fix it
- Adaptive to organization-specific security requirements
By default, Claude Code ships a /security-review slash command that provides the same analysis as this Action, integrated directly into your Claude Code environment. Run /security-review to perform a comprehensive review of all pending changes.
- Copy
security-review.mdinto your project's.claude/commands/folder. - Edit it to add organization-specific scan or filtering directions.
Custom scanning and false-positive filtering instructions are supported. See the docs/ folder:
Run the test suite:
cd warden-action
# Run all tests
pytest claudecode -vTo run the scanner locally against a specific PR, see the evaluation framework documentation.
This Action is not hardened against prompt injection and should only review trusted PRs. Configure your repository to require approval for all external contributors so workflows only run after a maintainer review.
Licensed under the Apache License 2.0 — see LICENSE and NOTICE.
Warden is a product of Techanv Consulting. It is a derivative of Anthropic's MIT-licensed claude-code-security-review; the original MIT notice is retained in NOTICE.
- Open an issue in this repository
- Visit warden.techanv.com
- Check the GitHub Actions logs for debugging


