Proceedings

HardSecBench: Benchmarking the Security Awareness of LLMs for Hardware Code Generation

Download BibTeX Cite

Proceedings of the Thirty-Fifth International Joint Conference on Artificial Intelligence. Main Track. Pages 500-508.

https://doi.org/10.24963/ijcai.2026/57

Abstract

Large language models (LLMs) are increasingly used for hardware and firmware code generation, but existing studies primarily evaluate functional correctness while largely overlooking security. However, LLM-generated code that appears functionally sound may embed security flaws which could induce catastrophic damages after deployment. This critical research gap motivates us to design a benchmark for assessing security awareness under realistic specifications. In this work, we introduce HardSecBench, a benchmark with 924 tasks spanning Verilog Register Transfer Level (RTL) and firmware-level C, covering 76 hardware-relevant Common Weakness Enumeration (CWE) entries. Each task includes a structured specification, a secure reference implementation, and executable tests. To automate artifact synthesis, we propose a multi-agent pipeline that decouples synthesis from verification and grounds evaluation in execution evidence, enabling reliable evaluation. We evaluate diverse LLMs and find that they often satisfy functional requirements while leaving security risks. We also find that security results vary with prompting. These findings highlight pressing challenges and offer actionable insights for future advancements in LLM-assisted hardware design. Our data and code are available at https://github.com/chenqirui2002/HardSecBench.

  1. [Afsharmazayejani et al., 2024] Raheel Afsharmazayejani, Mohammad Moradi Shahmiri, Parker Link, Hammond Pearce, and Benjamin Tan. Toward hardware security benchmarking of llms. In 2024 IEEE LLM Aided Design Workshop (LAD), pages 1-5. IEEE, 2024.
  2. [Anthropic, 2025] Anthropic. Claude Model Cards. https: //platform.claude.com/docs/en/resources/overview, 2025. Accessed: 2026-05-11. Link
  3. [Bhatt et al., 2024] Manish Bhatt, Sahana Chennabasappa, Yue Li, Cyrus Nikolaidis, Daniel Song, Shengye Wan, Faizan Ahmad, Cornelius Aschermann, Yaohui Chen, Dhaval Kapil, David Molnar, Spencer Whitman, and Joshua Saxe. CyberSecEval 2: A wide-ranging cyberse- curity evaluation suite for large language models. https: //arxiv.org/abs/2404.13161, 2024. Link
  4. [Blocklove et al., 2023] Jason Blocklove, Siddharth Garg, Ramesh Karri, and Hammond Pearce. Chip-Chat: Chal- lenges and opportunities in conversational hardware de- sign. In 2023 ACM/IEEE 5th Workshop on Machine Learning for CAD (MLCAD), pages 1-6, 2023.
  5. [DeepSeek-AI, 2024] DeepSeek-AI. DeepSeek-V3 techni- cal report. https://arxiv.org/abs/2412.19437, 2024. Link
  6. [Fan et al., 2025] Fanghao Fan, YingJie Xia, and Li Kuang. SecV: Llm-based secure verilog generation with clue- guided exploration on hardware-cwe knowledge graph. In James Kwok, editor, Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence, IJCAI-25, pages 8049-8057. International Joint Confer- ences on Artificial Intelligence Organization, 8 2025. Main Track.
  7. [Fang et al., 2024] Wenji Fang, Mengming Li, Min Li, Zhiyuan Yan, Shang Liu, Hongce Zhang, and Zhiyao Xie. AssertLLM: Generating hardware verification assertions from design specifications via multi-llms. In 2024 IEEE LLM Aided Design Workshop (LAD), pages 1-1, 2024.
  8. [Fu et al., 2024] Yanjun Fu, Ethan Baker, Yu Ding, and Yizheng Chen. Constrained decoding for secure code gen- eration. arXiv preprint arXiv:2405.00218, 2024.
  9. [Google, 2025] Google. Model cards: Simple, structured overviews of how an advanced ai model was designed and evaluated. https://deepmind.google/models/model-cards/, 2025. Accessed: 2026-05-11. Link
  10. [Hu et al., 2025] Ziteng Hu, Yingjie Xia, Xiyuan Chen, and Li Kuang. SecFSM: Knowledge graph-guided ver- ilog code generation for secure finite state machines in systems-on-chip. https://arxiv.org/abs/2508.12910, 2025. Link
  11. [Jimenez et al., 2024] Carlos E Jimenez, John Yang, Alexan- der Wettig, Shunyu Yao, Kexin Pei, Ofir Press, and Karthik R Narasimhan. SWE-bench: Can language mod- els resolve real-world github issues? In The Twelfth Inter- national Conference on Learning Representations, 2024.
  12. [Kim et al., 2025] Minseon Kim, Jin Myung Kwak, Lama Alssum, Bernard Ghanem, Philip Torr, David Krueger, Fazl Barez, and Adel Bibi. Rethinking safety in LLM fine-tuning: An optimization perspective. In Second Con- ference on Language Modeling, 2025.
  13. [Li et al., 2025] Xinghang Li, Jingzhe Ding, Chao Peng, Bing Zhao, Xiang Gao, Hongwan Gao, and Xinchen Gu. SafeGenBench: A benchmark framework for security vul- nerability detection in llm-generated code. https://arxiv. org/abs/2506.05692, 2025. Link
  14. [Liu et al., 2023] Mingjie Liu, Nathaniel Pinckney, Brucek Khailany, and Haoxing Ren. VerilogEval: Evaluating large language models for verilog code generation. In 2023 IEEE/ACM International Conference on Computer Aided Design (ICCAD), pages 1-8, 2023.
  15. [Liu et al., 2024] Mingjie Liu, Teodor-Dumitru Ene, Robert Kirby, Chris Cheng, Nathaniel Pinckney, Rongjian Liang, Jonah Alben, et al. ChipNeMo: Domain-adapted llms for chip design. https://arxiv.org/abs/2311.00176, 2024. Link
  16. [Liu et al., 2025] Shang Liu, Wenji Fang, Yao Lu, Jing Wang, Qijun Zhang, Hongce Zhang, and Zhiyao Xie. RTLCoder: Fully open-source and efficient llm-assisted rtl code generation technique. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Sys- tems, 44(4):1448-1461, 2025.
  17. [Long et al., 2025] Xiang Long, Yingjie Xia, Xiyuan Chen, and Li Kuang. VerilogLAVD: Llm-aided rule generation for vulnerability detection in verilog. https://arxiv.org/abs/ 2508.13092, 2025. Link
  18. [Lu et al., 2024] Yao Lu, Shang Liu, Qijun Zhang, and Zhiyao Xie. RTLLM: An open-source benchmark for de- sign rtl generation with large language model. In 2024 29th Asia and South Pacific Design Automation Confer- ence (ASP-DAC), pages 722-727. IEEE, 2024.
  19. [Mashnoor et al., 2025] Nowfel Mashnoor, Mohammad Akyash, Hadi Kamali, and Kimia Azar. CircuitGuard: Mitigating llm memorization in rtl code generation against ip leakage. In 2025 IEEE 43rd International Conference on Computer Design (ICCD), pages 790-797, 2025.
  20. [Meta, 2025] Meta. Llama 4: Leading intelligence. un- rivaled speed and efficiency. https://www.llama.com/ models/llama-4/, 2025. Accessed: 2026-05-11. Link
  21. [MITRE, 2006] MITRE. Common weakness enumeration. https://cwe.mitre.org/index.html, 2006. Accessed: 2026- 05-11. Link
  22. [Moonshot AI, 2025] Moonshot AI. Kimi k2: Open agen- tic intelligence. https://moonshotai.github.io/Kimi-K2/, 2025. Accessed: 2026-05-11. Link
  23. [OpenAI, 2024] OpenAI. Introducing ope- nai o1-preview. https://openai.com/index/ introducing-openai-o1-preview/, 2024. Accessed: 2026-05-11. Link
  24. [OpenAI, 2025a] OpenAI. GPT-5 System Card. https:// openai.com/index/gpt-5-system-card/, 2025. Accessed: 2026-05-11. Link
  25. [OpenAI, 2025b] OpenAI. gpt-oss-120b & gpt-oss-20b model card. https://arxiv.org/abs/2508.10925, 2025. Link
  26. [OpenRouter, Inc, 2023] OpenRouter, Inc. Openrouter: The unified interface for llms. https://openrouter.ai/, 2023. Ac- cessed: 2026-05-11. Link
  27. [Orenes-Vera et al., 2021] Marcelo Orenes-Vera, Aninda Manocha, David Wentzlaff, and Margaret Martonosi. Au- toSVA: Democratizing formal verification of RTL module interactions. In 58th ACM/IEEE Design Automation Con- ference, DAC 2021, San Francisco, CA, USA, December 5-9, 2021, pages 535-540. IEEE, 2021.
  28. [Peng et al., 2025] Jinjun Peng, Leyi Cui, Kele Huang, Jun- feng Yang, and Baishakhi Ray. CWEval: Outcome-driven evaluation on functionality and security of llm code gen- eration. In 2025 IEEE/ACM International Workshop on Large Language Models for Code (LLM4Code), pages 33- 40, 2025.
  29. [Perry et al., 2023] Neil Perry, Megha Srivastava, Deepak Kumar, and Dan Boneh. Do users write more insecure code with ai assistants? In Proceedings of the 2023 ACM SIGSAC Conference on Computer and Communications Security, CCS '23, page 2785-2799, New York, NY, USA, 2023. Association for Computing Machinery.
  30. [Pinckney et al., 2025] Nathaniel Pinckney, Christopher Batten, Mingjie Liu, Haoxing Ren, and Brucek Khailany. Revisiting VerilogEval: A year of improvements in large-language models for hardware code generation. ACM Trans. Des. Autom. Electron. Syst., 30(6), October 2025.
  31. [Ping et al., 2025] Heng Ping, Shixuan Li, Peiyu Zhang, Anzhe Cheng, Shukai Duan, Nikos Kanakaris, Xiongye Xiao, Wei Yang, Shahin Nazarian, Andrei Irimia, and Paul Bogdan. HDLCoRe: A training-free framework for miti- gating hallucinations in llm-generated hdl. In 2025 IEEE International Conference on LLM-Aided Design (ICLAD), pages 108-116, 2025.
  32. [Pulavarthi et al., 2025] Vaishnavi Pulavarthi, Deeksha Nan- dal, Soham Dan, and Debjit Pal. AssertionBench: A benchmark to evaluate large-language models for asser- tion generation. In Luis Chiruzzo, Alan Ritter, and Lu Wang, editors, Findings of the Association for Com- putational Linguistics: NAACL 2025, pages 8058-8065, Albuquerque, New Mexico, April 2025. Association for Computational Linguistics.
  33. [Qiu et al., 2024] Ruidi Qiu, Grace Li Zhang, Rolf Drech- sler, Ulf Schlichtmann, and Bing Li. AutoBench: Auto- matic testbench generation and evaluation using llms for hdl design. In Proceedings of the 2024 ACM/IEEE Inter- national Symposium on Machine Learning for CAD, ML- CAD '24, New York, NY, USA, 2024. Association for Computing Machinery.
  34. [Qwen Team, 2025a] Qwen Team. Qwen3-coder: Agen- tic coding in the world. https://qwenlm.github.io/blog/ qwen3-coder/, 2025. Accessed: 2026-05-11. Link
  35. [Qwen Team, 2025b] Qwen Team. Qwen3-Max: Just scale it. https://qwen.ai/blog?id=qwen3-max, 2025. Accessed: 2026-05-11. Link
  36. [Shi and Zhang, 2025] Jiahao Shi and Tianyi Zhang. RES- CUE: Retrieval augmented secure code generation. https: //arxiv.org/abs/2510.18204, 2025. Link
  37. [SiliconFlow, 2023] SiliconFlow. Siliconflow: One plat- form, all your ai inference needs. https://www.siliconflow. com/, 2023. Accessed: 2026-05-11. Link
  38. [Synopsys, 2015] Synopsys. Spyglass static and for- mal verification. https://www.synopsys.com/verification/ static-and-formal-verification/spyglass.html, 2015. Ac- cessed: 2026-05-11. Link
  39. [Thakur et al., 2023] Shailja Thakur, Baleegh Ahmad, Zhenxing Fan, Hammond Pearce, Benjamin Tan, Ramesh Karri, Brendan Dolan-Gavitt, and Siddharth Garg. Bench- marking large language models for automated verilog rtl code generation. In 2023 Design, Automation & Test in Europe Conference & Exhibition (DATE), pages 1-6, 2023.
  40. [Wu et al., 2024] Haoyuan Wu, Zhuolun He, Xinyun Zhang, Xufeng Yao, Su Zheng, Haisheng Zheng, and Bei Yu. ChatEDA: A large language model powered autonomous agent for eda. IEEE Transactions on Computer-Aided De- sign of Integrated Circuits and Systems, 2024.
  41. [Yu et al., 2025a] Miao Yu, Fanci Meng, Xinyun Zhou, Shi- long Wang, Junyuan Mao, Linsey Pan, Tianlong Chen, Kun Wang, Xinfeng Li, Yongfeng Zhang, Bo An, and Qingsong Wen. A survey on trustworthy llm agents: Threats and countermeasures. In Proceedings of the 31st ACM SIGKDD Conference on Knowledge Discovery and Data Mining V.2, KDD '25, page 6216-6226, New York, NY, USA, 2025. Association for Computing Machinery.
  42. [Yu et al., 2025b] Zhongzhi Yu, Mingjie Liu, Michael Zim- mer, Yingyan Celine, Yong Liu, and Haoxing Ren. Spec2rtl-agent: Automated hardware code generation from complex specifications using llm agent systems. In 2025 IEEE International Conference on LLM-Aided De- sign (ICLAD), pages 37-43, 2025.
  43. [Z.ai, 2025] Z.ai. GLM-4.6: Advanced agentic, reasoning and coding capabilities. https://z.ai/blog/glm-4.6, 2025. Accessed: 2026-05-11. Link
  44. [Zhu et al., 2025] Yaoyu Zhu, Di Huang, Hanqi Lyu, Xi- aoyun Zhang, Chongxiao Li, Wenxuan Shi, Yutong Wu, Jianan Mu, Jinghua Wang, Yang Zhao, Pengwei Jin, Shuyao Cheng, Shengwen Liang, Xishan Zhang, Rui Zhang, Zidong Du, Qi Guo, Xing Hu, and Yunji Chen. QiMeng-CodeV-R1: Reasoning-enhanced verilog genera- tion. In Advances in Neural Information Processing Sys- tems, 2025.

References were extracted automatically from the PDF and may contain errors.

Welcome Future Conferences AI Journal Division IJCAI Proceedings About IJCAI IJCAI Awards