AI
LLM Agent Automatically Learns and Improves Security Detection Rules Without Manual Coding
Researchers show how large language models can autonomously develop and refine static analysis rules to catch security vulnerabilities, adapting to new frameworks and coding patterns as they emerge.
Traditional security analysis tools rely on hand-written detection rules that quickly fall behind emerging threats. When new frameworks, APIs, and programming patterns appear, security gaps persist until engineers manually craft rules to address them. A new approach flips this workflow by using AI to automatically discover and refine detection rules on its own.
How It Works#
Researchers introduced SESAA, a system where a large language model starts with no predefined rules and iteratively evolves a set of executable detection queries for the popular static analysis engine joern. The process operates with minimal external guidance: a second LLM acts as a critic, examining both flagged and unflagged code to spot likely false positives and suspected missed vulnerabilities—all without needing ground-truth labels.
This feedback loop allows the first agent to refine its queries in real time, steadily improving detection accuracy. The resulting rules remain human-readable and auditable, allowing security engineers to inspect, modify, and deploy them independently.
Real-World Performance#
Testing on the OWASP Benchmark for Python showed SESAA achieving a mean F1 score of 0.742 across eight runs—surpassing the default settings of five widely used security tools and matching the performance of the strongest tool when tuned with labeled data that SESAA never accessed.
In a pilot study on real-world Python repositories, rules learned from pre-vulnerability code detected 10 of 19 subsequent CVEs, including 9 that matched rules manually authored for the same codebase.
Why This Matters#
Rather than treating rule maintenance as a perpetual manual burden, this work suggests a path toward automated discovery and continuous improvement. As new threats and coding idioms emerge, LLM-driven systems could adapt security tooling without waiting for human expertise to catch up. The readable, executable output also preserves auditability—a crucial feature for security-critical software.

