Manuscript Offprint
arXiv:2610.41072LanG 2.0: Energy-Efficient Agentic AI for Semi-Automated Security Operations at Scale
Anes Abdennebi, Nadjia Kara, Laaziz Lahlou, and Hakima Ould-Slimane
Abstract—Security operations centers (SOCs) need to turn terabytes of alerts, logs and flows into trusted, affordable decisions to unveil hidden threats. We present LanG 2.0, an agentic system that detects threats, correlates evidence and writes rules, investigating whether small local models can replace frontier models affordably and safely when structural safeguards, not model accuracy, provide the guarantees. It incorporates entity-anchored correlation, human approval of rule changes and a tamper-evident ledger. Tests span eight flow datasets from five networks, real XDR alerts and multistage campaigns. Against its predecessor, campaign correlation precision rises from 18.75% to 51.81%, and rule acceptance from at most 60.00% to 98.33%. Against Claude Opus 5.5, scoring flows against each network's normal traffic detects attacks on unseen networks at 73.42% F1 without false positives, versus 58.10% with 49.00% false positives, for at least 650 times less energy. Finetuned models statistically match it on alert classification and rule writing for 5.6 to 59 times less energy. The work demonstrates LanG's practical scalability, processing 3.33 million records in 6.4 minutes, over 30 million hourly, and its safeguards resisted prompt injection, label poisoning and ledger tampering, so small local models can carry most SOC detection affordably and safely.
Index Terms—Agentic AI, security operations, network intrusion detection, generalization across networks, threat classification, detection rule generation, alert correlation, green AI.
1 INTRODUCTION
A modern security operations center (SOC) sits at the end of many pipelines. A security information and event management (SIEM) system aggregates firewall, proxy and authentication logs. An extended detection and response (XDR) platform, such as Microsoft Defender XDR, or an endpoint detection and response (EDR) agent streams process, file and registry telemetry. Network sensors export flows and packet captures. Each product raises its own alerts with its own severity scale, its own timestamps and its own notion of an entity. The analyst who receives these alerts has to decide which of them describe the same intrusion, in what order the adversary acted, and which hosts, accounts and files were touched. This work is still largely manual. The 2024 IBM and Ponemon study reports a mean of 194 days to identify a breach and 64 more days to contain it [1]. In one SOC, only 0.01% of 14.4 million network alerts were associated with true attacks [2].
Research on this problem follows two main lines. Alert correlation systems link alerts from several products through shared entities, alert graphs or attack stages [3], [4], [5]. Provenance systems build causal graphs from kernel audit records and trace an attack through process, file and socket dependencies [6], [7], [8], but they need whole-system auditing on every host, which few enterprises deploy. Correlators mostly stop at grouping, and only a few recent systems explain their output in plain language [8]. None of them turns the grouped evidence into reviewed detection rules, and none reports what its own computation costs in energy.
Language models are entering SOC tooling for triage, enrichment and report writing [9], [10]. A model call is cheap for one
alert and expensive for a million. For a widely used generative model, a year of inference emits far more than its training [11], and generative inference costs orders of magnitude more energy than models built for one task [12]. A SOC running language models unmetered on every event cannot justify that cost.
Our work presents LanG 2.0 and should be distinguished from our previous work [13], which presents the platform's governance model, agent orchestration, operational controls and unified SOC workbench, mechanisms we do not claim as new here. We evaluate how the platform's cooperating agents turn heterogeneous security data into reviewed classifications, log analysis and candidate detection rules grounded in auditable evidence, at what scale and at what energy cost, and we replace the detection and rule generation models of [13]. Those detectors were trained and tested within single datasets, whereas we train and test on eight flow datasets from five networks and three exporters, real Microsoft Defender XDR alerts and multistage attack campaigns, and show that supervised flow models do not carry over to unseen networks. Those rule generators reached 90.83% and 95.50% acceptance under the validator of that work, but their rules load in the exact engine version requested for only 57.50% to 60.00% of our benchmark incidents, against 98.33% for LanG 2.0.
Our thesis is that a SOC can hand most of the detection phase to small models it trains and runs locally, provided that structural safeguards, rather than model accuracy, carry the guarantees. By structural safeguards we mean four mechanisms that hold whatever a model outputs: every correlation link must share an entity, analysts approve every change to the SOC, only one agent may deploy rules, and a tamper-evident ledger, anchored outside its database, records every action. We test it with three questions. Where do small local agents match a frontier model, and where must a frontier model, a classical model or an analyst take over (Sections 5.4 to 5.7)? Do these safeguards hold when telemetry, labels or the ledger are attacked (Section 5.8)? What does each step cost in energy (Section 5.9)?
- A. Abdennebi, N. Kara and L. Lahlou are with the Department of Software Engineering and IT, Ecole de technologie supérieure (ETS), Montreal, QC, Canada. E-mail: anes.abdennebi.1@ens.etsmtl.ca, {nadjia.kara, laaziz.lahlou}@etsmtl.ca
- H. Ould-Slimane is with the Department of Mathematics and Computer Science, Université du Québec à Trois-Rivières (UQTR), Trois-Rivières, QC, Canada. E-mail: hakima.ould-slimane@uqtr.ca
-
An auditable agentic workflow. An execution graph coordinates detection, classification, log analysis, correlation and rule generation under analyst checkpoints, with an action ledger, guardrails and energy metering for every model call. Autonomous subsystems run the same agents over millions of records without checkpoints and keep every rule in a bucket until an analyst approves it, and two of them analyzed 3.33 million records in 6.4 minutes on one workstation, over 30 million records an hour (Section 5.3).
-
Anchored correlation. The UICR and the eight hooks come from [13]. We identify phase collapse, the failure mode of that hook graph, and show that entity anchoring fixes it, raising precision on multistage campaigns from 18.75% to 51.81%, that grouping by address remains stronger on real XDR alerts, and that hub pruning keeps anchoring accurate behind a shared egress address (Section 5.2).
-
Detection across networks and rules validated by engines. Supervised flow classifiers do not transfer between networks, whereas a baseline of a network's normal traffic does, so LanG scores flows against a baseline kept for each tenant. Its rule generator writes rules in the native syntax of six engine versions that load and replay them, not significantly different from Claude Opus 5.5 (Sections 5.4 to 5.6).
-
Where small local models suffice. Under a preregistered protocol, finetuned agents of 1.7B to 8B parameters match Claude Opus 5.5 on the attack step of real IDS alerts, classical models match them on two of three tasks, and the frontier model remains necessary to name attack families on a new network until about 50 analyst labels exist (Section 5.7).
-
Safeguards under attack. Injections from published corpora placed in telemetry, poisoned analyst labels and tampering with the ledger are measured against the pipeline, with what each defense stops and misses (Section 5.8).
-
Measured cost. Energy is measured for every agent operation and for training, and compared with published frontier estimates (Section 5.9). Comparisons report confidence intervals and paired tests, and the benchmarks evaluate methods, not production deployment.
2.1 Alert Correlation and Aggregation
Recent correlators link alerts from several products. Alert2Vec embeds each alert through its subgraph in an alert graph to label its threat level, for network and host devices alike [3]. GraphWeaver correlates billions of Microsoft Defender XDR alerts that share entities and compresses the result with a minimum spanning tree [4]. MuSAR maps network alarms and application logs to ATT&CK stages and chains them into multistep attacks across hosts, with an average recall of 93.48% [5], and on a public set of 2.66 million alerts, two aggregation tools reduce the filtered alerts by 97.73% and 98.93% on average [14]. LanG also links sources through shared entities, but requires an entity witness on every graph edge, so that time or kill chain adjacency can weight a link but never create one, and passes its communities to agents that classify the incident and write rules for analyst review.
Unlike GraphWeaver, it was not tested on billions of alerts, and its correlation benchmarks are generated, not collected in a SOC.
2.2 Provenance and Log Based Investigation
Provenance systems reconstruct attacks from kernel audit graphs. KAIROS, NODLINK, FLASH, MAGIC and AirTag detect anomalous behavior by learning over graphs or raw log text [6], [15], [16], [17], [18], R-CAID embeds root causes into graph learning [19], ORTHRUS cuts the nodes an analyst must inspect by orders of magnitude [7], and OCR-APT has a language model write attack reports from anomalous subgraphs [8], although mimicry attacks reached a 100% evasion rate against five such detectors in their main evaluation [20]. Provenance gives a causal precision that LanG, which never observes process lineage, lacks, at the cost of kernel auditing on every host. Language models also detect anomalies in system logs, finetuned as LogLLM (average F1 score of 0.959 on four datasets [21]) or prompted as LogPrompt (at most 0.450 [22]), multihost log datasets support such evaluations [23], and Carbon Filter clusters the command lines behind EDR alerts, filtering about 82% of false alerts at more than 5,000 alerts per second [24]. Each method analyzes one stream, whereas LanG correlates the alerts, logs and flows that SIEM and XDR products export and calls a model only on bounded sets of events, at tens of seconds per unit where hashing handles thousands of alerts per second.
2.3 Network Intrusion Detection by Machine Learning
Flow-based detectors evaluated on public benchmarks [25], [26], [27], [28] often report near perfect scores [29], [30], yet models trained on one dataset generalize poorly to another [29], partly because addresses, ports, timestamps and TTL values let them learn the dataset rather than the attack [31]. Unsupervised detectors learn normal traffic instead, from autoencoder ensembles such as Kitsune [32] to isolation forests [33] and outlier scores built from empirical distributions such as ECOD [34], and OWAD detects, explains and adapts to shifts of that normality [35], but they do not name the attack. GPT-4 classifies NetFlow records only slightly better than random guessing [36], and flow classifiers can be backdoored by poisoning as little as 0.1% of their training data [37]. LanG combines a baseline of each tenant's normal traffic, which decides what is abnormal, with a classifier trained on several networks, which names the attack, and it confirms on four NetFlow datasets that supervised models do not transfer. Unlike OWAD, it refreshes a drifting baseline instead of adapting it continuously, and its retraining on analyst labels is exposed to the poisoning that Severi et al. demonstrate, measured in Section 5.8.
2.4 Language Models in Security Operations
Language models now parse logs [38] and assist incident response [9], [10]. On ExCyTIn-Bench, the best agent investigating incidents reaches a mean reward of only 0.606 [39], and in a study with 18 analysts and 50 incidents, summaries written by a model alone omitted critical details in 35% of cases and contained factual errors in 42% [40]. Hammar et al. plan incident responses with a finetuned 14B model, retrieval and lookahead, with a bounded probability of hallucination and up to 22% shorter recovery times than frontier models [41]. For detection rules, SIGMERGE turns commands from threat reports into Sigma rules with components built on Qwen3-1.7B and detected 8 of 10 attacks taken from threat reports [42], and NeuroYara ranks byte sequences with neural networks to assemble YARA rules [43]. Each of these systems addresses one task, whereas LanG chains them all, accepts a rule only when the engine of the requested version loads it and, in line with Kramer et al., keeps an analyst at every step that changes the SOC. Like Hammar et al., it finds a small local model close to a frontier model on narrow tasks. Unlike SIGMERGE, it does not extract rules from threat reports, and its YARA rules trail those of the frontier model. Finally, models that read text an attacker can influence inherit a new attack surface, since instructions planted in retrieved data can steer them [44], and no existing defense stops such injection reliably [45]. BIIPIA found every tested model vulnerable to instructions hidden in external content [46], and defenses mark untrusted text [47] or classify it with a small detector such as Prompt Guard 2 [48]. LanG adds structural limits to such filters and tests both against BIIPIA attacks in its telemetry.
2.5 Energy and Carbon Accounting for AI
Inference now dominates the footprint of widely used generative models [11]. Multipurpose generative models cost orders of magnitude more per inference than models built for one task [12]. Measuring inference energy [49] is error prone: one carbon calculator reports 400% more energy than another on the same job, with CodeCarbon closest to a wattmeter [50], [51], estimates from FLOPs understate measured LLM energy [52], estimates from TDP overstate it by up to 4.1 times [49], and the power sensor of A100 and H100 GPUs samples only 25% of the runtime [53]. These works measure models, not security workflows. LanG attributes energy to each agent operation of a SOC, separates the marginal energy of a call from the idle draw, and enforces budgets for each tenant, within the limits above.
Table 1 summarizes the differences. We avoid a priority claim, which would require an exhaustive survey of SIEM, XDR, provenance and sustainable computing systems.
3 PROBLEM STATEMENT AND THREAT MODEL
Let be a set of log sources, such as a SIEM export, an XDR alert feed or a flow capture, each emitting records in its own format, which a normalizer maps to events
where is a timestamp, the source, the next five fields the network tuple with protocol , the host, the account, and the process and its parent, a file path, a command line, the set of indicators of compromise, the set of ATT&CK techniques, the set of tactics and the severity. Any field may be empty. Let be the set of events collected over an investigation window, and Table 2 groups the notation of the paper.
An attack campaign is a subset produced by one adversary pursuing one objective. Campaigns may overlap in time, reuse techniques, and move from network to host evidence with no shared field. Benign events are the complement of all campaigns. The correlation problem is to find a partition of that matches the campaign partition. We evaluate the quality, cost and review volume of that partition, not attack scenario reconstruction.
Threat model. The adversary can compromise hosts and accounts and generate arbitrary benign-looking traffic. We assume that the collection pipeline is trusted, that at least part of the adversary's activity is visible in at least one source, and that timestamps are accurate within the correlation window after normalization. Log tampering and evasion of the upstream detectors are out of scope. The language model runs locally, so evidence stays in the SOC, and its outputs are untrusted suggestions that must be grounded in events. The adversary also controls text that reaches the agents through telemetry, such as request paths, user agents, log messages and alert names, and may plant instructions there to lower a verdict, change a technique, steer a rule or leak data. A fraction of the analyst labels that adapt the flow classifier may be wrong or adversarial, and labels approved by an autonomous policy may be the system's own errors. For the action ledger, we assume an adversary with write access to its database but not to the ledger key or the store of its anchors. Malicious analysts are covered only as sources of poisoned labels. LanG can also call frontier models such as GPT, Claude and Gemini, which take evidence out of the SOC and escape the carbon plane, so we use one, Claude Opus 5.5, only as an external baseline on data without tenant information, with published energy figures.
4 METHODOLOGY
LanG turns the output of many security tools into reviewed decisions through a chain of stages, each shrinking the evidence that the next stage, and finally the analyst, must examine. Records from all tools are merged into incidents (Section 4.1), log analysis keeps a bounded primary set of relevant events (Section 4.2), and the anchored multihook graph groups it into evidence communities (Section 4.3). Detection and rule generation agents (Section 4.4) work with classification, log analysis and correlation agents in a workflow with analyst checkpoints (Section 4.5), which autonomous subsystems run over millions of records without checkpoints, keeping their rules in buckets (Section 4.6), and a carbon plane meters every model call (Section 4.7). The analyst thus reviews a few evidence communities and rule buckets instead of every record or one workflow per alert. Fig. S1 of the supplement shows the data and evidence plane and Fig. 1 the agentic execution plane. Connectors ingest SIEM, XDR, EDR, network capture, log and threat intelligence data, and every store serves one tenant.
4.1 Correlating Incidents Across Tools
Each tool reports its own fragment of an intrusion, such as an authentication burst in the SIEM, a process tree in the EDR or a flow at a network sensor. The first stage, from our previous work [13], joins these fragments into Unified Incident Context Records (UICRs) with exact merge rules, so that later stages reason over incidents rather than over isolated alerts. Two records merge when they share a correlation key, such as a five-tuple or an alert identifier, the fingerprint of an indicator, or an address within the incident window. After each merge, a bounded triage score combines the indicators, the alerts, the furthest kill chain phase, with ATT&CK tactics [54] mapped to the seven Lockheed Martin phases [55], and the confidence of the local detection models. It orders the analyst queue and feeds the relevance ranking of the next stage. Section S2 of the supplement gives the record, merge predicates, score and incremental algorithm.
4.2 Efficient Log Analysis
An incident can hold thousands of log events, more than an analyst can read or a prompt can hold, so LanG reduces them before any
TABLE 1
Comparison of LanG with representative correlation, investigation, response, rule generation and accounting approaches.
| Work | Input data | Multisource | Output | Explanation | Energy report | Budget | Core technique |
|---|---|---|---|---|---|---|---|
| Alert2Vec [3] | network, host alerts | partial | threat levels | - | - | - | alert subgraph embedding |
| GraphWeaver [4] | XDR alerts | partial | incidents | - | - | - | shared entities, spanning tree |
| MuSAR [5] | alarms, application logs | ✓ | attack chains | - | - | - | ATT&CK stage linking |
| Carbon Filter [24] | EDR alerts | - | false alert clusters | - | - | - | similarity hashing |
| KAIROS [6] | kernel audit | - | summary graph | - | - | - | temporal GNN |
| ORTHRUS [7] | kernel audit | - | attack paths | - | - | - | GNN, dependency analysis |
| OCR-APT [8] | kernel audit | - | attack reports | ✓ | - | - | subgraph anomaly, LLM |
| Hammar et al. [41] | incident logs | - | response plans | - | - | - | finetuned LLM, lookahead |
| SIGMERGE [42] | threat reports | - | Sigma rules | - | - | - | small LLM pipeline |
| CodeCarbon [51] | any program | n/a | n/a | n/a | process level | - | power sampling |
| LanG (ours) | SIEM, XDR, logs, flows | ✓ | communities, rules | ✓ | per operation | ✓ | anchored hooks, site baselines, summaries assisted by LLMs |
TABLE 2
Notation, grouped by the section that defines each symbol.
| Symbol | Meaning | Symbol | Meaning |
|---|---|---|---|
| Events and correlation (Sections 3 to 4.3) | |||
| event (Eq. (1)), set | attack campaign | ||
| process, parent process | ATT&CK tactics, severity | ||
| indicators, ATT&CK techniques | command line | ||
| event confidence (Eq. (2)) | primary set of events | ||
| hook (Table 3) | entity, context hooks | ||
| weight, damping (Eq. (4)) | edge threshold (Eq. (5)) | ||
| Flow detection (Section 4.4) | |||
| tenant baseline, reference part | ranks of flow , features | ||
| score, neighbors (Eq. (6)) | alert threshold, target FPR | ||
| Execution, ledger and energy (Sections 4.5 to 4.7) | |||
| ledger record, its hash | work units, workers | ||
| energies (Eq. (7)) | power, idle power | ||
| call duration, CPU utilization | intensity of region (Eq. (8)) | ||
| Evaluation (Section 5) | |||
| campaigns, events with address | campaigns behind one egress | ||
| labels of a new network | share of poisoned labels | ||
model reasons over them and every model call stays bounded. Events are first deduplicated by fingerprint and scored with
where is the event confidence and maps severity to . The top events (100 by default) form the primary set . Among them, events with no technique, no alert name and confidence below 0.7 are sent to the model for semantic tagging, with at most 30 calls per scan. The log analysis agent then analyzes the leading event of a workflow's evidence, never the raw stream, and returns a summary, a risk level, recommended actions and typed indicators in at most 800 output tokens, for the rule planning agent and the analyst. Its cost therefore does not grow with the volume of the logs. For millions of lines, the front stage of the autonomous subsystems (Section 4.6) reduces the input before incidents are even formed. It keeps only the records whose level is severe or whose message carries an attack indicator, and masks variable fields such as addresses, numbers and identifiers, so that lines of one event type share a message pattern. One work unit then stands for all the suspicious lines of a pattern, service and host.
4.3 Anchored Multihook Event Correlation
UICR merging is exact and fast, but it only joins records that share a key, an indicator or an address. It cannot link a brute force burst seen by the SIEM to the account change that the EDR reports on
TABLE 3
Correlation hooks. Hooks marked E are entity hooks and may anchor an edge. Hooks marked C are context hooks.
| Hook | Class | Weight rule |
|---|---|---|
| Temporal | C | for (s) |
| IP linkage | E | 1.0 shared address, 0.8 NAT pivot (), 0.7 same /24 |
| Host cooccurrence | E | 0.85 same host within 120 s, 0.4 same host otherwise |
| Flow pattern | C | protocol 0.3, destination port 0.4 (0.15 if within 100), source port 0.2, volume ratio above 0.8 adds 0.1 |
| IoC overlap | E | |
| Kill chain | C | phase distance rule (0.8, 1.0, 0.6, decaying) |
| Behavioral | E | process 0.5, parent and child 0.7, command Jaccard , file 0.4 |
| User session | E | 0.9 same account |
a host minutes later. The second stage addresses this gap with a graph of events whose edges combine several weak signals.
4.3.1 Correlation Hooks
A hook is a function that measures one kind of relation between two events. Table 3 lists the eight hooks. The temporal hook decays exponentially inside a window :
The kill chain hook rewards adjacency of phases. With , it returns 0.8 for , 1.0 for , 0.6 for and beyond. The behavioral hook adds evidence from identical processes, parent and child relations, command-line Jaccard similarity above 0.3 and identical file paths.
4.3.2 Composite Weight and Anchoring
Let be the positive hook weights of a pair sorted in decreasing order. LanG combines them with geometric damping so that many weak signals cannot outweigh one strong signal:
Our first implementation added an edge whenever with , which fails (Section 5). Two attack events from different campaigns in adjacent phases receive a kill chain weight of 1.0, plus a temporal weight when close in time, so context hooks connect all campaigns through each phase and modularity optimization returns one community per group of phases, an effect we call phase collapse. The fix requires an entity witness:
(5) where is the set of entity hooks in Table 3. Context hooks still shape the weight of anchored edges and thus the community structure, but they can no longer create an edge alone.
4.3.3 Community Detection and Super Nodes
LanG runs Louvain modularity optimization [56] on the weighted graph with resolution 1.0 and a fixed seed. When a community exceeds 100 events, the events of each phase beyond the ten most relevant are folded into a super node that keeps the five most relevant events, the number folded and their mean confidence. This bounds the model context, and the analyst can expand the super node. Algorithm S2 of the supplement summarizes the stage.
Complexity. Hook evaluation is constant time per pair, so graph construction costs and Louvain runs in near-linear time in the number of edges. The top cut bounds the quadratic term regardless of the raw event volume, and UICR merging, which is linear in the number of incidents per record, runs before it. Section 5 measures both.
4.4 Detection and Rule Generation Agents
4.4.1 Flow Detection Across Networks
Shared representation. Flow exporters disagree on units, directions and feature sets. LanG maps every flow, whether a NetFlow v3, CICFlowMeter or NTLFlowLyzer record or a flow assembled from a packet capture, to 24 fields that all of them provide, in NetFlow units: protocol, destination port, packets and bytes per direction, duration, extreme packet lengths, interarrival statistics, throughput, TCP flags and window sizes. It adds bytes per packet in each direction, the packet rate, the ratio of returned to sent bytes and the TCP flag bits. Addresses, source ports, timestamps and TTL values are withheld, since they let a model learn the dataset rather than the attack [31]. Labels map to seven families (benign, denial of service, reconnaissance, exploitation, brute force, malware and command and control, and collection), each tied to an ATT&CK tactic.
Site baseline. Each tenant keeps a baseline of at least 1,000 benign flows (5,000 here) sampled over the capture period. Quantile grids of map the numeric features of a flow to percentile ranks , and the anomaly score is the mean distance to the nearest reference flows in rank space,
where holds 70% of the baseline. The threshold is the quantile of a over the other 30%, for a false positive rate . The features furthest in the baseline's tails explain alerts.
Family classifier. Gradient boosted trees [57] name the family from the same ranks, the protocol and the TCP flag bits, trained with class balancing weights on eight datasets from five networks, each ranked against its own baseline. A flow is an attack if or if the classifier gives an attack family a probability above 0.9. When the baseline flags a flow that the classifier calls benign, the agent reports an unknown anomaly and its most likely family.
Adaptation and drift. Analyst decisions at the classification checkpoint become labels: an approval confirms the detected family, a modification supplies the analyst's family, and a rejection marks the flow benign. Only decisions of human principals are exported, so approvals by an autonomous policy never become labels. A label audit sends a benign label on a flow that the baseline finds anomalous to a second analyst before use. Once 50 flows of a tenant are labeled, the classifier is retrained on a replay sample of its training data plus the labeled flows, weighted 20 times, for that tenant only. A holdout drop keeps 25% of the labels aside, stratified by family, and lets the candidate replace the current model only if its benign false positive rate stays below max(1.5α, current+0.5) points and neither its macro F1 nor its recall on a canary sample of the training networks drops by more than two points. A population stability index above 0.25 on any feature between recent traffic and the baseline flags it for refresh. Since the baseline alone decides what is anomalous, feedback changes how alerts are named and can add confident alerts but never removes one the baseline raises.
4.4.2 Rule Generation Validated by Engines
Data. The training set holds 36,553 pairs of incidents and rules built from Emerging Threats Open (Snort 2.9 and Suricata 6 and 7 editions), the Snort community rules for Snort 2.9 and Snort 3, Emerging Threats rules converted to Snort 3 with snort2lua, public YARA rules and SigmaHQ. Unlike the data of [13], whose "Snort" targets were mostly Suricata rules, each target is written in the native syntax of the engine and version the input names. Each target is grounded, so every string it matches appears in the input as an indicator, and rules needing regular expressions, byte tests or flow bits are excluded. Vendor metadata is removed, identifiers are moved to a local range, every target is loaded by its engine, and the data are split by rule template across engines, so a detection trained for one engine never appears in another engine's test set.
Model and serving. A single model serves all six targets: Qwen3-1.7B [58] adapted with LoRA [59] of rank 32, trained on the rule tokens for two epochs (2.5h on one GPU, a run whose energy was not metered and is bounded in Section 5.9). Its prompt states the engine and version, threat name, category, application protocol, references and indicators. For serving, the adapter is merged, quantized to 8 bits and run by llama.cpp [60] through Ollama, on the same metered path as every other local model. An incident with addresses but no content indicator receives a deterministic indicator rule, so the model never invents payloads.
4.4.3 Finetuned Agents for the Detection Phase
Three agents of the detection phase can run a small finetuned model instead of a general one. The alert analyst reads one IDS or HIDS alert (source, rule, groups, program and log line) and names the attack step it shows, among ten steps and none, with its ATT&CK technique. The incident grader reads a Defender XDR incident, rendered as a header and up to 12 alerts with their category, techniques and entity roles, and grades it as a true positive, a benign positive or a false positive. The family name reads a flow that the site baseline flagged, with its values and units, the service of its port, its decoded flags, the five features furthest in the baseline's tails and the anomaly score, and names its family or calls it a false alarm. Each agent answers in a JSON schema and its prompt never names a data set, network or organization.
Each agent is a LoRA adapter on a Qwen3 base model [58], trained on the completion only. The base grows only when needed: an agent starts at 1.7B parameters and moves to 4B, then to 8B with 4-bit QLoRA [61], only if its validation macro F1 stays below that of the frontier model on the same validation items (the alerts, incidents or flows of the validation split, one prompt each) and the previous step gained at least two points. The adapters are merged, quantized to 8 bits and served through Ollama with greedy decoding, on the metered path of every other model. Training energy is the difference of the GPU's NVML energy counter read just before and after the training loop, plus a CPU share of about 1%, so it covers the training run alone, and inference is metered for each call.
4.5 Semi-Autonomous Multiagent Execution
The stages above feed a graph of cooperating agents (Fig. 1), semi-automated so that a human stays in the loop. At the classification checkpoint an analyst can approve, reject or modify the result, a second checkpoint precedes storing or deploying rules, and a third follows an engine's rejection of an approved rule.
Execution order. The agent graph runs in supersteps whose parallel outputs are merged in a fixed order, so parallelism does not change the outcome. The detection agent scores the flow against the tenant's traffic baseline and names its attack family (Section 4.4), and the classification agent returns a severity and an ATT&CK technique that is checked against a local copy of the catalog. The workflow then pauses at the first checkpoint, and a rejection ends it. After approval, the log analysis agent and the correlation agent run in the same superstep, the latter supplying the anchored evidence communities of Section 4.3. A deterministic verdict then assigns a triage score in [0, 100] and a priority from P1 to P4. A benign verdict sends the incident directly to the report.
Rule planning and deployment. For a threat verdict, the rule planning agent selects formats from the evidence: Snort 2, Snort 3 and Suricata for network evidence, Sigma for log evidence, and YARA in every case. One author agent per format writes a rule with the finetuned generator of Section 4.4. A deterministic validator checks each rule statically, loads it into the engine and version it targets, then replays it against the captured traffic when available, or against the workflow logs for Sigma. An invalid rule returns to its author for revision, at most twice by default. A consistency check flags disagreements between agents, such as a severity that contradicts the triage score. Rules approved or edited at the second checkpoint are loaded again into their engines, and if an engine rejects one, a third checkpoint lets the analyst deploy, correct or withhold it, since one invalid rule can stop a sensor from loading its ruleset. Only the deployment agent writes to the rule store, and it refuses to write without the required decisions.
Identity, permissions and ledger. Each agent has a stable identity, a version and a declared tool set, and its resolved configuration (version, model binding, prompt template and tools) is hashed at every run into an agent revision, so a change of model or prompt is always attributable. A permission layer checks every tool and model call against the declared tools and records any refusal, and a guardrail sentinel scans every model input and output for prompt injection and data leakage. At intake, every untrusted string of an incident (packet fields, log messages, alert names and indicators) is normalized (Unicode folding, zero-width characters, escapes and whitespace) and scanned on its own. A blocked field is replaced by a placeholder in what the models see and kept as evidence, and the incident is marked as suspected of injection, so it never receives a benign verdict and an autonomous policy abstains on it, while the workflow never halts, since halting would let one string suppress an incident. Prompt Guard 2 [48] can add a learned layer to this scan, and spotlighting [47] can mark untrusted text in prompts. Agents may only write alert rules, so a pass or drop rule is invalid unless an analyst overrides it, indicators a model names are kept only if they occur in the evidence, and internal addresses and secrets never reach external threat intelligence. Every action (node run, model or tool call,
guardrail scan, routing decision, checkpoint or analyst decision) is appended to a ledger kept for each tenant. Record stores the principal, the agent revision, hashes of the prompt, input and output, redacted snapshots, token counts and the emission record identifier, and its hash covers this content and the previous record, , where is SHA-256, or HMAC-SHA-256 with a ledger key. Database triggers reject updates and deletions, verification recomputes the chain, and since without a key an adversary with write access could rebuild it, keyed hashing is recommended. A chain alone cannot reveal removed last records or a restored backup, so the ledger exports signed anchors (head sequence number, hash and count) to a store outside the database, against which verification detects truncation and rollback. A record that cannot be written goes to an append-only pool and marks the ledger degraded, and critical actions (analyst decisions and rule writes) then fail closed.
4.6 Scaling with Autonomous Subsystems
One workflow costs tens of seconds of inference and each checkpoint costs analyst attention, so for millions of flows and log lines a day, one workflow per alert would take days of computation and thousands of checkpoint decisions. For such inputs, analysts launch autonomous subsystems, choosing the sources and the budget of workflows and workers, possibly several at once, for example one per data source. Each runs the agent graph of Section 4.5 with the same agents, tools, guardrails, ledger and carbon plane, and differs from an interactive workflow in three ways (Fig. S5, Algorithm S3 of the supplement).
A front stage in linear time. The input streams through a front stage in chunks, so memory holds only what survives. Flows are scored in batches by the detector of Section 4.4, and log records are kept when their level is severe or their message carries an attack indicator (Section 4.2). The surviving records, called suspects, are merged into incidents with the predicates to of Section 4.1 in a disjoint set structure. Keys and fingerprints are hashed, and an address in time bucket is joined to the same address in the previous bucket, so the merge is linear in the number of suspects instead of comparing every record with every open incident as Algorithm S1 does. Suspects that share an attack signature then form one work unit, whatever their incident. The signature is the detector's attack family for flows, or the message pattern for logs, with the target service and network or host. Each unit receives the triage score of Eq. (S4) on its evidence, and units are ranked by , where counts its suspects.
Checkpoints answered by a policy. Each work unit becomes one workflow, and a subsystem runs its highest-ranked units on parallel workers. A policy principal approves every checkpoint. It is a system identity naming the subsystem and the analyst who launched it, so every ledger decision stays attributable to a person.
Rule buckets instead of deployment. Approving every checkpoint is safe only because the deployment agent of a subsystem never writes to the rule store. It places every rule, with its engine verdict and the number of suspects it covers, into a bucket kept for each subsystem and attack family. Analysts or the SOC team review the buckets when convenient, by item or in bulk. An approval deploys the rule through the deployment agent and is recorded with the analyst's identity in the ledger of the workflow that wrote the rule, and a rule its engine rejected needs an explicit override. A subsystem therefore automates analysis, not change.

