Alert Summary Module
The AlertSummary module creates one analyst-facing summary paragraph for every Slips alert.
It listens for generated alerts, gathers the evidence that caused each alert, queries the shared LLM module, and writes one summary line per alert to output/alerts/alerts_summary.log.
What it does
For each alert, the module:
Receives the alert on
new_alert.Loads all evidence records referenced by
alert.correl_id.Groups similar evidence descriptions into an incident-style digest.
Estimates whether the digest fits the final prompt budget.
Sends either the final summary prompt or one reduction prompt on
llm_request.Waits for the matching
llm_response.Repeats reduction layers as needed until the final prompt fits.
Normalizes the last reply into one plain-text paragraph and appends it to the alert summary log.
If the LLM pipeline fails, the module writes a one-line error entry for that alert instead of generating a local fallback summary.
Recursive summary hierarchy
This module follows the prompt style from https://github.com/stratosphereips/Slips-tools/alert_summary/inference.py as per the original specifgication, but it is completely implemented and adapted to live Slips alerts in this module.
When the grouped evidence is too large for the final prompt, the module does not truncate it. It performs a hierarchy of summaries instead:
Split the grouped digest into prompt-sized chunks.
Ask the shared LLM for one intermediate digest per chunk.
If the combined chunk digests are still too large, split and summarize them again.
Send the reduced digest to the final analyst-summary prompt.
If one grouped line is too large by itself, it is split on sentence or word boundaries so the content is preserved without clipping.
Configuration
Example section in config/slips.yaml:
alert_summary:
enabled: false
log_verbosity: 2
allowed_backends: []
llm_temperature: 0.2
llm_max_tokens: 220
llm_response_timeout_seconds: 120
Configuration reference:
enabled: enables or disables the module.log_verbosity: controls how much operational detail is written to<output-dir>/llm-summary/alert_summary.log. Use0for an empty file,1for startup, shutdown, and failures,2for per-alert queueing and request flow, and3for prompt-budget and reduction-layer details.allowed_backends: preferred runtime-ready LLM backend aliases for this module. If empty, the module falls back to the shared LLM default backend.llm_temperature: low-temperature setting used to keep summaries stable and analyst-oriented.llm_max_tokens: output budget for the final analyst paragraph.llm_response_timeout_seconds: hard timeout for one in-flight shared-LLM request. If set to0, the module waits indefinitely. On timeout, the module writes a one-line failure entry toalerts_summary.log.
Prompt design
The final prompt contains:
alert metadata
grouped evidence patterns with time ranges, counts, severities, and sample IPs or ports
explicit guidance that evidence threat levels must be weighed differently, and that
infoevidence is context only rather than a security finding by itselfexplicit separation between current-alert evidence and historical context, so history can inform recurrence and risk without being restated as if it happened in the current alert
instructions to explain the suspicious behavior, strongest supporting or weakening evidence, likely alert validity, and operational risk
Reduction prompts reuse the same alert metadata but ask the model to compress
one chunk into a shorter intermediate digest for the next reduction layer
while preserving threat-level distinctions, including the rule that info
evidence remains contextual.
Recent-history prompt context is now intentionally structured from historical patterns and alert-level metrics, not prior free-text LLM summaries. That avoids recursively feeding one generated explanation into later prompts, which can otherwise cause old details to be repeated as if they were part of the current alert.
Output files
Analyst summaries are written to:
output/alerts/alerts_summary.log
Operational logs for this module are written to:
<output-dir>/llm-summary/alert_summary.log
Operational logs for the shared LLM backend are written to:
<output-dir>/LLM/llm.log
The alert-summary log records queueing, prompt-budget checks, reduction-layer progress, request publication, replies, failures, and shutdown handling.
Shutdown behavior
The module keeps waiting during shutdown while a shared LLM request is still
in flight. That prevents the old race where the shared LLM module finished
later and published a reply after alert_summary had already exited.