ThreatLens AI: Building an Autonomous SOC Investigation Copilot with SIEM, XDR, and LLMs + Video

Listen to this Post

Featured Image

Introduction

Modern Security Operations Centers (SOCs) are drowning in alerts. With the average enterprise generating thousands of security events daily, analysts struggle to triage, investigate, and respond to genuine threats before they escalate into full-blown breaches. The integration of Artificial Intelligence with traditional SIEM (Security Information and Event Management) and XDR (Extended Detection and Response) platforms promises to close this gap—automating correlation, reducing false positives, and accelerating incident response from hours to minutes. At Cyber Xcelerate 2026, a 24-hour AI-powered cybersecurity hackathon hosted by Chitkara University, the 1st Runner-Up team built ThreatLens—an autonomous SOC investigation copilot that ingests security telemetry, correlates threat intelligence, and generates real-time attack timelines.

Learning Objectives

  • Understand the architecture of an AI-powered threat intelligence platform that integrates SIEM, XDR, and LLMs for automated investigation.
  • Learn how to set up a local development environment with Python, FastAPI, and ML-based exploit prediction.
  • Implement REST API endpoints for CVE analysis, exploit probability scoring, and remediation playbook generation.
  • Deploy and test a retrieval-augmented generation (RAG) pipeline for security documentation and incident response.

You Should Know

  1. Core Architecture of an AI-Powered Threat Intelligence Platform

ThreatLens AI is designed as an end-to-end threat intelligence platform that ingests CVEs from the NIST National Vulnerability Database (NVD), predicts exploitability using an ML ensemble, and generates actionable remediation playbooks via a Retrieval-Augmented Generation (RAG) pipeline. The architecture follows a modular design:

┌──────────────────────────────────────────────────────────────────────┐
│ ThreatLens AI │
│ │
│ ┌──────────┐ ┌──────────────┐ ┌──────────────────────────┐ │
│ │ NVD API │───▶│ CVE Ingestion│───▶│ Feature Preprocessor │ │
│ │ (NIST) │ │ (nvd_client) │ │ ordinal + keyword + CWE │ │
│ └──────────┘ └──────────────┘ └─────────────┬────────────┘ │
│ │ │
│ ┌───────────────────────▼─────────────┐│
│ │ ML Ensemble (Soft Voting) ││
│ │ RandomForest + XGBoost → SHAP ││
│ └───────────────────────┬─────────────┘│
│ │ │
│ ┌──────────────────────┐ ┌──────────────────────▼─────────────┐│
│ │ Knowledge Base │ │ RAG Pipeline ││
│ │ (10 security docs) │───▶│ SecurityRetriever + ││
│ │ sentence-transformers│ │ PlaybookGenerator (Groq) ││
│ └──────────────────────┘ └──────────────────────┬─────────────┘│
│ │ │
│ ┌───────────────────────▼─────────────┐│
│ │ FastAPI REST API ││
│ │ POST /analyze /predict /playbook ││
│ └─────────────────────────────────────┘│
└──────────────────────────────────────────────────────────────────────┘

This architecture separates data ingestion, ML inference, and API delivery—allowing each component to be developed, tested, and scaled independently. The ML ensemble uses soft voting between RandomForest and XGBoost classifiers, with SHAP explanations providing interpretability for security analysts. The RAG pipeline leverages FAISS (Facebook AI Similarity Search) for efficient retrieval from a curated knowledge base of security documentation.

2. Setting Up the Development Environment

To build a similar AI-powered security solution, you need a Python environment with key dependencies for ML, API development, and threat intelligence ingestion.

Step-by-step setup for Linux/macOS:

 1. Clone the repository and create a virtual environment
git clone https://github.com/your-org/threatlens-ai.git
cd threatlens-ai
python -m venv .venv
source .venv/bin/activate  macOS/Linux
 For Windows: .venv\Scripts\activate

<ol>
<li>Install dependencies with development extras
pip install -e ".[bash]"</p></li>
<li><p>Configure API keys for LLM and threat intelligence services
echo "GROQ_API_KEY=your_groq_key_here" > .env
echo "ABUSEIPDB_API_KEY=your_abuseipdb_key" >> .env</p></li>
<li><p>Train the ML model and build the FAISS index (one-time setup, ~5 minutes)
python scripts/train_pipeline.py</p></li>
<li><p>Start the FastAPI server
python -m uvicorn src.api.main:app --port 8002

For Windows PowerShell users:

 Activate virtual environment
.venv\Scripts\Activate.ps1
 Install dependencies
pip install -e ".[bash]"
 Run the server
python -m uvicorn src.api.main:app --port 8002

The server takes approximately 15 seconds to start—wait for `Application startup complete.` before sending requests. The API documentation is available at `http://localhost:8002/docs`.

3. Integrating SIEM and XDR Telemetry

Modern AI security platforms integrate with existing SIEM and XDR architectures rather than replacing them. ThreatLens ingests alerts (not raw logs) from SIEM and XDR platforms, deduplicates and correlates them, then runs cross-stack autonomous investigations.

Example: Integrating with Elastic SIEM

 elastic_connector.py
from elasticsearch import Elasticsearch
import json

class ElasticSIEMConnector:
def <strong>init</strong>(self, host="localhost", port=9200):
self.es = Elasticsearch([{"host": host, "port": port, "scheme": "http"}])

def fetch_alerts(self, index=".siem-signals-", size=100):
"""Fetch recent SIEM alerts for investigation"""
query = {
"query": {"range": {"@timestamp": {"gte": "now-1h"}}},
"sort": [{"@timestamp": {"order": "desc"}}],
"size": size
}
response = self.es.search(index=index, body=query)
return [hit["_source"] for hit in response["hits"]["hits"]]

def correlate_telemetry(self, alert_id):
"""Correlate related telemetry for a specific alert"""
 Implementation for cross-stack correlation
pass

The key insight is that AI doesn’t replace existing security tools—it enhances them by providing an oversight and reasoning layer that correlates data across silos.

4. ML-Based Exploit Prediction

The ML ensemble predicts whether a given CVE will be exploited in the wild, using features extracted from the NVD database. This allows SOC teams to prioritize patching efforts based on real-world risk rather than CVSS scores alone.

API Endpoint: `/predict` — Exploit Probability

 Predict exploit probability for a specific CVE
curl -X POST http://localhost:8002/predict \
-H "Content-Type: application/json" \
-d '{
"cve_id": "CVE-2024-21762",
"features": {
"cvss_v3_score": 9.8,
"attack_vector": 3,
"attack_complexity": 1,
"privileges_required": 2,
"user_interaction": 1,
"scope": 0,
"confidentiality_impact": 2,
"integrity_impact": 2,
"availability_impact": 2
}
}'

Expected response:

{
"cve_id": "CVE-2024-21762",
"exploit_probability": 0.87,
"risk_level": "CRITICAL",
"ensemble_votes": {"RandomForest": 0.85, "XGBoost": 0.89},
"shap_explanation": {
"cvss_v3_score": 0.32,
"attack_vector": 0.18,
"privileges_required": 0.12
}
}

The SHAP explanation provides interpretability—showing which features most influenced the prediction. This transparency is critical for SOC analysts who need to justify response decisions.

5. RAG Pipeline for Remediation Playbooks

The RAG pipeline retrieves relevant security documentation and generates custom remediation playbooks using an LLM (Groq). This transforms raw threat intelligence into actionable guidance for incident responders.

API Endpoint: `/playbook` — Generate Remediation Playbook

 Generate a remediation playbook for a CVE
curl -X POST http://localhost:8002/playbook \
-H "Content-Type: application/json" \
-d '{"cve_id": "CVE-2024-21762", "exploit_probability": 0.87}'

Expected response (excerpt):

{
"cve_id": "CVE-2024-21762",
"playbook": {
"summary": "Critical remote code execution vulnerability in FortiOS SSL VPN...",
"immediate_actions": [
"Apply vendor patch (FortiOS 7.4.1 or later)",
"Disable SSL VPN if patching is not immediately possible",
"Review VPN logs for indicators of compromise"
],
"containment": "Isolate affected systems and block outbound connections...",
"remediation_steps": [
"Step 1: Download patch from Fortinet support portal",
"Step 2: Schedule maintenance window for deployment",
"Step 3: Apply patch and verify version"
],
"verification": "Run vulnerability scanner to confirm patch effectiveness"
}
}

This capability reduces the mean time to respond (MTTR) from hours to minutes by automating the knowledge retrieval and playbook generation process.

6. Health Monitoring and Production Readiness

Before deploying to production, verify that all components are loaded correctly:

 Health check endpoint
curl http://localhost:8002/health

Expected response:

{"status":"ok","model_loaded":true,"index_loaded":true,"version":"0.1.0"}

Production deployment checklist:

  • Set `GROQ_API_KEY` and `ABUSEIPDB_API_KEY` as environment variables
  • Use a production-grade ASGI server (e.g., Gunicorn with Uvicorn workers)
  • Implement rate limiting and authentication for API endpoints
  • Set up logging and monitoring (e.g., Prometheus metrics)
  • Use a database (PostgreSQL) for persistent storage of analyzed CVEs

7. Windows-Specific Configuration

For Windows users, additional considerations apply:

PowerShell setup (not CMD):

 Install Python dependencies
pip install -e ".[bash]"

Set environment variables
$env:GROQ_API_KEY = "your_key_here"
$env:ABUSEIPDB_API_KEY = "your_key_here"

Run the server
python -m uvicorn src.api.main:app --port 8002

Troubleshooting:

  • If `uvicorn` is not recognized, run: `python -m uvicorn src.api.main:app –port 8002`
    – Ensure PowerShell execution policy allows scripts: `Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass`
    – The single-line curl format works on Windows, macOS, and Linux—use PowerShell for compatibility.

What Undercode Say

  • AI is an accelerator, not a replacement. The most effective security solutions augment human analysts rather than replacing them. ThreatLens automates correlation and playbook generation, but human judgment remains essential for complex decision-making.
  • Hackathons build real-world skills. The 24-hour pressure cooker of Cyber Xcelerate 2026 forced the team to prioritize features, make technical trade-offs, and deliver a working prototype—mirroring the constraints of real security operations.

The cybersecurity industry faces a chronic shortage of skilled professionals, and AI-powered tools like ThreatLens are part of the solution. By automating routine investigation tasks, these platforms free up analysts to focus on proactive threat hunting and strategic security improvements. However, the technology is still maturing—ML models require continuous retraining, RAG pipelines need curated knowledge bases, and integration with legacy SIEM systems remains a challenge. The winning teams at Cyber Xcelerate 2026 demonstrated that with focus, collaboration, and persistence, even a 24-hour hackathon can produce a viable security solution.

Expected Output

Introduction:

[2–3 sentence cybersecurity‑angle introduction]

What Undercode Say:

  • Key Takeaway 1: AI augments, not replaces, human security analysts.
  • Key Takeaway 2: Hackathons simulate real-world SOC pressure and accelerate skill development.

Expected Output:

Prediction:

  • +1 AI-powered SOC copilots will reduce MTTR by 60–80% within 3 years as LLMs and RAG pipelines mature.
  • +1 Open-source threat intelligence platforms will increasingly adopt ML ensembles for exploit prediction, democratizing advanced security capabilities.
  • -1 The reliance on third-party LLM APIs introduces supply chain risks—organizations must audit AI providers for security and compliance.
  • -1 Over-automation may lead to alert fatigue if AI models generate excessive false positives; continuous model tuning is essential.
  • +1 Integration of SIEM, XDR, and AI will become the default architecture for next-generation SOCs, with vendor-1eutral orchestration layers gaining traction.
  • -1 The skills gap will persist as security professionals must now master both traditional security tools and AI/ML workflows—training and upskilling remain critical.

▶️ Related Video (82% Match):

🎯Let’s Practice For Free:

🎓 Live Courses & Certifications:

Join Undercode Academy for Verified Certifications

🚀 Request a Custom Project:

Secure, high-velocity infrastructure and disruptive technological engineering. Contact our engineering team for high-tier development and proprietary systems:
[email protected]
💎 Smart Architecture | 🛡️ Secure by Design | ⭐ Trusted by Thousands

IT/Security Reporter URL:

Reported By: Khushi Kandhela – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅

🔐JOIN OUR CYBER WORLD [ CVE News • HackMonitor • UndercodeNews ]

💬 Whatsapp | 💬 Telegram

📢 Follow UndercodeTesting & Stay Tuned:

𝕏 formerly Twitter 🐦 | @ Threads | 🔗 Linkedin | 🦋BlueSky