Fig. 1. Agentic execution plane as an execution trace. Columns are agent graph steps, lanes the principal in control. Orange stations call a model, blue ones are deterministic. The analyst reviews the classification and the rules, and decides at the dashed third checkpoint on rules an engine rejects. Only the deployment agent (padlock) writes rules. Model inputs and outputs cross a guardrail (violet), every action is appended to the hash chained ledger, and energy accrues only at model calls.
4.7 Carbon-Aware Operation
Every model invocation in LanG passes through one tracker, which takes energy from the most precise source available (Fig. S2 of the supplement): NVML power at 10 Hz on NVIDIA GPUs, RAPL counters on Intel CPUs, a utilization model over the nominal CPU package power, or, when nothing can be read, an analytical estimate from two floating-point operations per parameter per token [62], calibrated against hardware readings of the same host class (Eq. (S5) of the supplement). A GPU that idles at tens of watts dominates a call of a few hundred milliseconds, so LanG stores both the total device energy , following CodeCarbon [51], and the marginal energy of a call of duration ,
where the power is read from NVML or RAPL or, under the utilization model, is for CPU utilization and nominal package power (65 W by default), and is the median power over five quiet seconds at zero GPU utilization, refreshed in the background and stored with each record, since power sampled just before a call still carries the tail of the previous one. The total is what keeping the model ready costs, the marginal one what a new call adds. Emissions follow as
where is or , PUE is the power usage effectiveness of the data center, the ratio of its total facility energy to the energy of its computing equipment, and is the operational carbon intensity of region , taken from a static table of 56 regions built from Ember annual averages [63], which keeps results reproducible and lets the platform run air-gapped. Each record carries a tenant, a model, an operation label and a success flag, a tenant administrator sets a monthly budget with an alert level, 80% by default, and a telemetry fault removes a record but never blocks an inference. Algorithm S4 of the supplement summarizes the tracker.
5 EVALUATION
Sections 5.2 and 5.6 compare it with the previous LanG, Section 5.3 runs it at scale, Sections 5.4 to 5.7 compare it with Claude Opus 5.5 (first question), Section 5.8 attacks its safeguards (second question), and Section 5.9 measures energy (third question).
5.1 Setup
All experiments ran on one workstation with an NVIDIA GeForce RTX 4080 SUPER GPU, Python 3 and Ollama for local inference. For correlation and analysis we used Llama 3.2 with 3B parameters and Qwen 2.5 with 7B parameters, both with 4-bit quantization. Carbon figures use the world average intensity of 475 gCOe/kWh and a PUE of 1.0 unless stated otherwise.
Corpora. We use six log corpora, each generated to exercise one ATT&CK technique: remote system discovery (T1018), brute force (T1110), account manipulation (T1098), data from the local system (T1005), web protocols (T1071) and exfiltration (T1041). Each corpus is a JSON lines file of gateway and application logs, labeled per record with the technique of its generator, whereas our earlier benchmarks took every error or warning line as an attack.
Benchmarks. Benchmark A samples 2,000 events from each corpus and defines ground-truth incidents as attack events that share a source address within a 10-minute window. Benchmark B tests correlation across files with overlapping campaigns, each a six-stage kill chain whose stages come from the six corpora, so every campaign spans six log files. Network stages carry the attacker, victim and command and control addresses. Endpoint stages carry only host and account, except for a fraction of events that also record the host address, as logon events do. Campaigns start 12 minutes apart and stages 9 minutes apart, so they interleave, and benign records reuse the same hosts, accounts and subnets. A fraction of campaigns share one egress address, as behind NAT. The grid crosses , 150 or 600 benign events, and , 30 seeds each.
Real alerts. GUIDE [9] holds 13 million pieces of evidence from Microsoft Defender XDR across one million incidents, grouped by its production correlation and graded by customer analysts. We aggregate its training file into 1,265,644 alerts of 5,769 organizations, treat placeholder codes of entity columns as missing, and draw 50 windows of one day (207 to 1,348 alerts, at least 20 organizations each) and 20 windows of seven days, whose ground truth, the pair of organization and incident, is Defender's own grouping by shared entities. The AIT alert data set [14] holds Suricata, Wazuh and AMiner alerts of eight simulated organizations, with the time window of every attack step. An alert takes its window's step only if its rule fires at least ten times its background rate there, split by organization (five to train, one to validate, two to test).
Statistics. Proportions carry Wilson intervals (Clopper and Pearson at 0 or n), other metrics bias-corrected and accelerated bootstrap intervals that resample whole clusters (seeds, windows, organizations, networks, or the alerts of one rule in one scenario) or, for the three test networks of the family name, single flows, paired proportions the exact McNemar test [64], and families of comparisons the Holm correction. All intervals are at 95%. The code and results will be made public at https://github.com/RoronoaZ/LanG (Section S13 of the supplement).
Detection and rule generation setup. The detection experiments use the NetFlow v3 releases [65] of UNSW-NB15, ToN-IoT, BoT-IoT and CSE-CIC-IDS2018 [25], [26], [27], [28], CI-CFlowMeter exports of ToN-IoT, BoT-IoT and UNSW-NB15 (the last named CIC-UNBW24), and BCCC-Cloud-DDoS24 exported by NTLFlowLyzer: eight datasets from five networks and three exporters. Detection runs on the CPU (Intel i7-12700KF). Its RAPL counters need root privileges, which we do not grant, so its energy comes from the utilization model of Eq. (7), with an upper bound at the CPU's full 190 W turbo power. Rule generation and the local language models run on the GPU, metered by NVML and timed in a separate pass with no other load. The frontier baseline is Claude Opus 5.5, queried once per item without tools, with 0.24 to 0.34 Wh per request from published figures [66], [67], [68]. Rule engines are Snort 2.9.15, Snort 3.10, Suricata 6.0.4 and 7.0.17, YARA 4.1 and pySigma 2.0.
Baselines and metrics. We compare with union by shared address (IP only), union by shared address, host or account (entity union, which mimics pivoting in a SIEM), a union by shared entities that drops entities seen in more events than a threshold chosen on held-out windows (40 on Benchmark B, 320 on GUIDE), inspired by GraphWeaver [4] (hub-pruned union), and a time window partition with a 5-minute gap. Unanchored hooks is the graph of eight hooks and Louvain stage exactly as released in our previous work [13], and LanG anchored differs from it only by Eq. (5). We report B³ precision, recall and F1 over attack events [69], [70] and noise isolation, the fraction of predicted attack clusters that contain no benign event.
5.2 Correlation Quality
B³ scores each attack event: precision is the share of its predicted group from its own campaign, recall the share of its campaign in its group, both averaged over events, and noise isolation is the share of predicted groups free of benign events. On Benchmark A, whose incidents are defined by address and time, union by address and LanG reach a B³ F1 of 99.90% to 99.97% on all six corpora with full noise isolation, while the time window baseline merges everything (0.10%), so it cannot rank methods linking by address.
Table 4 reports the harder Benchmark B and the real GUIDE alerts, with three findings. First, anchoring fixes the phase collapse
TABLE 4
Correlation quality (B³, %, attack events). Benchmark B: mean over 12 cells of M, benign volume and φ (30 seeds each), without (η = 0) and with (η = 1) a shared egress address. GUIDE: 50 one-day and 20 seven-day windows. NI: noise isolation.
| Method | Benchmark B | GUIDE | |||||||
|---|---|---|---|---|---|---|---|---|---|
| η = 0 | η = 1 | one day | 7 days | ||||||
| P | R | F1 | NI | F1 | P | R | F1 | F1 | |
| Time window | 18.80 | 99.88 | 31.17 | 0.00 | 31.13 | 42.68 | 48.57 | 28.82 | 59.78 |
| IP only | 99.67 | 44.83 | 60.12 | 99.65 | 42.12 | 84.38 | 59.87 | 60.41 | 71.58 |
| Entity union | 39.06 | 83.33 | 45.42 | 29.32 | 30.77 | 41.68 | 85.47 | 45.70 | 41.81 |
| Hub-pruned union | 42.10 | 78.77 | 48.21 | 47.48 | 40.82 | 46.08 | 82.53 | 47.43 | 44.10 |
| Unanchored hooks | 18.75 | 59.10 | 27.91 | 13.98 | 27.45 | 28.52 | 76.15 | 25.16 | 13.21 |
| LanG anchored | 51.81 | 51.32 | 49.30 | 73.03 | 24.49 | 45.09 | 68.72 | 37.04 | 42.18 |
| without kill chain | 63.43 | 62.45 | 61.29 | 68.19 | 26.46 | 45.47 | 67.50 | 37.37 | 43.07 |
| without host, user | 48.15 | 46.28 | 44.99 | 73.66 | 23.66 | 55.86 | 64.50 | 40.35 | 55.89 |
of our previous graph. Without it, precision on Benchmark B stays at 18.75%, the share of one campaign among the attack events, so every group mixes all campaigns, and on GUIDE it reaches only 28.52% in one day (F1 of 13.21% over seven days). Requiring a shared entity on every edge (Eq. (5)) raises precision to 51.81% and 45.09%, F1 from 27.91% to 49.30% and from 25.16% to 37.04% (paired difference 11.88 points, Holm p = 0.005 over the GUIDE windows), and noise isolation from 13.98% to 73.03%. Second, anchoring repairs the graph but does not beat simple grouping: union by address is best on GUIDE (F1 of 60.41% in one day, 71.58% over seven days), whose truth is Defender's own grouping by shared entities, and ties the best anchored graph on Benchmark B (60.12% against 61.29% without the kill chain hook, which hurts when all campaigns share their phases). Third, an address shared by several campaigns, as behind NAT, misleads every method that links through addresses: with η = 1, union by address falls to 42.12% and the anchored graph to 24.49%, since that address counts as a shared entity. Ignoring entities that occur in too many events (hub pruning) helps: the pruned union degrades least among the unions using hosts and accounts, and inside the anchored graph, at the same threshold, pruning raises F1 to 41.18% (significant in 10 of 12 cells), or 52.08% without the kill chain hook, above union by address, at no cost otherwise. On GUIDE it adds 2.35 points (39.39%), not significantly. Host and network evidence that share nothing still need an asset inventory mapping hosts to addresses, or causal evidence such as a victim logon. The graph of 100 events takes 0.13 s to build and partition, growing quadratically (Section S5 of the supplement).
5.3 Autonomous Subsystems at Scale
On our single workstation, we launched two autonomous subsystems at once on 3.33 million records, each executing the workflow of Fig. 1. The first analyzed the complete NetFlow v3 export of UNSW-NB15, 2,365,424 flows, with a detector retrained without UNSW-NB15, so that the network was new to it, and a baseline of 5,000 of its normal flows. The second analyzed the 965,067 lines of the six log corpora. Each ran its 25 highest-ranked units (N_u = 25) on four workers (N_w = 4), with Llama 3.2 3B and the served rule generator, eight workflows at a time on one GPU. Labels were used only for scoring.
Table S1 of the supplement details the runs. The front stage processed about 46,000 flows and 53,000 log lines per second. Both subsystems finished in 382.2 s, all 50 workflows completed, and their policies answered 100 checkpoints. The 25 units of each
(a) Gradient boosted trees and site baseline: AUC on each NetFlow dataset

