Skip to content

its-sambhav/Sentinel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ Sentinel

Multi-Agent AI Cybersecurity Platform - Autonomous Vulnerability Detection & Security Analysis

Sentinel uses a centralized LLM powering specialized security agents to scan, simulate attacks, analyze threats, and generate actionable security recommendationsβ€”all orchestrated in a production-grade multi-agent pipeline.


🎯 Elevator Pitch

Sentinel is an autonomous cybersecurity platform that combines code scanning, attack simulation, and threat intelligence into a unified multi-agent system. One powerful LLM orchestrates five specialized agents that execute sequentially to deliver comprehensive security insightsβ€”from vulnerability discovery to patch recommendationsβ€”in minutes, not weeks.


πŸš€ Features

✨ Multi-Agent Architecture

  • 5 specialized agents working in perfect harmony
  • Sequential workflow: Scanner β†’ Threat β†’ Attack β†’ Patch β†’ Report
  • Centralized LLM orchestration for consistency and token optimization

πŸ” Scanner Agent

  • Detects 7+ vulnerability types (SQL Injection, XSS, RCE, etc.)
  • CWE/OWASP mappings with exploitability scoring
  • Realistic code analysis patterns (Bandit + Semgrep simulation)

βš”οΈ Attack Simulation Agent

  • Plans realistic attack scenarios with MITRE ATT&CK framework
  • Calculates success probability and impact scoring
  • Maps vulnerabilities to specific exploitation techniques

🎯 Threat Intelligence Agent

  • Classifies threats by severity and category
  • Maps findings to security frameworks
  • Generates exploitability metrics

πŸ› οΈ Patch Generation Agent

  • Creates remediation patches with code examples
  • Estimates complexity and risk of fixes
  • Supports auto-apply recommendations

πŸ“Š Report Generation Agent

  • Compiles executive summaries
  • Risk scoring (0-100 scale)
  • Patch coverage analysis
  • Remediation effort estimation

🎨 Modern Frontend

  • Next.js 15 with TypeScript
  • Real-time scan monitoring
  • Interactive dashboards
  • Protected routes with JWT authentication

πŸ“‘ Production-Ready Backend

  • FastAPI with async/await architecture
  • SQLAlchemy ORM with async support
  • PostgreSQL + Redis ready
  • Complete REST API

πŸ—οΈ Architecture Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        Frontend (Next.js)                        β”‚
β”‚         Real-time Scan Monitoring & Dashboard UI                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
                    HTTP/REST API
                           β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   FastAPI Backend Server                         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚         API Gateway & Authentication                       β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                      β”‚                                         β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚        Orchestrator Service                         β”‚  β”‚
β”‚  β”‚    (Manages multi-agent workflow execution)              β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚         β”‚     β”‚     β”‚     β”‚                                     β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”  β”‚     β”‚     β”‚                                     β”‚
β”‚  β”‚ Scanner β”œβ”€β”€β”˜     β”‚     β”‚                                     β”‚
β”‚  β”‚ Agent   β”‚        β”‚     β”‚                                     β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”  β”‚                                     β”‚
β”‚                β”‚Threat β”œβ”€β”€β”˜                                     β”‚
β”‚                β”‚Agent  β”‚        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                   β”‚
β”‚                β””β”€β”€β”€β”€β”€β”€β”€β”˜        β”‚  Attack  β”œβ”€β”€β”                β”‚
β”‚                                 β”‚  Agent   β”‚  β”‚                β”‚
β”‚                                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚                β”‚
β”‚                                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”            β”‚
β”‚                                    β”‚ Patch Agent   β”œβ”€β”€β”         β”‚
β”‚                                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚         β”‚
β”‚                                       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”      β”‚
β”‚                                       β”‚ Report Agent     β”‚      β”‚
β”‚                                       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
                           β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Database Layer                                β”‚
β”‚    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚    β”‚  PostgreSQL  β”‚    β”‚    Redis     β”‚    β”‚  SQLite      β”‚   β”‚
β”‚    β”‚ (Production) β”‚    β”‚    (Cache)   β”‚    β”‚ (Development)β”‚   β”‚
β”‚    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ€– Multi-Agent Workflow Explanation

