TL;DR
While Large Language Models (LLMs) have become highly proficient at writing syntactically correct rules for Network Intrusion Detection Systems (NIDS), security experts remain deeply skeptical of their practical utility. This paper exposes a "syntax-semantics paradox": large models can generate rules that compile perfectly, but they frequently lack the specificity required for production or suffer from logical hallucinations, positioning LLMs as excellent drafting assistants rather than autonomous security engineers.
What Problem Does This Paper Address?
Modern Network Intrusion Detection Systems (NIDS) like Snort and Suricata rely on hand-crafted, signature-based rules to detect malicious traffic. However, manually writing and maintaining these rulesets is a massive operational bottleneck. Security Operations Centers (SOCs) face severe alert fatigue, complex rule syntaxes, and a rapidly evolving threat landscape.
While recent research suggests LLMs can automate rule generation, these approaches haven't been validated by real-world practitioners. This paper addresses a critical gap: Do security experts actually trust LLM-generated rules, and are these rules safe to deploy in production environments?
Methods
The authors formalize a grounded, end-to-end Rule Engineering Agent framework based on an extensive literature review and a pre-study survey with domain experts.
The system ingests network topologies, vulnerability inventories (CVEs), and Proof-of-Concept (PoC) exploits. It processes these inputs into structured templates for a local LLM engine (orchestrated via Ollama). To ensure technical viability, the framework includes a multi-stage validation pipeline:
- Syntax Checker: Validates raw rules against a native compiler.
- Syntax Corrector: An automated feedback loop that feeds compilation errors back to the LLM for autonomous structural repairs.
- Human Loop: An interactive interface allowing experts to review, test, and iteratively refine rules via adaptive prompting.
The authors then conducted a blind user study with 10 seasoned security professionals to evaluate both the quality of the generated rules and the usability of the interactive system.
Datasets
The framework was evaluated across six distinct network scenarios designed to simulate varying levels of cognitive load:
- Synthetic Networks: One small (SS) and one medium-sized (SM) network generated using a vulnerable network benchmark, pairing reachability graphs with real-world software inventories.
- Real-World Network Data: Four variations of the standard CIC-IDS 2017 dataset, manipulated to test different densities of CVEs (1 or 2 per device) and the presence or absence of corresponding PoC exploit code.
A total of 27 open-source LLM engines were benchmarked, generating 2,871 candidate rules.
Key Insights and Ideas
- The Syntax-Semantics Paradox: LLMs are excellent grammarians but mediocre security logicians. They excel at generating rules that pass compiler checks, but fail at capturing the nuanced semantics of an attack.
- The $\ge$ 70B Parameter Threshold: Size matters. Models with $\le$ 4B parameters are entirely incapable of generating valid NIDS syntax. Reliable grammar comprehension only consistently emerges in large-scale models ($\ge$ 70B parameters), such as DeepSeek-R1 and Llama 3.3.
- Bimodal Correction Behavior: LLM-generated rules are highly polarized—they are either correct on the first attempt or incredibly stubborn to fix, often requiring multiple iterations through the automated syntax corrector loop.
- Over-Reliance on Simple Matching: LLMs default heavily to generic variables (like
ANYports/IPs) and basic string content matching. They rarely utilize advanced, highly specific rule options likeDISTANCEorWITHIN, which experts rely on to prevent false-positive storms.
Key Results
- High Syntax, Low Deployability: Large models achieved up to a 90% success rate in generating syntactically valid rules. However, when evaluated by human experts, only 37.5% of those rules were deemed semantically correct and safe for practical deployment.
- Logic Hallucinations: Experts caught logic hallucinations in 12% of cases, such as models confusing protocols (e.g., expecting unencrypted SMBv1 traffic over encrypted UDP/QUIC ports) or mismatching alert messages with the actual rule logic.
- Favorable Usability: The interactive system scored a 67 on the System Usability Scale (SUS), indicating good usability. Experts highly valued the PoC Finder and rule testing modules as "force multipliers" for drafting.
- Rejection of Autonomy: Practitioners overwhelmingly rejected a fully autonomous "suggest-and-deploy" mode (70% gave it a trust score of 2/5 or lower), firmly insisting that the human must remain the ultimate bearer of responsibility.
Limitations and Future Work
The primary limitation is that LLMs still struggle with deep, fine-grained protocol reasoning and context-aware specificity. Providing PoC exploit data moderately improved rule quality, but dramatically increased the token context length, which confused smaller-context models.
Future work should move away from pursuing fully autonomous AI generation. Instead, research should focus on optimizing human-AI collaborative frameworks, improving the semantic precision of large models, and developing automated tools to measure rule detection performance against sample attack PCAPs before deployment.
Summary updated