Securing LLM-Generated Embedded Firmware through AI Agent-Driven Validation and Patching
On the map: LLM agents and tool use → Agent threats, guardrails and governance
Abstract (arXiv)
Large Language Models (LLMs) show promise in generating firmware for embedded systems, but often introduce security flaws and fail to meet real-time performance constraints. This paper proposes a three-phase methodology that combines LLM-based firmware generation with automated security validation and iterative refinement in a virtualized environment. Using structured prompts, models like GPT-4 generate firmware for networking and control tasks, deployed on FreeRTOS via QEMU. These implementations are tested using fuzzing, static analysis, and runtime monitoring to detect vulnerabilities such as buffer overflows (CWE-120), race conditions (CWE-362), and denial-of-service threats (CWE-400). Specialized AI agents for Threat Detection, Performance Optimization, and Compliance Verification collaborate to improve detection and remediation. Identified issues are categorized using CWE, then used to prompt targeted LLM-generated patches in an iterative loop. Experiments show a 92.4% Vulnerability Remediation Rate (37.3% improvement), 95.8% Threat Model Compliance, and 0.87 Security Coverage Index. Real-time metrics include 8.6ms worst-case execution time and 195μs jitter. This process enhances firmware security and performance while contributing an open-source dataset for future research.
Key facts. Cited by 3 papers in the map (data through 14 Oct 2026). Placed in Agent threats, guardrails and governance, one of 16 directions in LLM agents and tool use. Builds on 7 of its 20 references that are in the map. First posted on arXiv 12 Sep 2025.
Builds on
7 of 20 references.
References · 7
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
- 2025Multi-Agent Collaboration Mechanisms: A Survey of LLMscited by 431
- 2024AI Agents Under Threat: A Survey of Key Security Challenges and Future Pathwayscited by 127
- 2024LLM Hallucinations in Practical Code Generation: Phenomena, Mechanism, and Mitigationcited by 93
- 2024CodeMirage: Hallucinations in Code Generated by Large Language Modelscited by 23
- 2023Exploring and Characterizing Large Language Models For Embedded System Development and Debuggingcited by 20
- 2024Artificial-Intelligence Generated Code Considered Harmful: A Road Map for Secure and High-Quality Code Generationcited by 12
Built on by
Citing papers per year: 2026: 3.
3 papers.
- 2026Cross-Corpus Evaluation of Generalizable Vulnerability Detection in IoT Firmwarecited by 0
- 2026CESBench: Benchmarking Large Language Models on Cryptographic Engineering Security for IoT Devicescited by 0
- 2026Developing a Roadmap to an AI-first Organization: A Case Study in Embedded Software Developmentcited by 0
- 2026Developing a Roadmap to an AI-first Organization: A Case Study in Embedded Software Development25 Sep 2026
- 2026CESBench: Benchmarking Large Language Models on Cryptographic Engineering Security for IoT Devices18 Sep 2026
- 2026Cross-Corpus Evaluation of Generalizable Vulnerability Detection in IoT Firmware11 Aug 2026
Similar, not cited
Close in wording, no citation either way
- 2025LLMs as Firmware Experts: A Runtime-Grown Tree-of-Agents Framework
- 2026Closed-loop evaluation of LLM agents for embedded software development
- 2025SV-LLM: An Agentic Approach for SoC Security Verification using Large Language Models
- 2025From LLMs to Agents: A Comparative Evaluation of LLMs and LLM-based Agents in Security Patch Detection
- 2025AutoPentest: Enhancing Vulnerability Management With Autonomous LLM Agents
- 2025Bridging AI and Software Security: A Comparative Vulnerability Assessment of LLM Agent Deployment Paradigms
- 2025MARVEL: Multi-Agent RTL Vulnerability Extraction using Large Language Models
- 2025LLMpatronous: Harnessing the Power of LLMs For Vulnerability Detection