(b) Mean AUC
(c) Attacks detected (%)

Fig. 2. Detection on unseen networks. (a) Trees trained on other NetFlow datasets (bars: eight feature variants) are near or below chance (dashed) except on ToN-IoT, unlike trees trained on the same dataset and the label-free site baseline. (b, c) Label-free detectors at 1% false alarms, means over 40 runs with 95% intervals.
subsystem held 93.17% of the suspected attack flows, with all nine attack classes of UNSW-NB15, and 97.20% of the suspected attack lines, with both ATT&CK techniques present. The subsystems left 207 rules in six buckets, of which 201 loaded in their engines, and deployed none. One workflow per suspect means 200,114 workflows, or about two weeks at the measured rate, against 6.4 minutes. The devices used 25.99 Wh, or 0.52 Wh per workflow, while the emission records of the individual calls sum to 5.45 times more, because concurrent calls on one GPU overlap and each record counts the whole device power during its call. Under concurrency, energy must therefore be measured over a window for the whole device. The filter kept only 68.37% of the attack log lines, because many discovery and account manipulation events are logged at the INFO level without an attack keyword, so rules over log content must complement it.
5.4 Detection Across Networks
Supervised models do not transfer. We trained gradient boosted trees on three of the four NetFlow v3 datasets and tested them on the fourth, holding out each dataset in turn (Fig. 2a). With all 47 NetFlow features, the area under the ROC curve (AUC) is only 0.35 to 0.82 and the family macro F1 3.88% to 17.26%, and removing the TTL and port features, keeping only the shared fields or scaling ranks per dataset does not help. On separate time blocks of the same dataset, the same model reaches a family macro F1 of 59.29% to 95.68%. What transfers is a model of the target network's own benign traffic, with an AUC of 0.80 to 0.96 in every variant and no attack label, motivating Section 4.4.
The false alarm rate stays predictable. Table 5 treats each dataset as a new customer network. In the left half, the detector flags a flow when it lies further from the 5,000 normal flows than 99.00% of normal flows do. On every dataset, 0.66% to 1.31% of the benign flows are flagged, close to the 1.00% target, so an operator can predict the alarm volume on an unseen network. How many attacks are caught at that rate depends on how different they look from normal traffic: 87.71% and 92.48% of the attack flows on the NetFlow exports of BoT-IoT and UNSW-NB15, but only 0.27% of the cloud DDoS flows, which imitate normal requests.
TABLE 5
Detector on each dataset as an unseen network. Left: with 5,000 normal flows only, AUC, attacks detected and benign flows flagged (%) at 1.00% target false alarms. Right: family macro F1 with n analyst labels. NF, CIC, NTL: NetFlow v3, CICFlowMeter, NTLFlowLyzer.
| Dataset (export) | No labels from the network | Family macro F1 (%) | ||||
|---|---|---|---|---|---|---|
| AUC | Detected % | False al. % | n=0 | 200 | 1000 | |
| UNSW-NB15 (NF) | 0.997 | 92.48 | 0.88 | 6.94 | 51.01 | 50.89 |
| UNSW-NB15 (CIC) | 0.914 | 35.61 | 1.13 | 9.24 | 47.29 | 51.93 |
| ToN-IoT (NF) | 0.881 | 8.54 | 1.10 | 4.17 | 79.82 | 85.71 |
| ToN-IoT (CIC) | 0.896 | 5.13 | 1.22 | 3.83 | 46.29 | 53.75 |
| BoT-IoT (NF) | 0.968 | 87.71 | 1.31 | 8.51 | 88.48 | 90.09 |
| BoT-IoT (CIC) | 0.973 | 63.53 | 1.00 | 11.59 | 82.01 | 87.19 |
| CSE-CIC-IDS2018 (NF) | 0.944 | 34.87 | 0.78 | 4.47 | 62.06 | 69.17 |
| Cloud-DDoS24 (NTL) | 0.770 | 0.27 | 0.66 | 27.04 | 86.13 | 87.85 |
The baseline beats other label-free detectors. Fig. 2b and c compare the detector with seven label-free detectors fitted on the same 5,000 normal flows and thresholded at the same 1% false alarm target, each on percentile ranks and on raw values: isolation forest [33], local outlier factor (LOF), one-class SVM, an autoencoder, the KitNET ensemble of Kitsune [32] on flow features, a rank tail score in the manner of ECOD [34] and nearest neighbors on raw values. Over 40 runs (eight data sets, five baseline draws), the detector detects the most attacks, 42.66% [21.18, 66.73] at a realized false alarm rate of 0.93%, with a mean AUC of 0.926 [0.872, 0.959], and is the best in 14 of the 40 runs. Nearest neighbors on raw values reach a similar AUC (0.929) but detect fewer attacks (38.38%), and a high AUC does not ensure detection at a low alarm rate: isolation forest on ranks reaches 0.894 but detects 13.67%. The autoencoder on raw values detects 32.12% at 17 times the CPU energy. The detector scores 864,341 flows per second, for Wh of CPU energy per run. Averaging its score with isolation forest and the rank tail lowered detection on 7 of 8 data sets (24.38% against 42.66%), so the spread comes from the networks, not the scorer.
Labels from analysts name the attacks. Without labels from the network, the family classifier (right half of Table 5) reaches a macro F1 of only 3.83% to 27.04%. With 200 analyst labels, it reaches 46.29% to 88.48%, and 1,000 labels add little more. UNSW-NB15 stays near 50.00% because several of its labels describe overlapping traffic, and a model trained and tested on UNSW-NB15 alone reaches only 59.29%.
The baseline must be refreshed. A baseline taken from the first days only flags 47.70% and 83.80% of the benign flows of the two ToN-IoT exports, because their normal traffic drifts.
5.5 Detection Versus Language Models
All systems judged the same 200 flows, 25 benign and 25 attack flows from each NetFlow dataset, removed from every LanG training set. The local language models received each flow's features with units and flag definitions, the family list and a request for a JSON verdict, a long prompt that costs them only power, whereas Claude Opus 5.5 received a minimal prompt, to obtain its best answer at the lowest cost per paid request. In the unseen setting, LanG's classifier was trained only on the other networks, and the network contributed normal flows but no labels. The adapted setting adds 1,000 labeled flows, and the same-dataset setting trains on the network's own labels.
Table 6 shows that on an unseen network LanG raises no false alarm (0 of 100 benign flows, a 95% upper bound of 3.62%) and
TABLE 6
Detection and family naming on 200 flows of four networks (%) and energy per flow (LanG batched and per call, frontier published, inference only, training in Table 7). The frontier prompt differed from the local one. Section 5.7 compares naming under one protocol.
| System | P | R | F1 | FPR | Family | Wh per flow |
|---|---|---|---|---|---|---|
| LanG, unseen network | 100.00 | 58.00 | 73.42 | 0.00 | 4.50 | and |
| LanG, adapted | 91.95 | 80.00 | 85.56 | 7.00 | 62.57 | |
| LanG, same dataset | 98.84 | 85.00 | 91.40 | 1.00 | 71.32 | |
| Claude Opus 5.5 | 55.45 | 61.00 | 58.10 | 49.00 | 43.26 | 0.24 to 0.34 |
| Qwen 2.5 7B | 0.00 | 0.00 | 0.00 | 1.00 | 0.00 | 0.026 |
| Llama 3.2 3B | 0.00 | 0.00 | 0.00 | 0.00 | 2.28 | 0.015 |
finds 58.00% [48.21, 67.20] of the attacks. The frontier model finds a similar share (61.00%) but flags 49.00% [39.42, 58.65] of the benign flows, an alert volume no SOC could triage, and LanG is correct on 68 flows where it errs against 22 the other way (McNemar p < 0.001). Both local models call nearly every flow benign. The frontier model names the family better than LanG on an unseen network (43.26% against 4.50%), but in the pipeline the classification agent sees only the flows the detector flags. With the frontier model naming the families of LanG's alerts, detection stays that of LanG, family accuracy on the detected attacks rises from 17.24% to 53.45%, and the language model runs only on alerts. With 1,000 labels, LanG alone names families better (62.57%). However, adaptation raised the false positive rate on CSE-CIC-IDS2018 to 24.00%, so an adapted model must be checked on held-out normal flows before deployment.
On the CPU, the detector processes 14,179 flows per second in batches and takes 6.8 ms per flow one at a time (14.2 ms at the 99th percentile), so even at 190 W a flow costs at least 650 times less energy than a frontier request one at a time and 60,000 times less in batches (Table 7). Section S7 of the supplement reports the retrained text and DNS over HTTPS classifiers.
5.6 Rule Generation
The benchmark holds 240 test incidents, 40 per target (Snort 2.9, Snort 3, Suricata 6, Suricata 7, YARA and Sigma), whose rule templates never occur in training. Finetuned models receive their training prompt, and the others a generic prompt with the same facts. A rule is accepted when the engine of the requested version loads it without repair, and an answer with no rule counts as rejected. For functional detection, each incident's indicators are synthesized into traffic (HTTP, DNS, TLS or raw TCP and UDP) and replayed through the engine, and only the 84 incidents whose reference rule fires on this traffic are scored. YARA rules are scanned against a sample built from the indicators, and Sigma rules are evaluated on a synthetic event. Benign alerts are counted on 400 benign flows, 60 system binaries and other incidents.
Fig. 3 reports the results (full values in Table S2 of the supplement). With LanG's validator loop, 98.33% of the new generator's rules load in their engine and 82.14% detect their incident, with no benign alert, against 57.50% to 60.00% and 29.03% for the generators used in our previous work [13]. Paired on the same incidents, it is not significantly different from the frontier model on acceptance (p = 0.38, 4 incidents favoring the frontier model against 1) and detection (p = 0.36, 12 against 7), although the frontier model is ahead numerically. The paired differences are -1.25 points [-3.82, 0.92] on acceptance and -5.95 points [-16.54, 4.63] on detection, so with 84 replayable