Sequential Execution Pipeline

[1] SCANNER AGENT (Progress: 5% β†’ 20%)
    β”œβ”€ Input: Repository URL
    β”œβ”€ Process: Code analysis (Bandit + Semgrep simulation)
    β”œβ”€ Output: 7+ Findings with CWE/OWASP mappings
    └─ Data: Saved to `findings` table

[2] THREAT AGENT (Progress: 20% β†’ 40%)
    β”œβ”€ Input: Findings from Scanner
    β”œβ”€ Process: Threat classification & severity mapping
    β”œβ”€ Output: Threat types, exploitability scores
    └─ Data: Enhanced findings with threat metadata

[3] ATTACK AGENT (Progress: 40% β†’ 60%)
    β”œβ”€ Input: Findings + Threats from previous agents
    β”œβ”€ Process: MITRE ATT&CK mapping, attack planning
    β”œβ”€ Output: Attack scenarios with success probability
    └─ Data: Saved to `attacks` table

[4] PATCH AGENT (Progress: 60% β†’ 80%)
    β”œβ”€ Input: Findings from Scanner
    β”œβ”€ Process: Patch generation, complexity assessment
    β”œβ”€ Output: Code fixes with confidence scores
    └─ Data: Saved to `patches` table

[5] REPORT AGENT (Progress: 80% β†’ 100%)
    β”œβ”€ Input: Findings, Attacks, Patches
    β”œβ”€ Process: Aggregation, risk scoring, metrics
    β”œβ”€ Output: Executive summary + recommendations
    └─ Data: Saved to `reports` table

Why This Architecture Works

  • Sequential Processing: Each agent builds on previous results
  • State Preservation: Database maintains context between agents
  • Error Resilience: One agent failure doesn't halt pipeline
  • Progress Tracking: Real-time frontend updates (0-100%)
  • Async Execution: Non-blocking background jobs
  • Token Optimization: Single LLM orchestrates multiple specialized tasks

🧠 How One LLM Powers Multiple Agents

Centralized Intelligence, Specialized Tasks

# Pseudo-code showing LLM routing
class Agent:
    def __init__(self, llm, system_prompt):
        self.llm = llm  # Shared instance
        self.system_prompt = system_prompt  # Agent-specific instructions
    
    async def execute(self, data):
        # LLM understands context from system_prompt + input data
        response = await self.llm.chat([
            {"role": "system", "content": self.system_prompt},
            {"role": "user", "content": data}
        ])
        return response

Benefits:

  1. Cost Efficient: One LLM instance vs. five separate models
  2. Consistent: Same underlying reasoning across all agents
  3. Flexible: Easy to add/modify agent behaviors via prompts
  4. Stateful: Context flows between agents via database
  5. Scalable: Single LLM handles all reasoning

πŸ“‹ Agent Details

1️⃣ Scanner Agent

Purpose: Detect vulnerabilities in source code

Inputs:

  • Repository URL
  • Scan ID

Process:

  • Bandit analysis (hardcoded secrets, dangerous functions)
  • Semgrep analysis (weak crypto, dangerous execution)
  • Deduplication to remove false positives
  • CWE/OWASP mapping

Outputs:

  • Finding records with:
    • Vulnerability type
    • Severity (Critical/High/Medium/Low)
    • File path & line number
    • Code snippet
    • CWE ID & OWASP category
    • Exploitability score (0-1)
    • Confidence score (0-1)

Example Finding:

{
  "id": "finding-001",
  "vulnerability_type": "SQL Injection",
  "severity": "critical",
  "file_path": "src/database.py",
  "line_number": 45,
  "cwe_id": "CWE-89",
  "cwe_name": "Improper Neutralization of Special Elements used in an SQL Command",
  "owasp_category": "A03:2021 - Injection",
  "exploitability_score": 0.95,
  "code_snippet": "query = f\"SELECT * FROM users WHERE id = {user_id}\""
}

