TL;DR
Finding security bugs in computer chips after they are manufactured is a multi-million-dollar nightmare, so engineers are eager to use LLMs to catch flaws early in hardware source code. Unfortunately, existing tests for these AI models use toy code snippets and static checks that don't prove a bug is actually exploitable. SecRTL-Bench introduces a realistic, simulation-verified hardware security benchmark that tests LLMs from initial bug discovery all the way to verified repair—revealing that even today's top models struggle to bridge the gap between spotting a flaw and safely fixing it.
What Problem Does This Paper Address?
Before a silicon chip is etched into physical reality, its behavior—how data moves between registers and logic gates—is written in hardware code called RTL (Register-Transfer Level), typically using languages like Verilog. Catching security flaws at this stage is vastly cheaper than redesigning physical silicon later.
Researchers have started throwing LLMs at RTL security, but how do we know if they’re actually good at it? Current benchmarks fall short in three big ways:
- Toy Complexity: They test single, isolated files rather than real-world IP (Intellectual Property) blocks—complex, multi-file subsystems like processors or cryptographic engines.
- No Proof of Exploit: They often inject bugs and check them using static code patterns without running hardware simulations to verify whether specific inputs and timing actually trigger a security violation.
- Fragmented Grading: They treat detection (is there a bug?), localization (what line is it on?), and repair (write a patch) as disconnected chores rather than a continuous engineering workflow.
Methods
Building a realistic hardware benchmark by hand is grueling, so the authors built an automated six-agent collaborative pipeline coupled with standard EDA (Electronic Design Automation) simulation tools like Verilator and Yosys.
Here is what makes their approach clever:
- Source-Grounded Security Contracts: Agents parse real hardware projects to find sensitive assets (like cryptographic keys or privilege registers), match them against a database of known hardware CWEs (Common Weakness Enumerations), and draft explicit "security contracts" defining what must never happen.
- Freeze Before You Break: Before injecting any vulnerability, a Verification Agent builds and calibrates test stimuli and security checkers, then freezes that test suite. Why? This prevents the testbench from being unfairly tailored to a specific injected patch.
- Dynamic Simulation & Blind Repair: An agent injects a bug, and EDA simulators run the code to prove the bug actually triggers a security violation without breaking normal chip functions. Finally, a separate Repair Agent—kept completely blind to the original clean code—must patch the flaw to prove the benchmark sample is genuinely solvable.
For evaluation, target LLMs run sequentially through detection, localization, and repair without getting ground-truth hints between steps, earning a unified composite score out of 100.
Datasets
The authors introduce SecRTL-Bench, built from eight major open-source hardware repositories: Caliptra, CV32E40S, CVA6, FuseSoC, OpenCores, OpenTitan, PULP, and XiangShan (covering RISC-V processors, DMA controllers, and hardware roots of trust).
Unlike snippet-level datasets, SecRTL-Bench contains 413 simulation-verified vulnerability instances across 270 IPs and 31 hardware CWE types (plus 270 clean designs to test false alarms). An average instance spans 16.97 files and 3,760 lines of code, scaling up to 147 files and nearly 47,000 lines.
Key Insights and Ideas
- Good "Detectors" Can Be Terrible "Fixers": Spotting that a chip is vulnerable does not mean an LLM knows how to fix it. One model caught over 90% of bugs yet successfully repaired fewer than a third of them, while another caught ~74% but fixed 96% of what it found.
- Passing Functional Tests Is a Security Trap: Across every single model tested, patches passed functional tests (the chip still boots and calculates) much more often than security tests (the exploit is actually blocked). Relying on standard functional testbenches gives a dangerous illusion of safety.
- Diagnosis Is the True Bottleneck: When the authors gave LLMs the exact bug location and CWE type on a silver platter, repair rates skyrocketed above 90% for top models. LLMs are surprisingly good at writing Verilog patches—they just struggle to find the needle in a multi-file haystack first.
- Textbook Knowledge Doesn't Automatically Map to Code: Giving models a searchable CWE security knowledge base boosted their ability to name the right vulnerability type, but barely moved the needle on finding the exact buggy line of code for more than half the models.
Key Results
Evaluating nine closed- and open-source LLMs (including GPT-6, Claude-5.5, Gemini-4, Qwen3, GLM-5, and DeepSeek-V4 variants):
- Overall Ceiling: Even with access to an external CWE knowledge base, the highest-scoring model (Gemini-4-Argon) achieved an overall composite score of just 59.83 / 100 (and 52.38 without the knowledge base), followed by DeepSeek-V4.1-Flash at 50.52.
- Conversion Gap: Claude-Opus-5.5 achieved the highest detection rate (90.93%) but only a 25.74% end-to-end repair success rate (28.3% conversion efficiency). Conversely, Gemini-4-Argon achieved a 70.94% end-to-end repair rate.
- Isolated Repair: When given ground-truth locations and bug types, six of the nine models exceeded 80% repair success, peaking at 97.82% (Gemini-4-Argon) and 97.34% (GPT-6-Astra).
Limitations and Future Work
Not discussed in the paper. (While the authors highlight current LLM limitations—such as translating abstract security knowledge into line-level localization and security-preserving patches—they do not explicitly detail limitations of the SecRTL-Bench framework itself or propose specific future work.)
Summary updated