Fig. 3. Rule generation on 240 held-out incidents: replayable incidents detected (84, or 62 without Sigma for the previous work) against energy per rule. The open circle is the loop with the YARA repair. Table S2 of the supplement gives acceptance, indicator recall and latency.
incidents a gap of up to 16 points cannot be ruled out. A single attempt is significantly worse on acceptance (p = 0.006), so the workflow always runs the loop, at 1.07 to 1.10 attempts per rule. Network rules are on par with the frontier model, and the gap lies in YARA (66.67% against 80.00% detection), where the generator adds unsupported constraints such as wide strings, PE header checks and size limits, and in Sigma (90.91% against 100.00%). A deterministic repair, now part of the validator loop, adds ascii to strings marked wide and drops PE header and file size tests that the incident does not state. Applied to the saved rules, it raises detection to 86.90% (73 of 84, 14 of 15 YARA incidents) for the loop and to 83.33% for the served generator, without benign alerts, against 88.10% for the frontier model (McNemar p = 1.00). On 360 further YARA incidents, never used to design it, it raises detection from 57.41% [47.99, 66.32] to 80.56% [72.10, 86.92] of the 108 replayable ones (McNemar p < 0.001), with the same 4 benign alerts and two fewer rules that load. The best local model not finetuned for rules accepts 54.17% and detects 41.67%.
Serving the same weights through llama.cpp at 8 bits instead of Python at 16 bits leaves quality within sampling noise, keeps the loop not significantly different from the frontier model on acceptance and detection (p = 0.13 and 0.19), and cuts the energy per attempt from 0.120 to 0.043 Wh and the median latency from 2.86 to 0.78 s. The generator then uses the least energy of all systems (Fig. 3), 2.5 to 2.8 times less than the Ollama 7B and 8B models and 5.6 to 7.9 times less than a frontier request, and 0.05 to 0.06 Wh per rule that loads and detects (Table 7), against 0.28 Wh for Qwen 2.5 Coder 7B. Training cost at most 1.1 kWh, repaid by frontier savings after 3,800 to 5,700 rules.
5.7 Finetuned Agents Versus the Frontier Model
Our goal is to measure how far small models that we train and run locally can go, with frontier models as a reference rather than competitors. Our subscription budget limits that reference to one hosted model, Claude Opus 5.5, queried once per item, since querying several frontier models is beyond our current budget and many cap query volumes, and to the open-weight gpt-oss-20b [71], run on our GPU. We registered data, items, endpoints and decision rules before any test inference. Every system receives the same instruction and item, Claude Opus 5.5 answers each item in a fresh context without tools, and untuned local models run with