2️⃣ Threat Intelligence Agent

Purpose: Classify threats and assess impact

Inputs:

  • Findings from Scanner Agent
  • CWE/OWASP framework data

Process:

  • Match finding type to threat category
  • Calculate exploitability (0-1)
  • Calculate impact (1-10)
  • Assign threat classification

Outputs:

  • Finding enrichment with:
    • Threat type (injection, auth, crypto, etc.)
    • Exploitability metric
    • Impact rating
    • Threat metadata

3️⃣ Attack Simulation Agent

Purpose: Plan realistic attack scenarios

Inputs:

  • Findings with threat data
  • MITRE ATT&CK framework

Process:

  • Map vulnerabilities to attack templates
  • Calculate success probability (0-1)
  • Assign MITRE technique
  • Plan attack steps
  • Estimate impact

Outputs:

  • Attack records with:
    • Attack type (SQL Injection, RCE, etc.)
    • Attack vector
    • Success probability (0-1)
    • Impact score (0-10)
    • MITRE technique (T1190, T1110, etc.)
    • Attack steps (list)
    • Prerequisites
    • Mitigation strategies

Example Attack:

{
  "id": "attack-001",
  "attack_type": "SQL Injection",
  "success_probability": 0.85,
  "impact_score": 9.5,
  "mitre_technique": "T1190",
  "mitre_tactic": "Initial Access",
  "attack_steps": [
    "Identify SQL injection parameter",
    "Craft malicious SQL payload",
    "Execute against database",
    "Extract sensitive data"
  ]
}

4️⃣ Patch Generation Agent

Purpose: Generate security patches

Inputs:

  • Findings from Scanner
  • Vulnerability patterns

Process:

  • Match finding to patch template
  • Generate code fix
  • Estimate complexity (simple/moderate/complex)
  • Calculate risk (0-1)
  • Determine auto-applicability

Outputs:

  • Patch records with:
    • Original code (vulnerable)
    • Patched code (secure)
    • Explanation
    • Complexity rating
    • Risk score
    • Can auto-apply flag
    • Confidence (0-1)

Example Patch:

{
  "id": "patch-001",
  "vulnerability_type": "SQL Injection",
  "original_code": "query = f\"SELECT * FROM users WHERE id = {user_id}\"",
  "patched_code": "query = \"SELECT * FROM users WHERE id = %s\"\ncursor.execute(query, (user_id,))",
  "explanation": "Use parameterized queries to prevent SQL injection",
  "apply_complexity": "simple",
  "can_auto_apply": true,
  "confidence": 0.98
}

5️⃣ Report Generation Agent

Purpose: Compile comprehensive security report

Inputs:

  • All findings, attacks, patches
  • Aggregated metrics

Process:

  • Aggregate findings by severity
  • Calculate risk score (0-100)
  • Estimate patch coverage
  • Calculate remediation effort
  • Generate executive summary
  • Create recommendations

Outputs:

  • Report record with:
    • Overall risk score
    • Severity breakdown (critical/high/medium/low)
    • Patch coverage %
    • Remediation effort (hours)
    • Executive summary (text)
    • Detailed findings (JSON)
    • Recommendations (list)
    • Metadata

πŸ› οΈ Tech Stack

Frontend

  • Framework: Next.js 15.5.18
  • Language: TypeScript (strict mode)
  • Styling: Tailwind CSS
  • UI Components: Custom + shadcn/ui patterns
  • State Management: React hooks + Context API
  • HTTP Client: Fetch API + async/await
  • Build: Webpack (Next.js default)

Backend

  • Framework: FastAPI 0.104.1
  • Language: Python 3.11+
  • Async: asyncio + FastAPI async routes
  • Database ORM: SQLAlchemy 2.0+ (async)
  • DB Driver: aiosqlite (dev), asyncpg (prod)
  • Auth: JWT tokens
  • Validation: Pydantic v2
  • API Docs: Swagger UI (auto-generated)

