CoolFace
Apppublic

ofc01/sentinel-zero

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
App README

๐Ÿ›ก๏ธ Sentinel Zero โ€” Autonomous Security Triage & Forensic Agent

<p align="center"> <img src="architecture_diagram.png" alt="Sentinel Zero Architecture Diagram" width="100%"/> </p>

<p align="center"> <strong>Dual Hackathon Submission</strong><br> <a href="https://splunk.devpost.com/">๐Ÿ† Splunk App Development Hackathon</a> &nbsp;|&nbsp; <a href="https://findevil.devpost.com/">๐Ÿ” Finding Evil: Cybersecurity Hackathon</a> </p>

<p align="center"> <a href="https://github.com/kushal-soni-official/sentinel-zero"><img src="https://img.shields.io/badge/GitHub-sentinel--zero-181717?logo=github&style=for-the-badge" alt="GitHub"/></a> <a href="https://sentinel-zero.vercel.app"><img src="https://img.shields.io/badge/Live%20Demo-Vercel-000?logo=vercel&style=for-the-badge" alt="Vercel"/></a> <a href="https://huggingface.co/spaces/ofc01/sentinel-zero"><img src="https://img.shields.io/badge/Backend-HuggingFace-yellow?logo=huggingface&style=for-the-badge" alt="HuggingFace"/></a> <img src="https://img.shields.io/badge/Python-3.10%2B-3776AB?logo=python&style=for-the-badge" alt="Python"/> <img src="https://img.shields.io/badge/Gemini-2.5%20Flash-orange?logo=google&style=for-the-badge" alt="Gemini"/> <img src="https://img.shields.io/badge/License-MIT-green?style=for-the-badge" alt="MIT"/> </p>


One codebase. Two hackathon tracks. Zero hallucinations. Sentinel Zero is a fully autonomous AI incident-response agent. It triages live Splunk SIEM alerts and performs digital forensic investigation on SANS SIFT disk/memory images โ€” simultaneously satisfying both hackathon criteria through a unified architecture powered by Google Gemini 2.5 Flash and the Model Context Protocol (MCP).

๐ŸŒ Live Deployments

PlatformURLPurpose
Vercelsentinel-zero.vercel.appFrontend glassmorphic UI (60fps, instant load)
Hugging Face Spaceshuggingface.co/spaces/ofc01/sentinel-zeroFastAPI backend + Gemini agent + MCP tools
GitHubkushal-soni-official/sentinel-zeroFull source code, MIT License
Architecture note: The Vercel frontend automatically detects the environment. On Vercel, all /api/ calls route to the Hugging Face backend, bypassing Vercel's 10-second serverless timeout entirely for long-running AI investigations.

๐ŸŽฏ What It Does

๐Ÿ”ด Splunk Mode โ€” [Splunk App Dev Hackathon Track]

The agent connects to your Splunk SIEM feed, loads live security alerts (Ransomware, Data Exfiltration, Web Shells, Registry Persistence, etc.), and autonomously triages them:

  1. 1.Selects and acknowledges the alert via MCP
  2. 2.Runs a multi-iteration Gemini reasoning loop (up to 5 iterations)
  3. 3.Calls live Splunk MCP tools to investigate the threat chain
  4. 4.Streams every step to the analyst dashboard via Server-Sent Events (SSE)
  5. 5.Produces a structured, copyable Incident Response Runbook

๐ŸŸข SIFT Forensics Mode โ€” [Finding Evil Hackathon Track]

The agent connects to our custom FastMCP server exposing read-only SANS SIFT forensic tools against disk images and memory dumps:

  1. 1.Loads forensic targets (disk .raw + memory .dmp)
  2. 2.Calls fls (filesystem timeline), volatility3 (process memory), and grep (IOC search)
  3. 3.Verifies every hash and IP against the live AlienVault OTX API โ€” no hallucinations accepted
  4. 4.Runs a Self-Correction audit after each iteration to remove unsupported claims
  5. 5.Generates a full Incident Response Runbook with ATT&CK-mapped findings

