The first adversarial AI security agent that attacks your code before hackers do.
RedLoop is an autonomous AI security agent that operates on a "Security-Through-Attack" principle. Instead of just scanning for vulnerabilities, it actively exploits them in a safe environment to prove risk, then automatically generates fixes.
| Agent | Role | Technology |
|---|---|---|
| π΄ Adversary | Find vulnerabilities, generate attack payloads | Cline CLI / Kestra AI Agent |
| π€ Summarizer | Analyze risks, make BLOCK/PASS decisions | Kestra AI Agent |
| π΅ Defender | Generate secure code fixes | Cline CLI / Kestra AI Agent |
- π Multi-source Scanning - GitHub URLs, code paste, file uploads
- π― Adversarial Analysis - Generates actual attack payloads
- π€ AI-Powered Decisions - BLOCK or PASS based on severity
- π§ Auto-Fix Generation - Secure code patches for vulnerabilities
- π Risk Scoring - Executive summaries with priority rankings
- π₯οΈ CLI Tool -
redloop scan .from your terminal - π Dashboard - Real-time vulnerability visualization
redloop/
βββ backend/ # FastAPI Python Backend
β βββ app/
β β βββ core/ # Adversary & Defender agents
β β βββ api/ # REST endpoints
β β βββ models/ # Pydantic schemas
β βββ cli/ # CLI tool (redloop command)
β βββ kestra/ # Workflow definitions
βββ frontend/ # Next.js Dashboard
βββ data/ # Attack vectors database
βββ prompts/ # Agent system prompts
graph TD
A[π₯ Code Input] -->|GitHub URL / Paste / Upload| B(Kestra Workflow)
B --> C[π΄ Adversary Agent]
C -->|Vulnerabilities| D[π€ Summarizer Agent]
D -->|BLOCK/PASS Decision| E{Decision?}
E -->|BLOCK| F[π΅ Defender Agent]
F -->|Fixes| G[π€ Return Results]
E -->|PASS| G
style C fill:#ff6b6b
style D fill:#9b59b6
style F fill:#3498db
- Python 3.11+
- uv (Python package manager)
- Node.js 18+ (for frontend)
cd backend
uv sync
uv run uvicorn app.main:app --reloadcd frontend
npm install
npm run dev# Install
uv tool install redloop
# Scan current directory
redloop scan .
# Scan with auto-fix
redloop scan . --fix
# Output JSON for CI/CD
redloop scan . --output json| Method | Endpoint | Description |
|---|---|---|
GET |
/api/health |
Health check |
POST |
/api/scan |
Scan code (URL, paste, or file) |
POST |
/api/fix |
Generate fixes for vulnerabilities |
POST |
/api/scan/kestra |
Trigger full Kestra workflow |
GET |
/api/scan/kestra/{id} |
Get Kestra execution result |
curl -X POST http://localhost:8000/api/scan \
-H "Content-Type: application/json" \
-d '{
"code": "def login(user):\n query = f\"SELECT * FROM users WHERE name={user}\"",
"filename": "auth.py"
}'{
"vulnerabilities": [
{
"id": "VULN-001",
"type": "SQL Injection",
"severity": "CRITICAL",
"file": "auth.py",
"line": 2,
"description": "User input directly concatenated in SQL query",
"payload": "' OR '1'='1",
"fix_suggestion": "Use parameterized queries"
}
],
"count": 1,
"decision": "BLOCK",
"risk_score": 9
}# Required
GEMINI_API_KEY=your-gemini-api-key
# Optional - GitHub OAuth for private repos
GITHUB_CLIENT_ID=xxx
GITHUB_CLIENT_SECRET=xxx
# Optional - Kestra integration
KESTRA_URL=https://your-kestra.kestra.cloud
KESTRA_API_KEY=xxx| Category | Examples |
|---|---|
| π Injection | SQL Injection, Command Injection, LDAP Injection |
| π XSS | Reflected XSS, Stored XSS, DOM-based XSS |
| π Authentication | Broken auth, session hijacking, weak passwords |
| πͺ Access Control | IDOR, privilege escalation, path traversal |
| π₯οΈ RCE | Remote code execution, deserialization |
| π€ AI/LLM | Prompt injection, jailbreaks, data poisoning |
| Component | Technology |
|---|---|
| Backend | FastAPI, Python 3.11+, Pydantic |
| AI/LLM | Google Gemini 2.0, Kestra AI Agent |
| CLI | Typer, Rich |
| Frontend | Next.js, Tailwind CSS |
| Orchestration | Kestra |
| Deployment | Vercel |
| Code Review | CodeRabbit AI |
We welcome contributions! Please see our Contributing Guidelines.
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/RedLoop.git cd RedLoop - Create a branch:
git checkout -b feature/your-feature-name
- Make your changes
- Run tests:
cd backend && uv run pytest
- Submit a Pull Request
This project uses:
- CodeRabbit for AI-powered PR reviews
- Ruff for Python linting
- Pre-commit hooks for code formatting
| Feature | Status |
|---|---|
| GitHub URL Scanning | π§ In Progress |
| Code Paste Scanning | π§ In Progress |
| Kestra AI Agent Integration | π§ In Progress |
| CLI Tool | π Planned |
| Vercel Deployment | π Planned |
| File Upload | π Planned |
This project is built for the AI Agents Assemble hackathon (Dec 8-14, 2024).
- β‘ Kestra - AI Agent workflow orchestration
- π₯οΈ Cline - CLI-based code automation
- π Vercel - Production deployment
- π€ CodeRabbit - AI-powered code reviews
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
Built with β€οΈ by the RedLoop team.
π΄ Attack β π€ Decide β π΅ Defend β π Loop