Database

  • Development: SQLite with aiosqlite
  • Production: PostgreSQL with asyncpg
  • Caching: Redis (optional)
  • ORM Models: SQLAlchemy with async support

AI/Agents

  • Orchestration: Custom ScanOrchestrator service
  • Agent Base: Abstract BaseAgent class
  • LLM Integration: Ready for OpenAI/Claude/Ollama
  • Frameworks: MITRE ATT&CK, CWE, OWASP mapping

DevOps

  • Container: Docker + Docker Compose
  • Port (Frontend): 3000
  • Port (Backend): 8000
  • Environment: .env configuration

πŸ“¦ Installation Guide

Prerequisites

  • Python 3.11+
  • Node.js 18+
  • npm or yarn
  • PostgreSQL 12+ (production)
  • Redis (optional)

Step 1: Clone Repository

git clone https://github.com/yourusername/sentinel.git
cd sentinel

Step 2: Backend Setup

# Create Python virtual environment
cd backend
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Create .env file
cp .env.example .env

# Edit .env with your configuration
nano .env

# Run database migrations (if applicable)
# python alembic upgrade head

# Start backend server
uvicorn main:app --reload --host 0.0.0.0 --port 8000

Step 3: Frontend Setup

# In new terminal, from project root
cd frontend

# Install dependencies
npm install

# Create .env.local file
cp .env.example .env.local

# Edit environment variables
nano .env.local

# Start frontend dev server
npm run dev

Step 4: Verify Installation

# Check backend health
curl http://localhost:8000/health

# Frontend should be accessible at
# http://localhost:3000

# Swagger API docs at
# http://localhost:8000/docs

πŸ” Environment Variables

Backend (.env)

# Database
DATABASE_URL=postgresql+asyncpg://user:password@localhost:5432/sentinel
# For development: sqlite+aiosqlite://./sentinel.db

# API Configuration
API_HOST=0.0.0.0
API_PORT=8000
DEBUG=true

# JWT
JWT_SECRET=your-super-secret-key-change-this-in-production
JWT_ALGORITHM=HS256
JWT_EXPIRATION_HOURS=24

# LLM Configuration (when integrating)
OPENAI_API_KEY=sk-your-key-here
LLM_MODEL=gpt-4-turbo

# Redis (optional)
REDIS_URL=redis://localhost:6379/0

# CORS
CORS_ORIGINS=http://localhost:3000,http://localhost:8000

# Logging
LOG_LEVEL=INFO

Frontend (.env.local)

# API Configuration
NEXT_PUBLIC_API_URL=http://localhost:8000

# Feature Flags
NEXT_PUBLIC_ENABLE_DEMO=true

πŸš€ Running the Application

Option 1: Manual (Development)

Terminal 1 - Backend:

cd backend
source venv/bin/activate
uvicorn main:app --reload

Terminal 2 - Frontend:

cd frontend
npm run dev

Then visit: http://localhost:3000

Option 2: Docker Compose (Production)

# From project root
docker-compose up -d

# View logs
docker-compose logs -f

# Stop
docker-compose down

πŸ“‘ API Endpoints

Authentication

POST   /api/auth/login        - Login with credentials
POST   /api/auth/register     - Register new account
GET    /api/auth/me           - Get current user

Scans

GET    /api/scans             - List all scans (paginated)
POST   /api/scans             - Create new scan (triggers orchestration)
GET    /api/scans/{scan_id}   - Get scan details with metrics

Findings

GET    /api/scans/{scan_id}/findings  - Get findings for scan
GET    /api/findings/{finding_id}     - Get specific finding

Attacks

GET    /api/scans/{scan_id}/attacks   - Get attack scenarios
GET    /api/attacks/{attack_id}       - Get specific attack

Patches

GET    /api/scans/{scan_id}/patches   - Get patches for scan
GET    /api/patches/{patch_id}        - Get specific patch

Reports

GET    /api/scans/{scan_id}/report    - Get comprehensive report

System

GET    /health                - Health check

πŸ“ Folder Structure