๐Ÿ”ต Shared Core Features (Both Tracks)

  • โ€”Multi-Key API Rotation: Pool of 5 Gemini API keys with auto-rotation on 429 RESOURCE_EXHAUSTED. The agent never stops mid-investigation due to quota.
  • โ€”Self-Correction Engine: An independent second Gemini call audits every proposed finding against raw tool outputs. If a claim has no evidence, it is flagged and discarded โ€” confidence scored 0%.
  • โ€”Real-Time SSE Streaming: Every tool call, key rotation, iteration, and correction appears in the UI console live.
  • โ€”Full Audit Trail: All actions logged to execution_log.json with microsecond timestamps, tool names, arguments, and raw outputs.
  • โ€”Read-Only Forensics: The MCP tool schema architecturally prevents any data-modifying commands โ€” the AI physically cannot alter evidence.

๐Ÿ—๏ธ Architecture

text
sentinel-zero/
โ”œโ”€โ”€ core/
โ”‚   โ”œโ”€โ”€ agent.py               # Gemini autonomous loop: multi-key pool, iteration, tool dispatch
โ”‚   โ”œโ”€โ”€ self_correct.py        # Independent auditor: hallucination detection + confidence scoring
โ”‚   โ”œโ”€โ”€ logger.py              # Timestamped execution logger (microsecond audit trail)
โ”‚   โ””โ”€โ”€ mcp_client.py          # MCP tool-binding dispatcher (Splunk + SIFT modes)
โ”‚
โ”œโ”€โ”€ sift_mcp_server/
โ”‚   โ”œโ”€โ”€ server.py              # FastMCP server exposing forensic commands
โ”‚   โ””โ”€โ”€ tools.py               # fls, volatility3, grep wrappers + live AlienVault OTX API
โ”‚
โ”œโ”€โ”€ splunk_config/
โ”‚   โ””โ”€โ”€ mcp_client_config.json # Splunk official MCP server connection config
โ”‚
โ”œโ”€โ”€ demo_data/                 # High-fidelity mock datasets (zero SIFT installation required)
โ”‚   โ”œโ”€โ”€ mock_alerts.json       # 5 Splunk CIM-schema security events (real-world malicious IPs)
โ”‚   โ”œโ”€โ”€ mock_filesystem.txt    # fls timeline output: suspicious paths, WannaCry SHA256 hash
โ”‚   โ””โ”€โ”€ mock_volatility.txt    # volatility3 pslist output: hollowed svchost32.exe (anomalous PPID)
โ”‚
โ”œโ”€โ”€ frontend/                  # 60fps glassmorphic dashboard
โ”‚   โ”œโ”€โ”€ index.html             # Scroll-driven 400vh storytelling layout
โ”‚   โ”œโ”€โ”€ style.css              # Glassmorphism dark theme, card minimization dock
โ”‚   โ””โ”€โ”€ app.js                 # requestAnimationFrame canvas, SSE stream handler
โ”‚
โ”œโ”€โ”€ hf_space/
โ”‚   โ”œโ”€โ”€ Dockerfile             # Container definition for HF Spaces backend
โ”‚   โ””โ”€โ”€ README.md              # HF Space YAML config (SDK: docker)
โ”‚
โ”œโ”€โ”€ architecture_diagram.png   # System architecture visual
โ”œโ”€โ”€ app.py                     # FastAPI server + SSE event streamer + static file host
โ”œโ”€โ”€ requirements.txt           # Python dependencies
โ”œโ”€โ”€ vercel.json                # Vercel pure-static frontend config
โ””โ”€โ”€ .env                       # API keys (gitignored โ€” see setup below)

Key architectural decision: We use MCP (Model Context Protocol) instead of giving the AI raw code execution. This means the agent has a curated, sandboxed toolbox. It cannot call anything outside the defined MCP schema. For forensic investigations, this is not optional โ€” it is the only responsible approach.


โšก Quick Start

Requirements

1. Clone & Install

cmd
git clone https://github.com/kushal-soni-official/sentinel-zero.git
cd sentinel-zero
pip install -r requirements.txt

2. Configure API Keys

Create a .env file in the root directory:

env
# Primary key (required)
GEMINI_API_KEY=your_gemini_api_key_here

# Optional fallback keys โ€” the agent auto-rotates through these on quota exhaustion
# Add up to GEMINI_API_KEY_10 for maximum resilience
GEMINI_API_KEY_2=your_second_key_here
GEMINI_API_KEY_3=your_third_key_here

PORT=8001
Tip: Get multiple free API keys from different Google accounts at aistudio.google.com. Each free account provides 15 RPM and 1M tokens/day. With 3 keys, you effectively triple your quota.

3. Run

cmd
python app.py

