AI-powered code security analysis and automated fixing tool powered by Google's Generative AI
- 🔍 Real-time code security analysis
- 🛠️ Automated security vulnerability fixes
- 👀 File monitoring for security issues
- 📊 Detailed security reports
- ⚡ Multiple scan levels
- 🔄 Automatic backup of modified files
- 🎯 Customizable security rules
npm install -g shieldai- Install the package globally
- Run the security agent:
shieldai- On first run, you'll be prompted for your Google AI API key
shieldai # Start the interactive security agent
shieldai check file # Analyze a specific file
shieldai fix file # Fix security issues in a file
shieldai monitor dir # Monitor directory for security issuescheck <file> [lines] # Analyze file for security issuesExamples:
check index.jscheck index.js 10-50check ./src/*.js
fix <file> [lines] # Apply security fixesExamples:
fix index.jsfix index.js 25-30fix vulnerable-code.js --autofix
monitor <path> # Watch files for security issuesExamples:
monitor ./srcmonitor index.js --realtimemonitor ./ --exclude=node_modules
ShieldAI performs comprehensive security analysis including:
-
Input Validation
- SQL Injection vulnerabilities
- XSS vulnerabilities
- Command injection risks
-
Authentication
- Weak authentication methods
- Insecure password storage
- Session management issues
-
Data Exposure
- Sensitive data leaks
- Insecure data storage
- Unencrypted data transmission
-
Dependencies
- Vulnerable dependencies
- Outdated packages
- Known CVEs
-
Code Injection
- Remote code execution risks
- Unsafe eval usage
- Template injection
-
File System
- Path traversal vulnerabilities
- Unsafe file operations
- Directory listing risks
Access configuration settings using:
shieldai config- API Key: Your Google AI API key
- Scan Level:
basic- Faster, basic security checksstandard- Balanced security analysisthorough- Deep, comprehensive scanning
- Auto-Fix: Enable/disable automatic fixing
- Backup: Enable/disable backup file creation
╔═══════════════════════════════════════════╗
║ 🛡️ SHIELD AI 1.0 🛡️ ║
╚═══════════════════════════════════════════╝
Security Analysis Results:
[HIGH] SQL Injection vulnerability found
Recommendation: Use parameterized queries
Security Checks Summary:
Input Validation: ✓
Authentication Issues: ✗
Data Exposure: ✓
Dependency Vulnerabilities: ✓
Code Injection Risks: ✗
File System Security: ✓- Node.js >= 14.0.0
- Google AI API key
- @google/generative-ai: ^0.2.1
- chalk: ^4.1.2
- chokidar: ^3.5.3
- inquirer: ^8.2.6
- ora: ^5.4.1
- readline-sync: ^1.4.10
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Vansh Goyal
- GitHub: @VanshGoyal000
- Email: vanshgoyal9528@gmail.com
For bugs and feature requests, please create an issue.
Made with ❤️ using Google's Generative AI