Inspiration

In modern cybersecurity, the gap between detection and remediation is a multi-million dollar liability. According to recent IBM reports, the average Total Breach Lifecycle is 258 days (194 days to identify, 64 days to contain).

Traditional SIEMs (Security Information and Event Management) are fundamentally flawed because they are passive. They act as news reporters, alerting humans who are often asleep, overwhelmed, or too slow to react. We asked a simple question: "What if the security infrastructure didn't just watch, but actively fought back?"

This inspired AEGIS: An applied, autonomous cyber-defense swarm designed to shift the paradigm from "Passive Alerting" to "Active Defense," collapsing the breach lifecycle from months to seconds.

What it does

AEGIS is an event-driven, autonomous AI swarm that lives inside your infrastructure. It replaces the manual Alert $\rightarrow$ Analyst $\rightarrow$ Investigation $\rightarrow$ Patch workflow with an instantaneous, automated loop:

  1. Detects: It monitors live reverse-proxy logs. It doesn't wait for a human prompt; it reacts to anomalies (like SQL Injection patterns) in real-time.
  2. Investigates: The Agent wakes up and performs sub-second log forensics to isolate the attacker's IP and payload.
  3. Reasons (RAG): It performs a Semantic Vector Search across the application's source code, locating the exact file and line number responsible for the vulnerability.
  4. Deceives: It dynamically calls Docker APIs to reroute the attacker into an isolated Honeypot Container, trapping them in a fake environment to protect real data.
  5. Remediates: It generates a secure code patch and presents it to a human operator via the "Command Center" for a one-click approval.

How we built it

We architected AEGIS as a production-ready, distributed system focused on real-world usability.

  • The Nervous System: We built a local Docker Swarm containing a vulnerable Python application and Nginx. We use Filebeat to stream JSON logs to Elasticsearch, where Watcher acts as the autonomous trigger mechanism.
  • The Brain: We built the reasoning engine using Python, leveraging the Elastic Agent Builder framework. We defined custom tools that allow the LLM to query databases directly using ES|QL.
  • The Memory: We utilized ELSER (Elastic Learned Sparse EncodeR) to ingest our codebase. This allows the agent to find vulnerabilities based on semantic meaning, not just keyword matching.
  • The Interface: We built a high-performance Streamlit dashboard that visualizes the "Neural Stream" of the agent's thoughts and provides the crucial Human-in-the-Loop safety mechanism.

Challenges we ran into

  • The "Hallucination Wall": Early versions of the agent would invent non-existent tools or try to patch files that didn't exist. We solved this by implementing a Strict Schema Enforcement layer in our middleware, forcing the LLM to adhere to a rigid, deterministic execution protocol.
  • State Management & Idempotency: During a high-volume attack, the system would spawn dozens of duplicate agents. We engineered an Elasticsearch-backed state index (aegis-incidents) that locks an active threat, preventing duplicate swarm deployments.

Accomplishments that we're proud of

To meet the Quantum Hackathon's standard for Applied Innovation and Real-World Usability, we completely overhauled this project from its initial conceptual prototype into the V5.3 Production-Ready Architecture:

  1. The "God Mode" Interface: We transitioned from raw terminal outputs to a fully integrated Streamlit Command Center with live threat mapping and visual code-diffs.
  2. Safe Autonomy: We implemented the "Human-in-the-Loop" circuit breaker. AEGIS prepares the weapon, but a human must click "Approve Patch," making this a viable enterprise solution.
  3. Mathematical ROI: We successfully reduced Mean Time To Remediate (MTTR). Using LaTeX to quantify our efficiency gains: $$ \Delta T_{remediation} = T_{manual} - T_{AEGIS} \approx 258 \text{ days} - 15 \text{ seconds} $$ $$ \text{Efficiency Gain} \approx 99.999\% $$

What we learned

  • Semantic Search is for Code: We learned that vector search models are surprisingly potent at code analysis. They find vulnerabilities that standard regex/SAST scanners miss because they understand the intent of the code.
  • Agents Require Triggers: The true power of "Agentic AI" is unlocked when it is triggered by observability pipelines, transforming it from a chatbot into a proactive digital employee.
  • UX in Security Matters: A brilliantly autonomous backend is useless if security operators don't trust it. Building a transparent UI that explains why the AI made a decision is critical for real-world adoption.

What's next for AEGIS: Autonomous Cyber-Defense Swarm

  • Global Threat Intel Integration: Integrating APIs like AbuseIPDB to cross-reference attacking IPs with global botnet registries before engaging.
  • CI/CD Pipeline Native: Automatically opening GitHub Pull Requests with the generated patches, integrating seamlessly into existing developer workflows.
  • Multi-Vector Defense: Expanding the semantic vector store to autonomously recognize and patch XSS, RCE, and SSRF vulnerabilities.

Built With

  • docker
  • docker-compose
  • elastic-agent-builder
  • elastic-cloud
  • elasticsearch
  • elser
  • esql
  • fastapi
  • filebeat
  • kibana
  • nginx
  • openai
  • streamlit
  • ython
Share this project:

Updates