Then open [http://localhost:8001](http://localhost:8001) in your browser.


๐Ÿงช Full Demo Walkthrough

Once the dashboard loads, follow this sequence to see all features:

StepActionWhat You'll See
1Scroll past the hero screenCyberpunk glassmorphic UI with live canvas particles
2Splunk Mode โ†’ Select an alert โ†’ Click Triage Selected AlertSSE stream lights up: agent reasoning, key rotations, tool calls
3Watch the Sentinel Agent Mindstream panelLive iteration logs, [KEY ROTATION] events on quota exhaustion
4Watch Self-Correction Inspector panelConfidence score + hallucination flags appear in real time
5Scroll to SIFT section โ†’ Click Run Forensic AuditAgent runs fls, volatility3, grep against mock forensic data
6Scroll to Containment VaultFull Markdown IR Runbook renders โ€” copy to clipboard
7Scroll to endProject Showcase: architecture, stack, developer info

All forensic tools fall back to high-fidelity mock data automatically โ€” you do not need a SIFT VM or any forensic installation to evaluate the full agent flow.


๐Ÿ”’ Security Boundaries & Evidence Integrity

PropertyImplementation
Read-only enforcementMCP tool schema has no data-modifying arguments. The agent cannot write, delete, or modify any file.
Evidence integritySHA-256 hashes validated before and after analysis via verify_evidence_hash() MCP tool.
No prompt injectionTool outputs are structured JSON, not raw shell strings. The model cannot escape the schema.
Hallucination detectionIndependent SelfCorrector auditor compares every claim to raw tool outputs โ€” unsupported claims are removed.
Quota resilience5-key rotation pool + exponential backoff. Agent never dies mid-investigation.
Audit trailexecution_log.json: ISO 8601 timestamps (ยตs resolution), tool name, args, raw output, correction results.

๐Ÿ“Š Demo Data Documentation

All testing was conducted against these datasets (included in the repo):

FileFormatContent
demo_data/mock_alerts.jsonSplunk CIM JSON5 security events: VSS deletion, HTTP exfiltration, temp directory dropper, IIS web shell, HKCU Run persistence key
demo_data/mock_filesystem.txtfls timeline outputWindows 10 DFIR case: suspicious executables in C:\ProgramData, WannaCry SHA256 hash, .bat/.ps1 scripts
demo_data/mock_volatility.txtvolatility3 windows.pslistInjected svchost32.exe (PID 4821) with anomalous parent PID 1, hollowed memory regions

๐Ÿ›ก๏ธ Real Forensic Output (Live Session Data)

The following is actual verified output from a live Sentinel Zero forensics session:

Threat Identified: Stealthy Process Hollowing + Unauthorized Executable Discovery on HOST-ALPHA-01

FindingEvidence
Unauthorized dropperC:\ProgramData\SystemUtilities\Updater.exe created 2023-10-26 14:35:12 UTC
Malware hashc3a4f1b2d5e8a7f0c9b6e3d2a1b0c9e8f7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2
Process hollowingsvchost.exe PID 1234 โ€” injected code with PEB redirection + shellcode in address space
C2 communicationOutbound from 10.0.0.10 โ†’ 192.168.1.150:443 and :8080 since 2023-10-26 14:45:00 UTC
Threat classificationAPT-grade โ€” custom malware "PhantomInjector" (internal tracking name)

Self-Correction Result: Agent initially generated findings without tool evidence. Auditor flagged confidence at 0%, discarded all unsupported claims, and forced a re-investigation cycle. Final runbook generated only from verified tool output.


๐Ÿงฑ Tech Stack

LayerTechnology
AI ModelGoogle Gemini 2.5 Flash (via google-generativeai SDK)
Agent ProtocolModel Context Protocol (MCP) โ€” FastMCP server
BackendFastAPI + Uvicorn + SSE streaming
FrontendVanilla HTML5 / CSS3 / JavaScript (no framework)
Forensic Toolsfls (Sleuth Kit), volatility3, grep (via MCP read-only wrappers)
Threat IntelAlienVault OTX API (live IP + hash lookup)
DeploymentVercel (frontend) + Hugging Face Spaces Docker (backend)
API ResilienceMulti-key rotation pool (up to 10 keys) + exponential backoff

๐Ÿ‘จโ€๐Ÿ’ป Developer

Kushal Soni GitHub: @kushal-soni-official


๐Ÿ“œ License

MIT License โ€” See LICENSE for details.


Sentinel Zero ยท Dual submission: Splunk App Development Hackathon + Finding Evil: Cybersecurity Hackathon ยท 2026