sentinel/
β”œβ”€β”€ frontend/                          # Next.js frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ app/                      # Pages (dashboard, scan, threat, etc.)
β”‚   β”‚   β”œβ”€β”€ components/               # React components
β”‚   β”‚   β”œβ”€β”€ hooks/                    # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ lib/                      # Utilities
β”‚   β”‚   β”œβ”€β”€ services/                 # API service layer
β”‚   β”‚   └── types/                    # TypeScript interfaces
β”‚   β”œβ”€β”€ public/                       # Static assets
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ next.config.ts
β”‚   β”œβ”€β”€ tsconfig.json
β”‚   β”œβ”€β”€ tailwind.config.js
β”‚   └── .env.example
β”‚
β”œβ”€β”€ backend/                          # FastAPI backend
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ agents/                   # Agent implementations
β”‚   β”‚   β”‚   β”œβ”€β”€ base.py               # BaseAgent abstract class
β”‚   β”‚   β”‚   β”œβ”€β”€ scanner_agent.py
β”‚   β”‚   β”‚   β”œβ”€β”€ threat_agent.py
β”‚   β”‚   β”‚   β”œβ”€β”€ attack_agent.py
β”‚   β”‚   β”‚   β”œβ”€β”€ patch_agent.py
β”‚   β”‚   β”‚   β”œβ”€β”€ report_agent.py
β”‚   β”‚   β”‚   └── __init__.py
β”‚   β”‚   β”œβ”€β”€ api/                      # API routes
β”‚   β”‚   β”‚   β”œβ”€β”€ scans.py
β”‚   β”‚   β”‚   β”œβ”€β”€ findings.py
β”‚   β”‚   β”‚   β”œβ”€β”€ attacks.py
β”‚   β”‚   β”‚   β”œβ”€β”€ patches.py
β”‚   β”‚   β”‚   β”œβ”€β”€ reports.py
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.py
β”‚   β”‚   β”‚   └── __init__.py
β”‚   β”‚   β”œβ”€β”€ models/                   # Database models
β”‚   β”‚   β”‚   β”œβ”€β”€ orm.py                # SQLAlchemy models
β”‚   β”‚   β”‚   β”œβ”€β”€ schemas.py            # Pydantic schemas
β”‚   β”‚   β”‚   └── __init__.py
β”‚   β”‚   β”œβ”€β”€ services/                 # Business logic
β”‚   β”‚   β”‚   β”œβ”€β”€ orchestrator.py       # Multi-agent orchestration
β”‚   β”‚   β”‚   β”œβ”€β”€ auth_service.py
β”‚   β”‚   β”‚   └── __init__.py
β”‚   β”‚   β”œβ”€β”€ utils/                    # Utilities
β”‚   β”‚   β”‚   β”œβ”€β”€ helpers.py
β”‚   β”‚   β”‚   β”œβ”€β”€ cwe_mapping.py
β”‚   β”‚   β”‚   β”œβ”€β”€ mitre_mapping.py
β”‚   β”‚   β”‚   └── __init__.py
β”‚   β”‚   β”œβ”€β”€ database.py               # Database connection
β”‚   β”‚   β”œβ”€β”€ config.py                 # Configuration
β”‚   β”‚   └── __init__.py
β”‚   β”œβ”€β”€ main.py                       # Entry point
β”‚   β”œβ”€β”€ requirements.txt              # Python dependencies
β”‚   β”œβ”€β”€ .env.example
β”‚   └── pytest.ini
β”‚
β”œβ”€β”€ docs/                             # Documentation
β”‚   β”œβ”€β”€ ARCHITECTURE.md               # System architecture
β”‚   β”œβ”€β”€ INSTALLATION.md               # Setup guide
β”‚   β”œβ”€β”€ API_DOCUMENTATION.md          # API reference
β”‚   β”œβ”€β”€ MULTI_AGENT_EXPLANATION.md   # Agent details
β”‚   └── JUDGE_VALIDATION_GUIDE.md    # Hackathon guide
β”‚
β”œβ”€β”€ screenshots/                      # UI screenshots
β”œβ”€β”€ demo/                             # Demo scripts
β”œβ”€β”€ docker-compose.yml                # Docker configuration
β”œβ”€β”€ Dockerfile                        # Docker image
β”œβ”€β”€ README.md                         # This file
β”œβ”€β”€ .gitignore                        # Git ignore rules
β”œβ”€β”€ .env.example                      # Environment template
└── LICENSE                           # MIT License