Fig. 4. Macro F1 of the detection phase agents on the items the frontier model answered (397 alerts, 250 incidents, 217 flows), with 95% intervals. Classical: TF-IDF with logistic regression (alerts), LightGBM (incidents, flows). Table S3 of the supplement lists all values.
thinking off, except gpt-oss-20b, which reasons at low effort. A system outperforms another if the Holm-adjusted is below 0.05 and the 95% interval of the paired macro F1 difference excludes zero, and two systems are equivalent if that interval lies within points. Within our budget, the frontier model answered a stratified subset of each test set (397 alerts, 250 incidents, 217 flows) rather than all 18,792 items, and the untuned local models answered the same subsets, so every comparison with it is paired. The finetuned and classical systems were also scored on the whole test sets, and keyword rules exist for alert steps only (Tables S3 and S4 of the supplement give all values and the escalation ladder).
Alert classification. The 4B alert analyst (1.7B stayed below the frontier model on validation and 8B did worse) reaches 97.31% [92.81, 99.40] on the 397 alerts against 95.19% [90.73, 97.83] for the frontier model, a difference of 2.11 points within the equivalence margin, and it is right on 11 alerts where the frontier model errs, against 1 (McNemar ). On all 10,297 test alerts it labels 99.15% correctly (macro F1 90.75%, lowered by rare privilege escalation steps). TF-IDF with logistic regression is as good (98.32% and 93.10%), since an alert's rule and log line nearly determine its step, so our decision rule recommends it. Keyword matching reaches 56.00%, untuned local models of 3B to 7B parameters at most 37.98%.
Incident grading. The 1.7B incident grader beat the frontier model on validation and stays at 1.7B. On the 250 incidents it reaches 42.83% [24.65, 56.25] against 27.24% [20.26, 35.16], as the frontier model almost never grades an incident a false positive, but the difference (15.59 points ) is not significant. LightGBM is as good (43.41%, and 42.16% against 40.95% on all 3,000 incidents) and is the recommended grader, and untuned local models of 3B to 7B parameters reach at most 23.42%. GUIDE's authors report 0.87 to 0.91 [9] on a split where every test organization appears in training. Ours removes each organization's base rates, as for a new tenant, and 10 labeled incidents per organization restore 69.53% (77.09% with 25, against 28.25%) on the 17 largest test organizations.
Naming attack families. On a new network the frontier model wins. The family namer escalated to 8B (17.52% at 1.7B and 20.75% at 4B against 52.61% on development flows) and reaches 12.14% [9.00, 16.25] on the 217 flows against 26.78% [21.13,
33.14], a gap of 14.64 points [8.20, 21.59] (Holm ). On all 5,495 flows it beats LightGBM (16.27% against 12.58%), within the margin. Site labels close the gap: with 50 labels of the new network, LightGBM names its other flows at 55.07% (67.08% with 200), while frontier names make poor labels (23.33%). LanG therefore uses the frontier model on a new network until 50 alerts are labeled (Table S10 of the supplement).
Open weight reference. On our GPU, gpt-oss-20b reaches 53.64%, 30.07% and 14.78% on the three subsets. The alert analyst beats it by 43.67 points [35.84, 51.33], the grader and the namer do not differ significantly from it, and the frontier model names flow families 12.00 points [5.69, 18.80] better. It uses 0.032 to 0.054 Wh per item, two to six times our adapters.
5.8 Safeguards Under Attack
We attack the three surfaces that LanG adds to a SOC (Section 3): telemetry text the agents read, analyst labels retraining the family classifier, and the action ledger. Injections from published corpora enter through the two fields that reach the models, a user agent and a log line. Adaptive and multistep injection, tool abuse, model extraction and denial of service are future work.
Indirect prompt injection. On their own, the input filters catch little. The pattern filter flags 5.32% of the 263 deepset injections [72] and none of the 150 BIPIA text attacks [46], and adding Prompt Guard 2 raises these shares to 26.24% and 0.67% at 7 to 11 ms per field, while it flags one of 399 benign prompts (0.25%) and none of 4,000 AIT alerts and log lines (95% upper bound 0.18%, Table S6 of the supplement). BIPIA attacks ask for ordinary tasks that a classifier cannot tell apart from data, so filters cannot be the main defense. In the complete pipeline, we appended 40 BIPIA attacks to a packet user agent or a log line of 40 AIT incidents (30 attacks, 10 benign), approved the classification checkpoint as a rubber-stamp analyst would, and ran to the verdict without filters, with the pattern filter, and with Prompt Guard 2 and spotlighting (120 workflows), with benign deepset prompts as a control. Without spotlighting, the attack reached a model in 62.50% of the workflows and no filter flagged it. Yet no verdict changed, since the verdict follows a detector that reads no text, no attack incident was graded benign (0 of 90, 95% upper bound 4.09%), and every workflow reached the analyst. Severities and log risk levels changed as often as when benign text replaced the attacks or the clean incidents simply ran again (Table S7 of the supplement), a run-to-run variability of the 3B classification model that came from sampling. With greedy decoding and a fixed seed for every decision-bearing call, a clean rerun changes no severity (0 of 40, against 17 before), and the attacks change severities exactly as often as benign text (10.00%) and log risk levels no more often than a clean rerun (22.50% against 25.00%). An attacker adapting to LanG remains a risk.
Poisoned feedback. We adapted the family classifier with 300 labels (200 attack, 100 benign flows) of each NetFlow data set as a new site, over three baseline draws (12 runs), scored as deployed: the baseline raises an alert and the classifier names it. Clean labels raise detection from 59.48% to 89.24% and the family macro F1 from 0.86% to 61.01%, at a false alarm rate of 2.57% instead of 1.08%. An adversary controlling a fraction of the labels who relabels the site's most frequent attack family as benign lowers the share of that family named correctly from 80.97% to 55.95% at and 10.97% at , but 64.12% of its flows still raise an alert, as many as without labels (63.54%), because the
TABLE 7
Energy per unit of work (Wh). GPU: (Eq. (7)), with idle draw. CPU: utilization model [bound at 190 W]. Frontier: published, inference only. Item: one alert, incident or flow answered in one request.
| Operation | Unit | LanG | Frontier |
|---|---|---|---|
| Inference | |||
| Flow detector, batches (CPU) | flow | 0.24 to 0.34 | |
| Flow detector, one call (CPU) | flow | 0.24 to 0.34 | |
| Classical agents (CPU) | alert, flow | [about ] | 0.24 to 0.34 |
| Alert analyst, 4B | alert | 0.0137 | 0.24 to 0.34 |
| Incident grader, 1.7B | incident | 0.0058 | 0.24 to 0.34 |
| Family namer, 8B | flow | 0.0199 | 0.24 to 0.34 |
| Untuned local models, 3B to 7B | item | 0.007 to 0.016 | 0.24 to 0.34 |
| gpt-oss-20b | item | 0.032 to 0.054 | 0.24 to 0.34 |
| Rule generator, 8 bits | attempt | 0.043 | 0.24 to 0.34 |
| rule that loads and detects | rule | 0.05 to 0.06 | 0.27 to 0.39 |
| Autonomous workflow (Section 5.3) | workflow | 0.52 | – |
| Analysis run (Fig. S3) | run | 22.37 | – |
| Training, once per model | |||
| Family classifier (CPU) | model | 2.0 [6.0] | not published |
| Site baseline fit (CPU) | tenant | – | |
| Site adaptation, 200 labels (CPU) | tenant | 0.12 [0.39] | – |
| Alert analyst, 4B (all 3 steps) | adapter | 272 (837) | not published |
| Incident grader, 1.7B | adapter | 141 | not published |
| Family namer, 8B (all steps) | network | 360 to 490 (1,714) | not published |
| Rule generator, 1.7B (power limits) | model | at most 1,100 | not published |
baseline decides what is abnormal. Relabeling benign flows as attacks raises the false alarm rate to at most 2.91% up to and 7.79% at . The holdout gate rejected half of these adaptations at but no targeted one, whose hold-out labels are poisoned too. The label audit sent 63.89% to 70.83% of the targeted poisoned labels to a second analyst while flagging 1.17 of 300 clean labels on average. Labels approved by an autonomous policy repeat the current model's errors (macro F1 0.59%) and are excluded by the principal filter (Table S8 of the supplement).
Ledger tampering. On copies of the ledger of the 50 workflows of Section 5.3 (3,052 actions), without and with a key, an adversary with database write access edited, deleted, swapped or forged records, truncated the last 1, 10 or 100, rebuilt the chain after an edit, or restored a backup taken 50 actions earlier, at random positions in 200 trials each. Without a key, verification detects every edit, deletion and swap (200 of 200, at least 98.17% at 95% confidence), detects truncation, a rebuilt chain and a rollback only against an anchor, and never detects a record forged after the last anchor (Table S9 of the supplement). With a key, it also detects every forged record and rebuilt chain, while truncation and rollback still require an anchor. As in secure audit logs [73], [74], a chain proves the order of what it holds but not its length, so the workflow manager exports an anchor at every checkpoint and workflow end. An append takes 0.06 ms (0.29 ms at the 95th percentile) on a ledger of one million records, so the 61 records of an average workflow add about 4 ms, and a record takes about 2 kB. Eight concurrent writers sustain 3,632 appends per second, and full verification takes 24.36 s per million records (88.92 s with a key).
5.9 Energy Cost, Budgets and Review Effort
Energy at every level. Table 7 gathers the energy of every LanG operation and the one time cost of training each model, each costed per unit of work (a flow, an alert, an incident, a rule or a workflow), the unit a SOC processes and one frontier request would replace. Per item, the alert analyst and the incident grader use 17 to 59 times less energy than a frontier request and the family namer 12 to 17 times less, so the finetuned models that statistically match the frontier model in alert classification and rule writing use 5.6 to 59 times less energy, while untuned 3B to 7B models spend about as much for a far lower F1 (Fig. 4) and the classical agents need no GPU. The frontier column cannot be measured from outside, and Anthropic publishes no figure for Claude Opus 5.5, so it uses published medians for one text request to comparable hosted models: 0.24 Wh for Gemini apps, measured by Google with idle machines and data center overhead [66], 0.34 Wh stated by OpenAI's CEO for ChatGPT [67], and about 0.3 Wh estimated by Epoch AI for GPT-4o [68]. These cover inference only and exclude the unpublished training of the frontier model, embodied emissions and the extra energy of our long prompts [68], so they more likely understate the frontier cost. Per rule, the range is divided by the 88.10% of its rules that load and detect.
Training is measured, except for the rule generator, whose 8,907 s run on the GPU was not metered and is bounded by the board's 320 W limit plus 125 W for the CPU. The adapters used 2.69 kWh for every step of the ladder, including the steps the escalation rule discarded, or 1.28 kg CO e at the world average intensity. Against the lower frontier estimate, the alert analyst repays the training of all its steps after 3,699 alerts and the incident grader after 603 incidents, about an hour of alerts for a SOC that receives 115.6 million in four years [2]. On the CPU, the family classifier trains in 114 s for 2.0 Wh (6.0 Wh at 190 W), as much as scoring 4.1 million flows in batches, a site baseline is fitted in 28 ms, and an adaptation to 200 labels takes 7.4 s (medians of three runs), so the detector's training is negligible.
Applied to an analysis run of 22.37 Wh, the region table gives 0.03 g in Quebec, 1.25 g in France and 15.9 g in South Africa (Fig. S3 of the supplement), a ratio above 450. A SOC running 1,000 such analyses a month on the world average grid emits about 10.6 kg CO e, which a budget alert at 80% reveals early.
Section S12 of the supplement bounds the review effort saved analytically, which only a timed study with analysts can confirm.
6 DISCUSSION AND LIMITATIONS
Our evaluation shows that LanG's methods work under controlled conditions, not yet that they improve security operations in production. The log corpora and campaign benchmark are generated, the flows are public and the rules are replayed on traffic synthesized from each incident, which gives exact ground truth but not the noise and drift of enterprise telemetry. GUIDE and the AIT alerts are real, but GUIDE's truth is Defender's own grouping and the AIT attacks ran in simulated organizations. The frontier comparisons rest on one hosted model queried once per item, as budget and query limits allow, with unverifiable published energy estimates, samples of a few hundred items cannot resolve differences of a few points, and the carbon figures exclude embodied emissions.
The methods have limits too. Anchoring prevents false merges but cannot create missing links, and does not beat union by address on real alerts, although hub pruning keeps it accurate behind a shared egress address. On new networks, the detector holds its false alarm rate but detects 0.27% to 92.48% of the attacks, and only the frontier model names their families well. The rule generator still errs on YARA constraints and unfamiliar Snort and Suricata options, which the deployment checkpoint catches. Filters catch few indirect injections, so protection rests on the structural safeguards, which an adaptive attacker may probe to bias severities or summaries. The holdout gate misses poisoning that also reaches held-out labels, and the ledger needs external anchors.
Next, beachhead SOC teams will test our results on their own telemetry and time the same incidents with and without LanG, complemented by OTRF/Mordor and DARPA OpTC. The agenda follows from these limits: entity bridging from asset data, adaptive injection tests, preference training [75] of the rule generator, and explanation faithfulness, while stakeholder feedback raises LanG's technology and integration readiness levels [76], [77].
7 CONCLUSION
We presented LanG 2.0, an agentic AI system for semi-automated security operations whose structural safeguards (entities shared on every correlation link, analyst approval of every change, a single deploying agent and a tamper-evident ledger) keep model suggestions from becoming unaudited changes. On eight flow datasets from five networks and three exporters, real Microsoft Defender XDR alerts and multistage attack campaigns, it improves on the previous LanG: requiring a shared entity prevents phase collapse and raises correlation precision from 18.75% to 51.81%, although grouping by address remains a strong baseline, and the 1.7B rule generator raises engine acceptance from at most 60.00% to 98.33%. Against Claude Opus 5.5, scoring flows against each network's normal traffic reaches 73.42% F1 on unseen networks with no false alarm on 100 benign flows, against 58.10% with 49.00% false positives at no less than 650 times the energy per flow, and small finetuned models statistically match it on alert classification, incident grading and rule writing for 5.6 to 59 times less energy, while classical models match them on two of three tasks. The frontier model stays ahead only in naming attack families on a new network, until about 50 analyst labels exist. The safeguards held under prompt injection, label poisoning and ledger tampering where text filters failed, and one workstation analyzed 3.33 million records in 6.4 minutes, over 30 million an hour, without deploying a rule. Within these limits, small local models carry most SOC detection, a frontier model and a few analyst labels help on new networks, and the guarantees come from structural safeguards. With small samples and one workstation, real deployments with beachhead users come next.
REFERENCES
[1] IBM Security and Ponemon Institute, “Cost of a data breach report 2024,” IBM Corporation, Tech. Rep., 2024.
[2] L. Yang, Z. Chen, C. Wang, Z. Zhang, S. Booma, P. Cao, C. Adam, A. Withers, Z. Kalbarczyk, R. K. Iyer et al., “True attacks, attack attempts, or benign triggers? An empirical measurement of network alerts in a security operations center,” in Proc. 33rd USENIX Secur. Symp., 2024, pp. 1525–1542.
[3] S. Wu, X. Sun, E. Dong, Z. Wang, C. Zhao, and J. Yang, “Alert2Vec: Eliminating alert fatigue by embedding security alerts through subgraph learning,” IEEE Trans. Dependable Secure Comput., vol. 23, no. 1, pp. 655–669, 2026.
[4] S. Freitas and A. Gharib, “GraphWeaver: Billion-scale cybersecurity incident correlation,” in Proc. 33rd ACM Int. Conf. Inf. Knowl. Manage. (CIKM), 2024, pp. 4479–4486.
[5] Y. Liu, Z. Xu, Z. Luo, J. Shang, S. Zhang, H. Zhang, and T. Liu, “MuSAR: Multi-step attack reconstruction from lightweight security logs via event-level semantic association in multi-host environments,” in Proc. 28th Int. Symp. Res. Attacks Intrusions Defenses (RAID), 2025, pp. 329–348.
[6] Z. Cheng, Q. Lv, J. Liang, Y. Wang, D. Sun, T. Pasquier, and X. Han, “KAIROS: Practical intrusion detection and investigation using whole-system provenance,” in Proc. IEEE Symp. Secur. Privacy (S&P), 2024, pp. 3533–3551.
[7] B. Jiang, T. Bilot, N. El Madhoun, K. Al Agha, A. Zouaoui, S. Iqbal, X. Han, and T. Pasquier, “ORTHRUS: Achieving high quality of attribution in provenance-based intrusion detection systems,” in Proc. 34th USENIX Secur. Symp., 2025, pp. 7173–7192.
[8] A. Aly, E. Mansour, and A. Youssef, “OCR-APT: Reconstructing APT stories from audit logs using subgraph anomaly detection and LLMs,” in Proc. ACM SIGSAC Conf. Comput. Commun. Secur. (CCS), 2025, pp. 261–275.
[9] S. Freitas, J. Kalajdijeski, A. Gharib, and R. McCann, “AI-driven guided response for security operation centers with Microsoft Copilot for security,” in Companion Proc. ACM Web Conf. (WWW), 2025, pp. 191–200.
[10] H. Xu, S. Wang, N. Li, K. Wang, Y. Zhao, K. Chen, T. Yu, Y. Liu, and H. Wang, “Large language models for cyber security: A systematic literature review,” ACM Trans. Softw. Eng. Methodol., 2025, early access, doi: 10.1145/3769676.
[11] A. A. Chien, L. Lin, H. Nguyen, V. Rao, T. Sharma, and R. Wijayawardana, “Reducing the carbon impact of generative AI inference (today and in 2035),” in Proc. 2nd Workshop Sustain. Comput. Syst. (HotCarbon), 2023, pp. 1–7.
[12] S. Luccioni, Y. Jernite, and E. Strubell, “Power hungry processing: Watts driving the cost of AI deployment?” in Proc. ACM Conf. Fairness, Accountability, Transparency (FAcCT), 2024, pp. 85–99.
[13] A. Abdenebi, N. Kara, L. Lahlou, and H. Ould-Slimane, “LanG – a governance-aware agentic AI platform for unified security operations,” arXiv preprint arXiv:2604.05440, 2026. [Online]. Available: https://arxiv.org/abs/2604.05440
[14] M. Landauer, F. Skopik, and M. Wurzenberger, “Introducing a new alert data set for multi-step attack analysis,” in Proc. 17th Cyber Secur. Exp. Test Workshop (CSET), 2024, pp. 41–53.
[15] S. Li, F. Dong, X. Xiao, H. Wang, F. Shao, J. Chen, Y. Guo, X. Chen, and D. Li, “NODLINK: An online system for fine-grained APT attack detection and investigation,” in Proc. Netw. Distrib. Syst. Secur. Symp. (NDSS), 2024.
[16] M. U. Rehman, H. Ahmadi, and W. U. Hassan, “FLASH: A comprehensive approach to intrusion detection via provenance graph representation learning,” in Proc. IEEE Symp. Secur. Privacy (S&P), 2024, pp. 3552–3570.
[17] Z. Jia, Y. Xiong, Y. Nan, Y. Zhang, J. Zhao, and M. Wen, “MAGIC: Detecting advanced persistent threats via masked graph representation learning,” in Proc. 33rd USENIX Secur. Symp., 2024, pp. 5197–5214.
[18] H. Ding, J. Zhai, Y. Nan, and S. Ma, “AirTag: Towards automated attack investigation by unsupervised learning with log texts,” in Proc. 32nd USENIX Secur. Symp., 2023, pp. 373–390.
[19] A. Goyal, G. Wang, and A. Bates, “R-CAID: Embedding root cause analysis within provenance-based intrusion detection,” in Proc. IEEE Symp. Secur. Privacy (S&P), 2024, pp. 3515–3532.
[20] A. Goyal, X. Han, G. Wang, and A. Bates, “Sometimes, you aren’t what you do: Mimicry attacks against provenance graph host intrusion detection systems,” in Proc. Netw. Distrib. Syst. Secur. Symp. (NDSS), 2023.
[21] W. Guan, J. Cao, S. Qian, J. Gao, and C. Ouyang, “LogLLM: Log-based anomaly detection using large language models,” IEEE Trans. Softw. Eng., 2026, early access.
[22] Y. Liu, S. Tao, W. Meng, J. Wang, W. Ma, Y. Chen, Y. Zhao, H. Yang, and Y. Jiang, “Interpretable online log analysis using large language models with prompt strategies,” in Proc. 32nd IEEE/ACM Int. Conf. Program Compension (ICPC), 2024, pp. 35–46.
[23] M. Landauer, F. Skopik, M. Frank, W. Hotwagner, M. Wurzenberger, and A. Rauber, “Maintainable log datasets for evaluation of intrusion detection systems,” IEEE Trans. Dependable Secure Comput., vol. 20, no. 4, pp. 3466–3482, 2023.
[24] M. A. Inam, J. Oliver, R. Batta, and A. Bates, “Carbon filter: Scalable, efficient, and secure alert triage for endpoint detection & response,” in Proc. 28th Int. Symp. Res. Attacks Intrusions Defenses (RAID), 2025, pp. 174–189.
[25] N. Moustafa and J. Slay, “UNSW-NB15: A comprehensive data set for network intrusion detection systems (UNSW-NB15 network data set),” in Proc. Mil. Commun. Inf. Syst. Conf. (MilCIS), 2015, pp. 1–6.
[26] N. Moustafa, “A new distributed architecture for evaluating AI-based security systems at the edge: Network TON_IoT datasets,” Sustain. Cities Soc., vol. 72, p. 102994, 2021.
[27] N. Koroniotis, N. Moustafa, E. Sitnikova, and B. Turnbull, “Towards the development of realistic botnet dataset in the Internet of Things for network forensic analytics: Bot-IoT dataset,” Future Gener. Comput. Syst., vol. 100, pp. 779–796, 2019.
[28] I. Sharafaldin, A. H. Lashkari, and A. A. Ghorbani, “Toward generating a new intrusion detection dataset and intrusion traffic characterization,” in Proc. Int. Conf. Inf. Syst. Secur. Privacy (ICISSP), 2018, pp. 108–116.
[29] S. Layeghy and M. Portmann, “Explainable cross-domain evaluation of ML-based network intrusion detection systems,” Comput. Elect. Eng., vol. 108, p. 108692, 2023.
[30] G. Apruzzese, P. Laskov, and J. Schneider, “SoK: Pragmatic assessment of machine learning for network intrusion detection,” in Proc. IEEE Eur. Symp. Secur. Privacy (EuroS&P), 2023, pp. 592–614.
[31] P. Goldschmidt and D. Chudá, “Network intrusion datasets: A survey, limitations, and recommendations,” Comput. Secur., vol. 156, p. 104510, 2025.
[32] Y. Mirsky, T. Doitshman, Y. Elovici, and A. Shabtai, “Kitsun: An ensemble of autoencoders for online network intrusion detection,” in Proc. Netw. Distrib. Syst. Secur. Symp. (NDSS), 2018.
[33] F. T. Liu, K. M. Ting, and Z.-H. Zhou, “Isolation forest,” in Proc. 8th IEEE Int. Conf. Data Mining (ICDM), 2008, pp. 413–422.
[34] Z. Li, Y. Zhao, X. Hu, N. Botta, C. Ionescu, and G. H. Chen, “ECOD: Unsupervised outlier detection using empirical cumulative distribution functions,” IEEE Trans. Knowl. Data Eng., vol. 35, no. 12, pp. 12181–12193, 2023.
[35] D. Han, Z. Wang, W. Chen, K. Wang, R. Yu, S. Wang, H. Zhang, Z. Wang, M. Jin, J. Yang et al., “Anomaly detection in the open world: Normality shift detection, explanation, and adaptation,” in Proc. Netw. Distrib. Syst. Secur. Symp. (NDSS), 2023.
[36] P. R. B. Houssel, P. Singh, S. Layeghy, and M. Portmann, “Towards explainable network intrusion detection using large language models,” in Proc. IEEE/ACM Int. Conf. Big Data Comput., Appl. Technol. (BDCAT), 2024, pp. 67–72.
[37] G. Severi, S. Boboila, A. Oprea, J. Holodnak, K. Kratkiewicz, and J. Matterer, “Poisoning network flow classifiers,” in Proc. 39th Annu. Comput. Secur. Appl. Conf. (ACSAC), 2023, pp. 337–351.
[38] Z. Jiang, J. Liu, Z. Chen, Y. Li, J. Huang, Y. Huo, P. He, J. Gu, and M. R. Lyu, “LILAC: Log parsing using LLMs with adaptive parsing cache,” Proc. ACM Softw. Eng., vol. 1, no. FSE, pp. 137–160, 2024.
[39] Y. Wu, M. Velazco, A. Zhao, M. R. Meléndez Luján, S. Movva, Y. K. Roy, Q. Nguyen, R. Rodriguez, Q. Wu, M. Albada et al., “ExCyTn-Bench: Evaluating LLM agents on cyber threat investigation,” in Proc. 43rd Int. Conf. Mach. Learn. (ICML), 2026.
[40] D. Kramer, L. Rosique, A. Narotam, E. Bursztein, P. G. Kelley, K. Thomas, and A. Woodruff, “Integrating large language models into security incident response,” in Proc. 21st Symp. Usable Privacy Secur. (SOUPS), 2025, pp. 133–148.
[41] K. Hammar, T. Alpcan, and E. C. Lupu, “Incident response planning using a lightweight large language model with reduced hallucination,” in Proc. Netw. Distrib. Syst. Secur. Symp. (NDSS), 2026.
[42] Y. Cai, J. Qiu, Q. Li, D. Cheng, and L. Chen, “From texts to rules: Generating Sigma rules with large language models from cyber threat reports,” in Proc. 35th USENIX Secur. Symp., 2026, pp. 2365–2384.
[43] Z. Mansour, W. Ou, S. H. H. Ding, M. Zulkernine, and P. Charland, “NeuroYara: Learning to rank for Yara rules generation through deep language modeling and discriminative N-gram encoding,” IEEE Trans. Dependable Secure Comput., vol. 22, no. 2, pp. 1747–1762, 2025.
[44] K. Greshake, S. Abdelnabi, S. Mishra, C. Endres, T. Holz, and M. Fritz, “Not what you’ve signed up for: Compromising real-world LLM-integrated applications with indirect prompt injection,” in Proc. 16th ACM Workshop Artif. Intell. Secur. (AISec), 2023, pp. 79–90.
[45] Y. Liu, Y. Jia, R. Geng, J. Jia, and N. Z. Gong, “Formalizing and benchmarking prompt injection attacks and defenses,” in Proc. 33rd USENIX Secur. Symp., 2024, pp. 1831–1847.
[46] J. Yi, Y. Xie, B. Zhu, E. Kiciman, G. Sun, X. Xie, and F. Wu, “Benchmarking and defending against indirect prompt injection attacks on large language models,” in Proc. 31st ACM SIGKDD Conf. Knowl. Discov. Data Mining (KDD), 2025.
[47] K. Hines, G. Lopez, M. Hall, F. Zarfati, Y. Zunger, and E. Kiciman, “Defending against indirect prompt injection attacks with spotlighting,” arXiv:2403.14720, 2024.
[48] S. Chennabasappa, C. Nikolaidis, D. Song, D. Molnar, S. Ding, S. Wan, S. Whitman, L. Deason, N. Doucette, A. Montilla et al., “LlamaFirewall: An open source guardrail system for building secure AI agents,” arXiv:2505.03574, 2025.
[49] J.-W. Chung, J. J. Ma, R. Wu, J. Liu, O. J. Kweon, Y. Xia, Z. Wu, and M. Chowdhury, “The MLENERGY benchmark: Toward automated inference energy measurement and optimization,” in Proc. Adv. Neural Inf. Process. Syst. (NeurIPS), Datasets Benchmarks Track, vol. 38, 2025, pp. 121 191–121 219.
[50] L. Bouza, A. Bugeau, and L. Lannelongue, “How to estimate carbon footprint when training deep learning models? A guide and review,” Environ. Res. Commun., vol. 5, no. 11, p. 115014, 2023.
[51] B. Courty, V. Schmidt et al., “CodeCarbon: Track and reduce emissions from your computing,” Zenodo, v2.4.1, doi: 10.5281/zenodo.11171501, 2024.
[52] J. Fernandez, C. Na, V. Tiwari, Y. Bisk, S. Luccioni, and E. Strubell, “Energy considerations of large language model inference and efficiency optimizations,” in Proc. 63rd Annu. Meeting Assoc. Comput. Linguistics (ACL), 2025, pp. 32 556–32 569.
[53] Z. Yang, K. Adamek, and W. Armour, “Accurate and convenient energy measurements for GPUs: A detailed study of NVIDIA GPU’s built-in power sensor,” in Proc. Int. Conf. High Perform. Comput., Netw., Storage Anal. (SC), 2024, pp. 1–17.
[54] B. E. Strom, A. Applebaum, D. P. Miller, K. C. Nickels, A. G. Pennington, and C. B. Thomas, “MITRE ATT&CK: Design and philosophy,” The MITRE Corporation, Tech. Rep. MP180360, 2018.
[55] E. M. Hutchins, M. J. Cloppert, and R. M. Amin, “Intelligence-driven computer network defense informed by analysis of adversary campaigns and intrusion kill chains,” in Proc. 6th Int. Conf. Inf. Warfare Secur. (ICIW), 2011, pp. 113–125.
[56] V. D. Blondel, J.-L. Guillaume, R. Lambiotte, and E. Lefebvre, “Fast unfolding of communities in large networks,” J. Stat. Mech.: Theory Exp., vol. 2008, no. 10, p. P10008, 2008.
[57] G. Ke, Q. Meng, T. Finley, T. Wang, W. Chen, W. Ma, Q. Ye, and T.-Y. Liu, “LightGBM: A highly efficient gradient boosting decision tree,” in Proc. Adv. Neural Inf. Process. Syst. (NeurIPS), 2017, pp. 3146–3154.
[58] Qwen Team, “Qwen3 technical report,” arXiv preprint arXiv:2505.09388, 2025.
[59] E. J. Hu, Y. Shen, P. Wallis, Z. Allen-Zhu, Y. Li, S. Wang, L. Wang, and W. Chen, “LoRA: Low-rank adaptation of large language models,” in Proc. Int. Conf. Learn. Represent. (ICLR), 2022.
[60] G. Gerganov et al., “llama.cpp: LLM inference in C/C++,” https://github.com/ggml-org/llama.cpp, 2025.
[61] T. Dettmers, A. Pagnoni, A. Holtzman, and L. Zettlemoyer, “QLoRA: Efficient finetuning of quantized LLMs,” in Proc. Adv. Neural Inf. Process. Syst. (NeurIPS), 2023.
[62] J. Kaplan, S. McCandlish, T. Henigan, T. B. Brown, B. Chess, R. Child, S. Gray, A. Radford, J. Wu, and D. Amodei, “Scaling laws for neural language models,” arXiv:2001.08361, 2020.
[63] Ember, “Global electricity review 2024,” Ember, Tech. Rep., 2024.
[64] Q. McNemar, “Note on the sampling error of the difference between correlated proportions or percentages,” Psychometrika, vol. 12, no. 2, pp. 153–157, 1947.
[65] M. Luay, S. Layeghy, N. Noorbin, M. Sarhan, G. Kulatilleke, N. Moustafa, and M. Portmann, “Time matters: Temporal NetFlow features for ML-based network intrusion detection,” IEEE Access, vol. 14, pp. 66899–66913, 2026.
[66] C. Elsworth et al., “Measuring the environmental impact of delivering AI at Google scale,” arXiv preprint arXiv:2508.15734, 2025.
[67] S. Altman, “The gentle singularity,” https://blog.samaltman.com/the-gentle-singularity, 2025, accessed Oct. 2026.
[68] J. You, “How much energy does ChatGPT use?” Epoch AI, https://epoch.ai/gradient-updates/how-much-energy-does-chatgpt-use, 2025, accessed Oct. 2026.
[69] A. Bagga and B. Baldwin, “Entity-based cross-document coreferencing using the vector space model,” in Proc. 36th ACL and 17th COLING, 1998, pp. 79–85.
[70] E. Amigó, J. Gonzalo, J. Artiles, and F. Verdejo, “A comparison of extrinsic clustering evaluation metrics based on formal constraints,” Inf. Retrieval, vol. 12, no. 4, pp. 461–486, 2009.
[71] OpenAI, “gpt-oss-120b & gpt-oss-20b model card,” arXiv:2508.10925, 2025.
[72] deepset, “prompt-injections,” Hugging Face, https://huggingface.co/datasets/deepest/prompt-injections, 2023.
[73] B. Schneier and J. Kelsey, “Secure audit logs to support computer forensics,” ACM Trans. Inf. Syst. Secur., vol. 2, no. 2, pp. 159–176, 1999.
[74] S. A. Crosby and D. S. Wallach, “Efficient data structures for tamper evident logging,” in Proc. 18th USENIX Secur. Symp., 2009, pp. 317–334.
[75] R. Rafailov, A. Sharma, E. Mitchell, C. D. Manning, S. Ermon, and C. Finn, “Direct preference optimization: Your language model is secretly a reward model,” in Proc. Adv. Neural Inf. Process. Syst. (NeurIPS), vol. 36, 2023, pp. 53 728–53 741.
[76] J. C. Mankins, “Technology readiness levels: A white paper,” NASA Advanced Concepts Office, Tech. Rep., 1995.
[77] B. Sauser, D. Verma, J. Ramirez-Marquez, and R. Gove, “From TRL to SRL: The concept of systems readiness levels,” in Proc. Conf. Syst. Eng. Res. (CSER), 2006.
Supplementary Material for “LanG 2.0: Energy-Efficient Agentic AI for Semi-Automated Security Operations at Scale”
Anes Abdennebi, Nadjia Kara, Laaziz Lahlou and Hakima Ould-Slimane
This supplement follows the order of the paper. Sections S1 to S5 detail the method (architecture, incident records, algorithms, carbon measurement and scalability), and Sections S6 to S12 the evaluation (autonomous subsystems, other detectors, rule generation, finetuned agents, security, targeted improvements and review effort), and Section S13 lists the artifacts we release. References without the prefix S point to the paper.
S1 ARCHITECTURE
Fig. S1 shows the data and evidence plane of LanG, from connectors to the evidence the agents receive.
S2 UNIFIED INCIDENT CONTEXT RECORDS
Each tool reports its own fragment of an intrusion, such as an authentication burst in the SIEM, a process tree in the EDR or a flow at a network sensor. The first stage joins these fragments into incidents with exact merge rules, so that later stages reason over incidents rather than over isolated alerts.
S2.1 The Unified Incident Context Record
Each connector emits partial UICRs. A UICR contains an identifier, a set of correlation keys such as five tuples or alert identifiers, indicators of compromise with type, value, source, first and last sighting and confidence, indicators of attack with technique, tactic and evidence, flow metadata, parsed log entries, correlated alerts, and threat features produced by local detection models. Indicators carry a fingerprint truncated to 64 bits, which makes deduplication independent of the source that reported the indicator. The record also stores analyst metadata, namely triage score, severity, status and kill chain phase.
S2.2 Merge Rules
Two UICRs and are merged when one of three predicates holds:
where collects addresses from indicators and flows, collects log and alert timestamps and is the incident window. Algorithm S1 applies these rules incrementally, so a new batch never reprocesses earlier incidents unless it matches them.
S2.3 Triage Score
After each merge, LanG recomputes a bounded triage score (TS) in [0,100]:
where is a count capped at , and are mean confidences, is the alert set, is the weight of the most severe alert, is the rank of the furthest kill chain phase and is the highest confidence of a local model that returned a non benign label. ATT&CK tactics [1] are mapped to the seven Lockheed Martin phases [2]. Severity follows fixed bands at 20, 40, 60 and 80. The score orders the analyst queue and feeds the relevance ranking of the next stage.
S3 ALGORITHMS
Algorithm S1 Incremental UICR incident correlation
Input: batch B of partial UICRs, incident store , window
Output: updated incident store
1: for each do
2: merged ← false
3: for each do
4: if then
5: union of IoCs by fp, IoAs by (technique, tactic)
6: RECOMPUTE(x), merged ← true, break
7: end if
8: end for
9: if not merged then
10: RECOMPUTE(r),
11: end if
12: end for
13: return
14: function RECOMPUTE(x)
15:
16: , severity band of
17: end function
Algorithm S2 Anchored multihook graph correlation
Input: primary events , hooks , threshold , damping
Output: communities
1:
2: for to do
3: for to do
4:
5: if has no entry with then continue
6: end if
7: of the paper over
8: if then add edge with weight and evidence
9: end if
10: end for
11: end for
12: , or connected components on failure
13: remove communities with
14: for each with do fold per phase into super nodes
15: end for
16: return sorted by size
S4 CARBON MEASUREMENT AND EMISSIONS BY REGION
When no hardware counter can be read, the tracker estimates compute energy from two floating point operations per parameter per token [3]:

Fig. S1. Architecture of LanG. Orange blocks invoke a language model, metered by the carbon plane (green), and blue blocks are deterministic.
Algorithm S3 Autonomous subsystem over a large input
Input: sources S, detector D with the tenant baseline, window , budget , workers , analyst a
Output: rule buckets , deployed only after analyst approval
1:
2: for each chunk X streamed from S do
3:
4: end for
5: join U into incidents with a disjoint set structure over the keys of and and over each address in buckets and
6: group U into work units by signature, score each unit by Eq. (S4) and rank the units
7: policy principal naming this subsystem and a
8: for each of the highest ranked units w, on parallel workers do
9: run the agent graph on the evidence of w, answering each checkpoint as
10: the deployment agent adds the rules of w and their engine verdicts to
11: end for
12: return
Algorithm S4 Metered model call with budget control
Input: prompt , model , operation , tenant , region , PUE, budget
Output: response y and emission record z
1: start stopwatch, sample , start probe (best available method)
2: , collect from backend metadata, else heuristic
3: stop probe, elapsed
4: if returned hardware energy then
5: , record ratio for calibration
6: else
7:
8: end if
9:
10: enqueue z for the background writer
11: if then raise budget alert for
12: end if
13: return y
where is the parameter count inferred from the model name, and are prompt and completion tokens, discounts batched prefill, is the achieved FLOPs per watt of the device class, is utilization and is duration. Where hardware readings exist, the median of at least 20 reading to estimate ratios, clipped to [0.1, 10], calibrates estimates for that host class. Without RAPL, the CPU utilization model applies an idle floor at 30% of the nominal package power.
The region table covers all Canadian provinces, several US states and grid operators, most EU members, major grids of other continents, three public cloud regions, a world average of 475 and a renewable contract entry at zero, from 1.2 gCOe/kWh in Manitoba to 720 in West Virginia. A live provider can replace it. The dashboard aggregates records by operation, model, backend and measurement method, and every agent has its own operation label, which makes the most expensive step visible at a glance. The platform warns once the month to date total passes the alert level of the tenant budget, and writes happen on a background thread.

