LLM Agent for Threat Hunting
A local language model that triages a live security alert stream
A threat-hunting agent that builds a running profile of each user from a live Wazuh alert stream, then prompts a locally hosted Qwen2.5-7B with that frequency and business-hours context. The reply is constrained to JSON carrying severity, confidence, and a recommended response action, so a SOC pipeline can route it without a human reading prose first.
Results
01The problem
Signature and rule engines fire on single events. One failed logon, or one file read outside working hours, looks harmless on its own. It only gets interesting against the pattern of what that user normally does, and a static rule has nowhere to keep that pattern.
Handing the alerts to a hosted model would solve the context problem and create a worse one, because the alerts are the sensitive material.
02Approach
The agent keeps a rolling profile per user as alerts arrive: how often each rule fires for them, which hosts they touch, and whether the activity falls inside business hours. That profile goes into the prompt, so the model reasons about deviation from a baseline instead of about a bare event.
Inference runs on the host through Ollama. Constraining the reply to a schema turns the model into a classifier rather than a summarizer. Severity sets triage order, confidence decides whether a person gets paged, and the named action maps onto a playbook step that already exists.
03Why it matters
Two objections usually kill LLM proposals inside a SOC. Running the model locally answers the compliance one. Constraining the output answers the reliability one. Together they move the idea from a demo into something a team could actually leave running.