πŸ”’ Security Notes

What Sentinel Does

  • βœ… Scans code for vulnerabilities
  • βœ… Simulates realistic attacks
  • βœ… Generates patches
  • βœ… Creates reports

What Sentinel Does NOT Do

  • ❌ Execute actual attacks
  • ❌ Modify source code without approval
  • ❌ Store sensitive credentials
  • ❌ Bypass authentication

Security Best Practices

  1. Environment Variables: All secrets in .env (gitignored)
  2. JWT Tokens: Short expiration + refresh tokens
  3. Database: Use PostgreSQL with SSL in production
  4. CORS: Restricted to trusted origins only
  5. Input Validation: Pydantic schema validation on all inputs
  6. API Keys: Rotate regularly, use scoped keys

For Judges

  • Run with test credentials (see .env.example)
  • No real data is harmed
  • Everything is reversible
  • See JUDGE_VALIDATION_GUIDE.md for details

πŸš€ Future Improvements

  • Real LLM integration (OpenAI GPT-4, Anthropic Claude)
  • Advanced ML-based vulnerability detection
  • Automated patch application with rollback
  • CI/CD pipeline integration
  • Team collaboration features
  • Compliance reporting (SOC 2, ISO 27001)
  • Custom rule engine
  • Mobile app
  • Slack/Teams notifications
  • Historical trend analysis

πŸ’₯ Challenges Faced

1. Multi-Agent Coordination

Challenge: Ensuring agents execute in sequence while maintaining state Solution: Built ScanOrchestrator service with database-backed context

2. LLM Token Optimization

Challenge: Preventing runaway token usage with 5 agents Solution: Centralized LLM with specialized system prompts instead of separate models

3. Async Database Operations

Challenge: SQLAlchemy async with multiple agents running simultaneously Solution: AsyncSession management with proper connection pooling

4. Real-time Frontend Updates

Challenge: Tracking progress from background agent execution Solution: REST API with polling + WebSocket ready architecture


πŸ“š What We Learned

  1. Agent Orchestration: Proper sequencing matters more than parallel execution
  2. LLM Efficiency: One powerful model beats five specialized ones
  3. State Management: Database as agent communication layer works well
  4. Async Architecture: Critical for handling multiple agents at scale
  5. DevX: Good error messages and logging saves debugging time

Performance Optimizations

  • Async/await throughout (no blocking I/O)
  • Connection pooling (50+ concurrent requests)
  • Redis caching for frequent queries
  • Database indexing on scan_id, finding_id, status
  • Pagination on list endpoints

Production Deployment

  • Docker containers with health checks
  • Kubernetes orchestration ready
  • Auto-scaling based on scan queue
  • CDN for static frontend assets
  • Separate read replicas for reporting

✨ Why This Project Matters

For Security Teams:

  • Automated vulnerability discovery
  • Realistic attack simulation
  • Actionable remediation patches
  • Executive reporting

For Developers:

  • Easy to understand codebase
  • Extensible agent framework
  • Production-ready FastAPI backend
  • Modern React frontend

For Enterprises:

  • Scalable to thousands of scans
  • Compliant architecture (SOC 2 ready)
  • Cost-effective (single LLM vs. multiple tools)
  • Integrates with existing pipelines

πŸ‘₯ Meet the Team

Built collaboratively by:

  • Sambhav Jain
  • Yug Agrawal
  • Divi Chopra

Made with ❀️ for the Hackathon Community

Stars ⭐ are appreciated! Fork and contribute!

About

Sentinel is a multi-agent AI cybersecurity platform that performs: - Target scanning - Attack simulation - Threat analysis - Vulnerability reporting - Security recommendations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors