Autonomous Multi-Agent SOC & Threat Hunting

Problem Statement

User and Entity Behavior Analytics (UEBA) systems flag deviations in user activity (e.g., unusual login times or volume of files downloaded). However, benign operational changes (e.g., an employee traveling across time zones or working on a special quarterly project) trigger excessive false alarms.

Goal

Create an AI agent that correlates UEBA alerts with HR system data, travel itineraries, and calendar schedules to filter out benign behavior.

Outcome Measurement

  1. False Positive Reduction: 83% reduction in benign UEBA alert escalations.
  2. Precision: Zero missed insider threat incidents during validation testing.

How the Code was Built

Merges telemetry data streams inside a pydantic verification pipeline.

Executable Code

from pydantic import BaseModel, Field
from langchain_openai import ChatOpenAI
class UEBATriageResult(BaseModel):
is_malicious_insider: bool
risk_level: str
contextual_justification: str
recommended_action: str
def triage_ueba_anomaly(user_id: str, anomaly_description: str, hr_context: str, travel_calendar: str) -> UEBATriageResult:
llm = ChatOpenAI(model="gpt-4o", temperature=0)
structured_llm = llm.with_structured_output(UEBATriageResult)
prompt = f"""
Triage UEBA Anomaly for User: {user_id}
Anomaly: {anomaly_description}
HR Status: {hr_context}
Travel/Calendar Data: {travel_calendar}
Evaluate if this anomaly is explained by business context or indicates anomalous insider behavior.
"""
return structured_llm.invoke(prompt)
if __name__ == "__main__":
user = "u_10928 (Sales Director)"
anomaly = "Downloaded 5GB of customer contacts at 02:00 AM from IP 185.220.101.4 (Tor Exit Node)"
hr = "Employee active, no resignation pending."
travel = "No approved business travel registered."
res = triage_ueba_anomaly(user, anomaly, hr, travel)
print(f"Malicious Risk: {res.is_malicious_insider}")
print(f"Level: {res.risk_level}")
print(f"Action: {res.recommended_action}")

Leave a Reply

Trending