Key takeaways
- AI coding assistants are not disqualified from firmware work, but the published research says they cannot be trusted without exactly the review process a human contributor's code already gets.
- Not automatically, but the evidence says "assume nothing" is the safer default than "assume it's fine." The clearest data point remains "Asleep at the Keyboard?
- That 40% figure describes one assistant generation, tested once, several years ago — but the underlying problem has not quietly gone away since.
- Review AI-authored code like a new contributor's pull request, not a trusted teammate's.
AI coding assistants are not disqualified from firmware work, but the published research says they cannot be trusted without exactly the review process a human contributor's code already gets. A peer-reviewed study found roughly 40% of GitHub Copilot's generated code vulnerable to known weakness classes, GitHub's own current documentation admits its Copilot Autofix feature can suggest fixes that "fail to remediate the underlying vulnerability or introduce new vulnerabilities," and a 2025 academic analysis found large language models hallucinate non-existent package names often enough for attackers to register and poison them — a practice researchers call "slopsquatting."
This guide draws on NIST's own published SSDF profile for generative AI, GitHub's current Copilot documentation, the peer-reviewed "Asleep at the Keyboard?" study and the USENIX "We Have a Package for You!" study, and OWASP's Top 10 for LLM Applications — each fetched and quoted directly for this guide. Confirm exact figures against the current edition of each source before citing them elsewhere.
Do AI coding assistants actually make firmware code less secure?
Not automatically, but the evidence says "assume nothing" is the safer default than "assume it's fine." The clearest data point remains "Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributions" (Pearce, Ahmad, Tan, Dolan-Gavitt and Karri, IEEE Symposium on Security and Privacy 2022): across 89 scenarios drawn from MITRE's CWE Top 25 and OWASP's Top 10, Copilot generated 1,689 programs, and the researchers "found approximately 40% to be vulnerable." Firmware and embedded code sit squarely inside that exposure — memory-safety weaknesses from the CWE Top 25 (buffer overflows, out-of-bounds access, use-after-free) are exactly the class of bug C and C++ firmware code is already most prone to, with or without an AI assistant in the loop.
How often does AI-generated code actually contain vulnerabilities?
That 40% figure describes one assistant generation, tested once, several years ago — but the underlying problem has not quietly gone away since. GitHub's own current responsible-use documentation for Copilot Autofix, the feature meant to fix flagged vulnerabilities rather than write new code, states plainly: "The system may suggest fixes that fail to remediate the underlying vulnerability or introduce new vulnerabilities," and separately, "The system may suggest fixes that are syntactically valid but change the semantics of the program. The system has no understanding of the programmer's intent." GitHub's conclusion is the same one a security team should draw: "Developers must evaluate each suggestion and verify it maintains the codebase's intended behavior." That is GitHub itself, in 2026-current documentation, describing its newest AI fix-suggestion feature in almost the same terms the 2022 academic study used for raw code generation.
What is "slopsquatting," and why does it matter for firmware's dependency chain?
Slopsquatting is a supply-chain attack built directly on AI hallucination: an attacker registers a package name that coding models are known to invent, so that whatever pulls in "the package the AI suggested" — a developer copy-pasting an import line, or an autonomous coding agent running unattended — gets the attacker's package instead of an error. The scale is documented, not speculative. "We Have a Package for You! A Comprehensive Analysis of Package Hallucinations by Code Generating LLMs" (Spracklen, Wijewickrama, Sakib, Maiti, Viswanath and Jadliwala, USENIX Security 2025) tested 16 coding models and reported that "all 16 tested coding models exhibited notable rates of package hallucinations, averaging 19.6% across the board" — commercial models fared better, around 5%, against roughly 21% for open-source models — and recorded "205,474 unique non-existent packages" invented across their test runs. Firmware teams carry extra exposure here: vendor SDK and chip-maker package registries typically have far less namespace enforcement than npm or PyPI, so a plausible-sounding hallucinated driver or RTOS helper library name is exactly the kind of gap an attacker can fill. OWASP's Top 10 for LLM Applications names the broader category directly as LLM03:2025 "Supply Chain," pointing to real incidents in the same family — attackers who "tricked model developers into downloading a compromised PyTorch dependency with malware," and the "Shadow Ray attack on the Ray AI framework," where, per OWASP, "five vulnerabilities are believed to have been exploited in the wild affecting many servers." Our package URL (purl) guide covers the identifier discipline — exact ecosystem, name and version, not a bare string an assistant typed — that makes a dependency verifiable in the first place.
What does NIST's official guidance actually require for AI-assisted development?
NIST SP 800-218A, "Secure Software Development Practices for Generative AI and Dual-Use Foundation Models: An SSDF Community Profile" (July 2024), refuses to grant AI-generated code any special exemption: "Practices and tasks in this Profile do not distinguish between human-written and AI-generated source code, because it is assumed that all source code should be evaluated for vulnerabilities and other issues before use." Where it does add something specific, it raises the bar rather than lowering it: its risk-modeling practice instructs teams to "incorporate relevant AI model-specific vulnerability and threat types in risk modeling," explicitly listing "poisoning of training data, malicious code or other unwanted content in inputs and outputs, denial-of-service conditions arising from adversarial prompts, supply chain attacks, unauthorized information disclosure, theft of AI model weights, and misconfiguration of data pipelines" as categories a firmware team's threat model should now cover, alongside the classic ones. Our guide to the related NIST SSDF (SP 800-218) covers the base framework this Profile extends for generative-AI and foundation-model use specifically.
What should a firmware team actually do about this today?
Review AI-authored code like a new contributor's pull request, not a trusted teammate'sNIST SP 800-218A's own position — no distinction between human-written and AI-generated source — is the simplest rule to enforce: the same static analysis, code review and test suite, every time, no AI fast lane. Pin every dependency to an exact version and hash, never a bare package name an assistant suggested, so a hallucinated or squatted name cannot silently resolve to something new on a future build. Audit AI-suggested *fixes* with the same scrutiny as AI-suggested *new* codeGitHub's own documentation for Copilot Autofix carries the identical caveat the 2022 Copilot generation study did — a suggested fix that compiles is not the same as a fix that is correct. Keep an SBOM built from what the firmware binary actually contains, not only from a build manifest, since a manifest reflects what was requested, not what ended up in the image — the only way to catch a dependency that entered through a hallucinated or compromised path after the fact. Extend the firmware threat model to the categories NIST SP 800-218A names for generative AI use— training-data poisoning, adversarial-prompt-driven denial of service, and AI supply-chain attacks — rather than treating "AI risk" as covered by ordinary code review alone.
Because SoftWSP's device firmware security scan builds its SBOM straight from the compiled binary image rather than trusting a declared build manifest, a dependency that entered a firmware build because an assistant suggested — or hallucinated — a package name is identified the same way any other component is: by what the binary actually contains, matched against known vulnerabilities, not by what a manifest claims was intended. See firmware SBOM for how that component-identification process works when there is no source code to start from.
This guide is general technical information based on the sources cited above, not a substitute for NIST SP 800-218A, your AI coding assistant vendor's current documentation, or your own organization's secure development policy.
Sources
- NIST SP 800-218A: Secure Software Development Practices for Generative AI and Dual-Use Foundation Models — An SSDF Community Profile (July 2024, PDF)
- GitHub Docs: Responsible use of GitHub Copilot Autofix for code scanning (security and quality AI features)
- Pearce, Ahmad, Tan, Dolan-Gavitt, Karri: "Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributions," IEEE S&P 2022 (arXiv preprint)
- Spracklen, Wijewickrama, Sakib, Maiti, Viswanath, Jadliwala: "We Have a Package for You! A Comprehensive Analysis of Package Hallucinations by Code Generating LLMs," USENIX Security 2025
- OWASP Gen AI Security Project: Top 10 for LLM Applications 2025 — LLM03:2025 Supply Chain
Frequently asked questions
What security risks do AI coding assistants actually introduce into firmware development?
Three distinct, separately documented risks, not one. First, the code an assistant originally generates can itself be insecure: a peer-reviewed study of GitHub Copilot found roughly 40% of generated programs vulnerable across scenarios drawn from MITRE's CWE Top 25. Second, even when an assistant is asked to *fix* a known vulnerability rather than write new code, GitHub's own current documentation warns that "the system may suggest fixes that fail to remediate the underlying vulnerability or introduce new vulnerabilities" and that it "has no understanding of the programmer's intent." Third, assistants can hallucinate dependencies that do not exist — a 2025 academic study found large language models invent non-existent package names at an average rate of 19.6%, and an attacker who registers one of those names under a firmware SDK's package manager gets a dependency pulled straight into a build. Firmware code carries extra exposure on all three: C/C++ memory-safety classes dominate the CWE Top 25 Copilot study, and vendor SDK package registries typically have far less namespace policing than npm or PyPI.
How often does AI-generated code actually contain vulnerabilities, and what kind?
In "Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributions" (Pearce, Ahmad, Tan, Dolan-Gavitt and Karri, IEEE Symposium on Security and Privacy 2022), researchers prompted Copilot across 89 scenarios drawn from MITRE's CWE Top 25 and OWASP's Top 10, producing 1,689 generated programs. Their finding, stated in their own abstract: "we found approximately 40% to be vulnerable." That study is now several years old and covers one specific assistant generation; GitHub's own current responsible-use documentation for its newer Copilot Autofix feature still carries the same caveat today, stating a suggested fix "may suggest fixes that are syntactically valid but change the semantics of the program" and that "developers must evaluate each suggestion and verify it maintains the codebase's intended behavior" — the underlying unreliability has not been declared solved, it has been handed back to the reviewer.
What is "slopsquatting," and why does it matter for a firmware dependency chain?
Slopsquatting is the practice of registering a package name that large language models are known to hallucinate, so that a developer — or an autonomous coding agent — who blindly installs what the AI suggested pulls down the attacker's malicious package instead of an error. The scale is not theoretical: "We Have a Package for You! A Comprehensive Analysis of Package Hallucinations by Code Generating LLMs" (Spracklen, Wijewickrama, Sakib, Maiti, Viswanath and Jadliwala, USENIX Security 2025) tested 16 coding models and found "all 16 tested coding models exhibited notable rates of package hallucinations, averaging 19.6% across the board," with commercial models averaging around 5% against roughly 21% for open-source models, and recorded "205,474 unique non-existent packages" generated across their test runs. OWASP's own Top 10 for LLM Applications names the adjacent risk category directly: LLM03:2025 "Supply Chain" cites real incidents including attackers who "tricked model developers into downloading a compromised PyTorch dependency with malware" and the "Shadow Ray attack on the Ray AI framework," where OWASP states "five vulnerabilities are believed to have been exploited in the wild affecting many servers."
What does NIST's official guidance actually say about securing AI-assisted software development?
NIST SP 800-218A, "Secure Software Development Practices for Generative AI and Dual-Use Foundation Models: An SSDF Community Profile" (July 2024), is explicit that AI-generated code gets no pass: "Practices and tasks in this Profile do not distinguish between human-written and AI-generated source code, because it is assumed that all source code should be evaluated for vulnerabilities and other issues before use." Its risk-modeling practice (PW.1.1, enhanced to a "High" priority task for generative-AI use) instructs teams to "incorporate relevant AI model-specific vulnerability and threat types in risk modeling," explicitly naming "poisoning of training data, malicious code or other unwanted content in inputs and outputs, denial-of-service conditions arising from adversarial prompts, supply chain attacks, unauthorized information disclosure, theft of AI model weights, and misconfiguration of data pipelines" as the categories to cover — a list that reaches well past "does the suggested code compile."
What should a firmware team actually do about AI coding assistants today?
Treat every AI-authored or AI-modified line the same as a new contributor's pull request: it goes through the same static analysis, code review and test suite before merge, with no fast lane because a human didn't type it — directly consistent with NIST SP 800-218A's refusal to distinguish AI-generated from human-written code. Pin firmware dependencies to an exact version and hash rather than a bare package name an assistant suggested, so a hallucinated or squatted package name cannot silently resolve to something new. Keep a current software bill of materials built from what actually ships, not from a build manifest alone, since a manifest reflects what was *requested*, not what a binary actually contains. And budget review time specifically for AI-suggested dependency additions and AI-suggested "fixes" to existing vulnerabilities — both are exactly the two places the research above found the most AI-introduced risk concentrated.
In this cluster

Questions about this page?

