Observed since 21 Oct, 10:13 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
A powerful Python tool that scans your codebase for security vulnerabilities using Claude AI
A powerful Python tool that scans your codebase for security vulnerabilities using Claude AI. This tool analyzes your code files and provides detailed security findings with suggested fixes.
Clone or download the tool:
git clone <repository-url>
cd AI-code-sec-reviewer
Install dependencies:
pip install -r requirements.txt
Set up your Anthropic API key:
export ANTHROPIC_API_KEY='your-api-key-here'
Or add it to your .bashrc or .zshrc:
echo 'export ANTHROPIC_API_KEY="your-api-key-here"' >> ~/.bashrc
source ~/.bashrc
Scan a project directory:
python security_scanner.py /path/to/your/project
Scan current directory:
python security_scanner.py .
Increase parallel workers for faster scanning:
python security_scanner.py /path/to/project --max-workers 8
Save results to JSON file:
python security_scanner.py /path/to/project --output scan_results.json
Combine options:
python security_scanner.py /path/to/project --max-workers 6 --output results.json
The tool provides detailed output including:
🔒 SECURITY SCAN RESULTS
================================================================================
📊 Summary:
Files analyzed: 15
Files with vulnerabilities: 3
Files modified with comments: 3
Vulnerability rate: 20.0%
🔍 /path/to/project/app.py
------------------------------------------------------------
🔴 HIGH - SQL Injection
Line/Section: 45
Description: User input directly concatenated into SQL query
Vulnerable Code:
query = f"SELECT * FROM users WHERE id = {user_id}"
Suggested Fix:
# Use parameterized queries to prevent SQL injection
query = "SELECT * FROM users WHERE id = %s"
cursor.execute(query, (user_id,))
💬 Added vulnerability comments to 3 files
Review the comments in your source files for detailed information
📈 VULNERABILITY SUMMARY
================================================================================
Total vulnerabilities found: 5
High severity: 2
Medium severity: 2
Low severity: 1
The scanner automatically detects and analyzes files with these extensions:
.py, .js, .ts, .jsx, .tsx, .php, .rb.java, .cs, .go, .rs, .swift, .kt.c, .cpp, .cxx, .h, .hpp.sh, .bash, .ps1, .vbs, .pl.sql, .r, .m.scala, .clj, .hs, .ml, .fs.scm, .lisp, .elThe tool automatically skips:
.git, .svn, .hgnode_modules, venv, .venv, envbuild, dist, target, bin, obj.idea, .vscode, .vs__pycache__, .pytest_cache, coveragepackage-lock.json, yarn.lock, poetry.lockREADME.md, LICENSEANTHROPIC_API_KEY: Your Anthropic API key (required)project_path: Path to the project directory to scan (required)--max-workers: Maximum number of parallel workers (default: 4)--output: Output file to save results as JSON--add-comments: Add vulnerability comments directly to source files1. API Key Error:
❌ Error: ANTHROPIC_API_KEY environment variable not set
Solution: Set your API key as shown in the installation section.
2. No Files Found:
⚠️ No files found to scan
Solution: Check if the project path is correct and contains code files.
3. Permission Errors:
❌ Error: [Errno 13] Permission denied
Solution: Ensure you have read permissions for the project directory.
4. API Rate Limits:
❌ Error: Rate limit exceeded
Solution: Reduce the number of parallel workers or wait before retrying.
5. Comment Addition Failed:
⚠️ Failed to add comments to filename.py
Solution: Check if the file is writable and not locked by another process.
--add-comments flag modifies your source files. Consider backing up your code before runningContributions are welcome! Please feel free to submit issues and pull requests.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.0.0 | 30 Jul 2025 | 2 |
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Observed since 21 Oct, 10:13 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:fa53e92e0b9f398a917713c997d91296ff146f3c518b8b61827d2f4ab66e5d69