Fig. S2. Measurement hierarchy of the carbon plane and derivation of an emission record.

Fig. S3. Emissions of the same analysis run (22.37 Wh total) under the grid factors of ten regions from the LanG table.
S5 SCALABILITY OF THE HOOK GRAPH
Fig. S4 shows the time to evaluate all hooks, build the graph and detect communities as the primary set grows from 100 to 1,200 events drawn from all six corpora, without model calls. Anchoring filters edges after the hooks are computed, so it does not change this cost. The curve follows the expected quadratic trend: 0.13 s at 100 events, 2.1 s at 400 and 20.2 s at 1,200, where the unanchored graph holds 334,389 edges. With the default , this stage costs a fraction of a second whatever the raw volume.

Fig. S4. Graph construction and community detection time versus the size of the primary set (six corpora, no model calls).
S6 AUTONOMOUS SUBSYSTEMS

Fig. S5. Autonomous subsystems. A front stage turns millions of records into ranked work units, each subsystem runs the agent graph (Fig. 1 of the paper) on its top units with a policy at the checkpoints, and rules wait in buckets for an analyst. Counts from Section 5.3 of the paper.
The flows formed only six incidents, because a few addresses of UNSW-NB15 chain most suspects through the address rule, whereas the generated logs give each attack event its own address, so no two log suspects merged, and the work units carried the reduction. One workflow per suspect would take 337.5 hours at the measured mean workflow times and eight workflows at a time. The emission records of the individual calls sum to 141.6 Wh
TABLE S1
Two autonomous subsystems on 3.33 million records. Attack shares use labels the subsystems never read.
| Flows | Logs | |
|---|---|---|
| Records | 2,365,424 | 965,067 |
| Suspects after the filter | 143,073 | 57,041 |
| Attack records kept by the filter | 92.69% | 68.37% |
| Incidents, work units | 6,238 | 57,041,577 |
| Front stage time, throughput | 51.5 s, 45,957/s | 18.2 s, 52,822/s |
| Workflows run (failed), policy decisions | 25 (0), 50 | 25 (0), 50 |
| Workflow time, median and 95th percentile | 48.1 s, 74.1 s | 48.4 s, 67.6 s |
| Total time | 382.2 s | 322.7 s |
| Attack suspects in the units analyzed | 93.17% | 97.20% |
| Attack classes or techniques covered | 9 of 9 | 2 of 2 |
| Rules in buckets, accepted by engines | 100,98 | 107,103 |
| Rules deployed without approval | 0 | 0 |
against 25.99 Wh measured for the devices, of which 23.09 Wh on the GPU. Our first ranking, by severity band and then by size, analyzed units that held only 0.52% of the attack log lines and 63.95% of the attack flows, as error lines of benign timeouts outranked warning lines of brute force. Weighting the triage score by the logarithm of size corrected this without labels.
S7 OTHER DETECTION MODELS
We also retrained the text classifier used in our previous work [4], Prompt Guard 2 (86M parameters) [5], with LoRA on the same eight datasets. On identical held out time blocks, boosted trees reach a family macro F1 of 82.92% against 81.21%, win on all eight datasets, and take a median of 0.86 ms per flow on the CPU against 12.16 ms on the GPU. Finally, the model for DNS over HTTPS used in our previous work [4] (weighted F1 of 99.00%) is replaced by boosted trees on BCCC-CIRA-CIC-DoHBrw-2020 [6], with an F1 of 99.99% after removing 1.43% duplicate rows, in 0.49 ms per flow.
S8 RULE GENERATION
TABLE S2
Rule generation on 240 held out incidents (%), the values of Fig. 3 of the paper. Acc.: rules the engine loads. Det.: the 84 replayable incidents detected. Recall: given indicators used. "+ loop": validator loop, at most three attempts.
| System | Acc. | Det. | Recall | Wh per rule | p50 (s) |
|---|---|---|---|---|---|
| Local models finetuned for rule generation (previous work in 4 bits) | |||||
| LanG v2 + loop, 16 bits | 98.33 | 82.14 | 98.41 | 0.128 | 3.37† |
| LanG v2 + loop, 8 bits | 97.50 | 79.76 | 98.37 | 0.047 | 1.00† |
| LanG v2, 8 bits, one attempt | 95.00 | 82.14 | 98.41 | 0.043 | 0.78 |
| Previous work [4], Qwen3 1.7B* | 60.00 | 29.03 | 73.86 | 0.169 | 7.00 |
| Previous work [4], Mistral 7B* | 57.50 | 29.03 | 79.25 | 0.352 | 9.81 |
| Local models not finetuned for rule generation (Ollama, 4 bits) | |||||
| Qwen 2.5 Coder 7B | 54.17 | 41.67 | 91.41 | 0.119 | 1.32 |
| Llama 3.1 8B | 31.25 | 8.33 | 86.43 | 0.109 | 1.30 |
| Llama 3.2 3B | 1.67 | 0.00 | 41.39 | 0.061 | 0.81 |
| Claude Opus 5.5 | 99.58 | 88.10 | 98.93 | 0.24 to 0.34 | n/a |
†Not trained on Sigma: 200 incidents, 62 replayable. Our previous work reported 11.2 and 13.65 s per rule on its own prompts. †From the full run, with validation.
S8.1 Complete Workflows
In complete orchestrator runs with the new detector and the served generator (1.3 s per rule), the deployment checkpoint was reached in both workflows that produced rules. Rules for these incidents, unlike the training data, failed their engine after three attempts through a depth shorter than its content, an unknown Snort 2 classtype or a mismatched Suricata 7 buffer size. The analyst withheld them, the other rules were deployed, and the ledger chain verified in every workflow.
S9 FINETUNED AGENTS: PROTOCOL AND LADDER
TABLE S3
Macro F1 (%) of the detection phase agents (Fig. 4 of the paper) on unseen organizations and networks. Sub.: items the frontier model answered (397, 250, 217). All: whole test set (10,297, 3,000, 5,495), run for the finetuned and classical systems only (Section 5.7 of the paper explains the empty cells). Classical: TF-IDF with logistic regression (alerts), LightGBM (others). 95% intervals in the text.
| System | Alert step | Incident grade | Flow family | |||
|---|---|---|---|---|---|---|
| Sub. | All | Sub. | All | Sub. | All | |
| LanG finetuned base size | 97.31 | 90.75 | 42.83 | 40.95 | 12.14 | 16.27 |
| Claude Opus 5.5 | 95.19 | 27.24 | 26.78 | |||
| gpt-oss-20b | 53.64 | 30.07 | 14.78 | |||
| Classical | 98.32 | 93.10 | 43.41 | 42.16 | 12.24 | 12.58 |
| Keyword rules | 56.00 | 42.86 | ||||
| Llama 3.2 3B | 18.73 | 19.18 | 7.32 | |||
| Qwen 3.5 4B | 37.98 | 18.49 | 10.64 | |||
| Qwen 2.5 7B | 36.83 | 23.42 | 11.91 | |||
Data. The alert analyst uses the AIT alert data set: alerts of five organizations for training, one for validation and two (10,297 alerts) for test, with at most five alerts per masked template in training. The incident grader uses the GUIDE training file, split by organization 70/10/20, with 12,000 training incidents (at most 300 per organization) and 3,000 test incidents at natural prevalence, without the post triage fields ActionGrouped and ActionGranular. The family namer holds out one network at a time (UNSW-NB15, ToN-IoT, CSE-CIC-IDS2018), trains on the others, and uses BoT-IoT as a development fold for the escalation rule. Its test sets hold attack flows and benign flows that the site baseline flagged, 5,495 distinct flows in all.
Training and serving. Each adapter is a LoRA of rank 16 () on all projections, trained for two epochs at a learning rate of on the completion only, with 4 bit QLoRA for 8B bases. The adapter is merged, converted to GGUF at 8 bits and served by Ollama at temperature 0 with a JSON schema, at most 48 new tokens (64 for alerts) and a context of 4,096 tokens. A response that does not parse or names a class outside the task counts as wrong. The 8B adapters are merged shard by shard and served from the same 8 bit GGUF by llama.cpp, which maps the file in place, since importing 8.7 GB models into Ollama exhausted the memory of the workstation. Decoding is identical.
Frontier protocol. Each frontier answer comes from a fresh Claude Opus 5.5 context that receives one line asking for the answer only, without tools, followed by the same instruction and item as the local models. Repeated item texts were asked once. The frontier model answered 397 test and 109 validation alerts, 250 test and 30 validation incidents, and 217 test and 39 development flows. Its energy is the published 0.24 to 0.34 Wh per request. The open weight gpt-oss-20b [7] (MXFP4 GGUF) is served by llama.cpp with its chat template, low reasoning effort, greedy decoding, seed 0 and the same JSON schema, and its energy is measured on our GPU like the local models.
TABLE S4
Escalation ladder: validation macro F1 (%) on items the frontier model also answered, and training energy. A larger base is tried only if the agent trails the frontier model and its last step gained at least two points.
| Agent | Base | F1 | Frontier | Gain | kWh | Decision |
|---|---|---|---|---|---|---|
| Alert analyst (109 alerts) | 1.7B | 85.10 | 89.76 | 0.136 | escalate | |
| 4B | 89.63 | 89.76 | 4.53 | 0.272 | escalate | |
| 8B | 72.97 | 89.76 | -16.66 | 0.429 | keep 4B | |
| Incident grader (30 incidents) | 1.7B | 55.13 | 29.40 | 0.141 | keep | |
| Family namer (39 flows) | 1.7B | 17.52 | 52.61 | 0.130 | escalate | |
| 4B | 20.75 | 52.61 | 3.23 | 0.314 | escalate | |
| 8B | 0.36–0.49 | per fold |
TABLE S5
Family namer on each test network, absent from the training of both systems. Macro F1 (%) with its 95% confidence interval (CI) over flows.
| Network | Macro F1 [95% CI] | ||
|---|---|---|---|
| Flows | Finetuned 8B | LightGBM | |
| UNSW-NB15 | 2,535 | 9.20 [8.34, 10.11] | 11.43 [10.52, 12.42] |
| ToN-IoT | 2,405 | 19.20 [17.88, 20.69] | 10.06 [9.25, 10.97] |
| CSE-CIC-IDS2018 | 1,059 | 15.65 [14.19, 17.37] | 13.65 [12.21, 15.07] |
| All (distinct flows) | 5,495 | 16.27 [15.35, 17.26] | 12.58 [11.92, 13.23] |
S10 SECURITY EVALUATION DETAILS
TABLE S6
Input filters on published injections and benign text, each passed through the production quarantine as one log message. Share flagged, and quarantined (never seen by a model), in % with 95% confidence interval (CI). Pattern layer: 0.1 ms per field. Prompt Guard 2: about 10 ms more on the GPU.
| Texts | Pattern layer | With Prompt Guard 2 % [95% CI] | ||
|---|---|---|---|---|
| flagged | flagged | quarantined | ||
| BPIA instructions (150) | 0.00 [0.00, 2.43] | 0.67 [0.12, 3.68] | 0.00 [0.00, 2.43] | |
| BPIA in log lines (150) | 0.00 [0.00, 2.43] | 0.67 [0.12, 3.68] | 0.00 [0.00, 2.43] | |
| deepset injections (263) | 5.32 [3.20, 8.74] | 26.24 [21.29, 31.87] | 19.39 [15.07, 24.60] | |
| deepset benign (399) | 0.00 [0.00, 0.92] | 0.25 [0.04, 1.41] | 0.00 [0.00, 0.92] | |
| AIT alerts (2,000) | 0.00 [0.00, 0.18] | 0.00 [0.00, 0.18] | 0.00 [0.00, 0.18] | |
| AIT log lines (2,000) | 0.00 [0.00, 0.18] | 0.00 [0.00, 0.18] | 0.00 [0.00, 0.18] | |
TABLE S7
Injection in complete workflows: 40 AIT incidents (30 attacks, 10 benign), one BPIA attack each in a user agent or log line. Changes against the same incident without attack, in % of 40 workflows. Clean rerun: identical clean prompts run twice. Benign: attack incidents graded benign. All workflows reached the analyst.
| Configuration | Severity | Priority | Log risk | |||
|---|---|---|---|---|---|---|
| Flagged | lower | higher | lower | changed | Benign | |
| No filter | 0.00 | 15.00 | 25.00 | 0.00 | 47.50 | 0 of 30 |
| Pattern filter | 0.00 | 30.00 | 20.00 | 2.50 | 55.00 | 0 of 30 |
| Prompt Guard 2, spotlighting | 0.00 | 37.50 | 30.00 | 10.00 | 55.00 | 0 of 30 |
| Benign text control | 0.00 | 32.50 | 30.00 | 7.50 | 45.00 | 0 of 30 |
| Clean rerun | n/a | 10.00 | 32.50 | 0.00 | 57.50 | n/a |
TABLE S8
Poisoned feedback, mean of 12 runs (four NetFlow data sets, three baseline draws), in %. FPR and Det.: alerts on benign and attack flows. Fam. F1: naming of detected attacks. Named, Alerted: targeted family flows named correctly, alerted. Gate: adaptations accepted (of 12). Audit: poisoned labels sent to a second analyst. Without labels: FPR 1.08, Det. 59.48, Fam. F1 0.86, Named 2.26, Alerted 63.54.
| Labels | FPR | Det. | Fam. F1 | Named | Alerted | Gate | Audit |
|---|---|---|---|---|---|---|---|
| Clean | 2.57 | 89.24 | 61.01 | 80.97 | 92.86 | 9 | n/a |
| Targeted, | 2.56 | 83.57 | 59.38 | 70.12 | 84.87 | 8 | 70.83 |
| Targeted, | 2.64 | 78.53 | 56.53 | 55.95 | 75.59 | 7 | 66.11 |
| Targeted, | 2.31 | 73.00 | 53.74 | 38.34 | 68.07 | 10 | 63.89 |
| Targeted, | 1.82 | 69.00 | 43.51 | 10.97 | 64.12 | 12 | 65.00 |
| Availability, | 2.47 | 88.40 | 60.34 | 78.68 | 91.24 | 12 | 0.00 |
| Availability, | 2.64 | 89.19 | 60.47 | 79.86 | 92.09 | 11 | 0.00 |
| Availability, | 2.91 | 88.60 | 59.40 | 80.01 | 92.05 | 12 | 0.00 |
| Availability, | 7.79 | 89.04 | 61.18 | 80.52 | 92.28 | 6 | 0.00 |
| Autonomous self labels | 1.07 | 59.48 | 0.59 | 1.38 | 63.53 | 9 | 60.80 |
TABLE S9
Ledger tampering: trials detected of 200 per attack, by the chain alone and against an anchor taken before the attack.
| Attack | Without key | With HMAC key | ||
|---|---|---|---|---|
| chain | anchor | chain | anchor | |
| Edit one record | 200 | 200 | 200 | 200 |
| Delete one record | 200 | 200 | 200 | 200 |
| Truncate 1, 10 or 100 records | 0 | 200 | 0 | 200 |
| Forge a record after the head | 0 | 0 | 200 | 200 |
| Swap two records | 200 | 200 | 200 | 200 |
| Edit and rebuild the chain | 0 | 200 | 200 | 200 |
| Restore a backup | 0 | 200 | 0 | 200 |
S11 TARGETED IMPROVEMENTS
After the main evaluation, we applied six inexpensive fixes to the weakest results, measured on the same data and splits, outside the preregistered comparisons. Table S10 summarizes them. All runs together took under two hours on the workstation.
TABLE S10
Targeted improvements, before and after (%). F1 is macro F1 except for correlation (B F1). Means over five draws for the label experiments.
| Fix | Metric | Before | After |
|---|---|---|---|
| Greedy decoding, fixed seed | severity changed, clean rerun | 42.50 | 0.00 |
| log risk changed, clean rerun | 57.50 | 25.00 | |
| F1, three new networks | 12.31 | 55.07 | |
| 50 site labels (family name) | 67.08 | ||
| 200 site labels | 23.33 | ||
| frontier names as labels | 69.53 | ||
| 10 labels per organization | F1, 17 GUIDE organizations | 28.25 | 77.09 |
| 25 labels | 41.18 | ||
| Hub pruning, anchored graph | F1, Benchmark B, | 24.49 | 41.18 |
| F1, GUIDE, one day | 37.04 | 39.39 | |
| YARA repair (validator loop) | detection, 84 incidents | 82.14 | 86.90 |
| detection, 108 held out YARA | 57.41 | 80.56 | |
| Score ensemble (not adopted) | detection at 1% false alarms | 42.66 | 24.38 |
S12 REVIEW EFFORT
Besides energy, the workflow changes how much evidence an analyst must review. Let be the time to inspect one event, the incoming event count and the number of evidence units returned for review. Manual correlation requires at least , while the proposed workflow requires , where is machine time. In the measured run, , and seconds. With minutes, the manual lower bound is 200 minutes and the workflow takes about 26 minutes, a reduction of 7.6 times.
This is an analytical estimate under a stated assumption on review time, not a field study or evidence of a shorter time to identify breaches. Measuring that time requires repeated investigations of the same scenarios by analysts working manually and with LanG, which we plan with beachhead users (Section 6 of the paper).
REFERENCES
[1] B. E. Strom, A. Applebaum, D. P. Miller, K. C. Nickels, A. G. Pennington, and C. B. Thomas, "MITRE ATT&CK: Design and philosophy," The MITRE Corporation, Tech. Rep. MP180360, 2018.
[2] E. M. Hutchins, M. J. Cloppert, and R. M. Amin, “Intelligence-driven computer network defense informed by analysis of adversary campaigns and intrusion kill chains,” in Proc. 6th Int. Conf. Inf. Warfare Secur. (ICIW), 2011, pp. 113–125.
[3] J. Kaplan, S. McCandlish, T. Henighan, T. B. Brown, B. Chess, R. Child, S. Gray, A. Radford, J. Wu, and D. Amodei, “Scaling laws for neural language models,” arXiv:2001.08361, 2020.
[4] A. Abdennebi, N. Kara, L. Lahlou, and H. Ould-Slimane, “LanG – a governance-aware agentic AI platform for unified security operations,” arXiv preprint arXiv:2604.05440, 2026. [Online]. Available: https://arxiv.org/abs/2604.05440
[5] S. Chennabasappa, C. Nikolaidis, D. Song, D. Molnar, S. Ding, S. Wan, S. Whitman, L. Deason, N. Doucette, A. Montilla et al., “LlamaFirewall: An open source guardrail system for building secure AI agents,” arXiv:2505.03574, 2025.
[6] M. MontazeriShatoori, L. Davidson, G. Kaur, and A. Habibi Lashkari, “Detection of DoH tunnels using time-series classification of encrypted traffic,” in Proc. IEEE DASC/PiCom/CBDCom/CyberSciTech, 2020, pp. 63–70.
[7] OpenAI, “gpt-oss-120b & gpt-oss-20b model card,” arXiv:2508.10925, 2025.
S13 ARTIFACT AVAILABILITY
All datasets are public: the NetFlow v3, CICFlowMeter and NTLFlowLyzer exports of Section 5.4 of the paper, GUIDE, the AIT alert data set, Emerging Threats Open, the Snort community rules, SigmaHQ, public YARA rules, BPIPA and the deepset injection collection. With the paper we release the LanG code, the benchmark and figure scripts, the generated log corpora and their generators, the identifiers and seeds of every evaluated item, the preregistration of the finetuned agents, the prompts, the frontier answers and all result files in the repository https://github.com/RoronoaZ/LanG. The finetuned weights are available on request.