AI-generated code security statistics show why a working prototype still needs independent review. Veracode, which sells application security software, found vulnerabilities in about 38% of code generation tasks in its October 2026 benchmark.
Salt Security, which sells API security software, found that 90% of surveyed security leaders had concerns about AI-generated code in its 2026 survey. Budget for specialist review before your operations team relies on an app.
Key takeaways
- Ask your reviewer to consider the programming language behind your app. Veracode's October 2026 benchmark put Java's security pass rate at 31%.
- Check unfamiliar software packages before using them. Researchers presenting at USENIX Security 2025 found an average package hallucination rate of at least 21.7% among open-source AI models.
- Budget for finding and fixing problems after development. Aikido Security, which sells application security software, found in its 2026 research that 69% of organizations surveyed had discovered vulnerabilities introduced by AI-generated code.
- Give reviewers enough time between app updates. The Linux Foundation's November 2026 research found that 58% of organizations were releasing code faster than security reviews could keep up.
- Keep a qualified person responsible for reviewing your software. Only 21% of respondents in Aikido Security's 2026 research believed AI would eventually write secure code without human oversight.
How often does AI-generated code contain vulnerabilities?
Veracode's controlled tests found vulnerabilities in a substantial share of AI-generated code. But research by Maximilian Schreiber and Pascal Tippe found fewer detectable problems in public code repositories, so a laboratory failure rate shouldn't be applied to every business app.
1. About 38% of AI code generation tasks produced code with a known vulnerability
Veracode's fall benchmark found vulnerabilities in about 38% of code generation tasks in 2026. The company tested 18 AI models across four programming languages and four vulnerability categories without specific security instructions in the prompts, rather than testing complete applications.
2. 38.9% of AI coding agent pull requests contained potential security problems
A July 2026 academic preprint by A H M Nazmus Sakib, Dipayan Banik and Murtuza Jadliwala identified potential security problems in 38.9% of 4,022 proposed code changes generated by AI coding agents. The researchers measured suspicious coding patterns rather than confirmed exploitable vulnerabilities.
3. AI-generated code contained 31 of 56 confirmed vulnerabilities in one study
Vladislav Belozerov, Peter J Barclay and Ashkan Sami examined 2,315 code snippets in their March 2026 study and attributed 31 of 56 confirmed vulnerabilities to AI-generated code. The other 25 appeared in code supplied by developers, though these counts don't establish comparative vulnerability rates across all generated and human-written software.
4. Java coding tasks achieved a 31% security pass rate
Veracode's October benchmark recorded a 31% security pass rate for Java coding tasks in 2026. Java performed worst among the four programming languages in the company's controlled tests.
5. 87.9% of examined AI-generated code had no identifiable vulnerabilities mapped to known weakness categories
Maximilian Schreiber and Pascal Tippe found no identifiable vulnerabilities mapped to Common Weakness Enumeration categories in 87.9% of the AI-generated code examined in their October 2025 preprint. The researchers used CodeQL to examine 7,703 files from public GitHub repositories, so undetected problems remain possible.
Which security flaws are AI coding tools prone to?
Veracode's October 2026 benchmark found particularly low pass rates for cross-site scripting and log injection. Research presented at USENIX Security 2025 also found problems with AI-generated recommendations for external software packages.
6. AI-generated code passed 18% of cross-site scripting tests
Veracode's October results recorded an average security pass rate of 18% for cross-site scripting tasks in 2026. Veracode identifies basic cross-site scripting as a vulnerability involving unsafe handling of input within web pages.
7. AI-generated code passed 12.6% of log injection tests
Veracode's 2026 benchmark recorded a 12.6% security pass rate for log injection tasks in October. According to Veracode, these tasks require models to follow input through different parts of an application before it reaches an activity log.
8. AI-generated code passed 83.7% of SQL injection tests
Veracode's October testing found an average security pass rate of 83.7% for SQL injection tasks in 2026. The result covers a specific type of database-related vulnerability under controlled conditions.
9. Open-source AI models hallucinated at least 21.7% of suggested software packages
Researchers from the University of Texas at San Antonio, the University of Oklahoma and Virginia Tech found an average hallucination rate of at least 21.7% for package suggestions from open-source AI models in their USENIX Security study. Published in 2025, the research examined 576,000 code samples from 16 models and identified recommendations for packages that didn't exist.
10. Commercial AI models hallucinated at least 5.2% of suggested software packages
The researchers' 2025 package study recorded an average hallucination rate of at least 5.2% for commercial models. The tests covered Python and JavaScript code generation using two sets of prompts.
11. 60% of security practitioners said AI coding tools increased external software dependencies
The Linux Foundation's November 2026 research found that 60% of 176 respondents reported an increase in external software dependencies when using AI coding tools. These are existing software components used within an application, and the finding reflects practitioners' reported experiences.
12. 82.3% of detected security problems in AI agent code changes involved software supply chain integrity
A H M Nazmus Sakib and his co-authors attributed 82.3% of detected security code smells to software supply chain integrity issues in their July 2026 preprint. Their analysis covered 16,112 file changes and classified potential weaknesses in the use of external software components.
What are businesses experiencing with AI-generated code?
Aikido Security's 2026 survey found that organizations had already encountered vulnerabilities and serious incidents associated with AI-generated code. Salt Security's research also identifies insecure coding patterns as a concern among technical leaders.
13. 90% of surveyed security leaders had concerns about AI-generated code
In Salt Security's 2026 survey, 90% of security leaders expressed concern about risks introduced by AI-generated code. Censuswide surveyed 100 IT security leaders across the UK and US between May 12 and May 15, 2026.
14. 69% of surveyed organizations discovered vulnerabilities introduced by AI-generated code
Aikido Security's 2026 report found that 69% of organizations surveyed had identified vulnerabilities introduced by AI-generated code. The research gathered responses from 450 security leaders, developers and application security engineers across Europe and the US.
15. One in five surveyed organizations experienced a serious security incident linked to AI-generated code
Aikido Security's survey found in 2026 that one in five participating organizations had experienced a serious incident associated with AI-generated code. The result describes reported experiences among the surveyed organizations rather than an incident rate for all businesses.
16. 29% of surveyed security leaders identified insecure coding patterns as the leading risk
Salt Security's May survey found in 2026 that 29% of 100 IT security leaders identified insecure coding patterns as the main risk introduced by AI coding assistants. The result measures respondents' concerns rather than the frequency of specific vulnerabilities.
How are teams reviewing AI-generated code?
Salt Security's 2026 research found continued reliance on manual code review. The Linux Foundation's November 2026 findings suggest that teams also need to match their review capacity to the pace of development.
17. 38% of surveyed security leaders relied primarily on manual code review
Salt Security's 2026 research found that 38% of surveyed IT security leaders relied mainly on manual review for AI-generated code. Censuswide conducted the survey among leaders in the UK and US in May 2026.
Donald Lee Service, a Florida audio repair shop, built its back office with Hercules. Its case study records over 1,100 revisions to the software. The case study does not measure the security of those changes.
18. 58% of surveyed organizations released code faster than security reviews could keep up
The Linux Foundation's November 2026 report found that 58% of surveyed organizations were releasing code faster than reviewers could assess it. The finding reflects reported development and review practices among security practitioners.
MMA Plumbing, a Dutch home services business, built its operating system with Hercules. Its published case study reports €250k saved compared with development agency quotes. Budget separately for specialist review.
19. 82% of respondents believed excessive AI use weakened developers' security skills
The Linux Foundation's November 2026 survey found that 82% of 196 respondents agreed that overreliance on AI weakened software developers' security skills. The question measured practitioners' opinions rather than observed changes in developers' abilities.
20. Only 21% of respondents believed AI would eventually write secure code without human oversight
Aikido Security's 2026 research found that 21% of respondents believed AI would eventually produce secure code without human oversight. The finding represents expectations among surveyed practitioners rather than a measured limit on future AI capabilities.
Where do these numbers come from?
The statistics come from research published between 2025 and 2026. Each finding measures generated code, software dependencies, reported incidents or the review practices surrounding AI-assisted development.
The research includes controlled tests, public code repository analysis, academic studies and practitioner surveys. The Veracode, Salt Security and Aikido Security findings come from companies that sell security software.
Two academic studies are preprints and may change following further review. The surveys include technical practitioners from different regions, with Salt Security's sample limited to the UK and US and Aikido Security's covering Europe and the US.
The Linux Foundation's survey methodology reports 308 qualified respondents overall, with participation varying by question. None of these studies establishes a universal vulnerability rate for complete business applications.
Where does Hercules fit?
Hercules is an AI app builder for business that lets you create internal tools and business applications through conversation. The Hercules Version Control feature records app changes and lets you return to a previous version.
If you lack the technical expertise to assess an application your business depends on, include the cost of a qualified independent reviewer in your development budget.
What to do next?
Choose one internal workflow you want to improve and define the tests it must pass before your team uses it. Assign someone responsibility for checking significant changes and budget for specialist review where needed.
Compare Hercules pricing with your total development and maintenance budget before building your first workflow.
Frequently asked questions
What percentage of AI-generated code contains security vulnerabilities?
There's no single percentage that applies to every AI-generated application. Veracode's controlled benchmark measures individual coding tasks, while repository studies examine existing code. Use both kinds of evidence to plan reviews without treating either as an app-wide defect rate.
Is AI-generated code less secure than human-written code?
The answer depends on the code and how researchers measure vulnerabilities. Belozerov and colleagues identified security problems in both AI-generated and developer-supplied code in their 2026 study. Apply the same review requirements to software changes regardless of who produces them.
What are the most common security risks in AI-generated code?
Veracode's October 2026 benchmark identifies cross-site scripting and log injection as particularly difficult tasks for AI models. Ask your reviewer to examine how the app processes input, generates database queries and records activity.
How can businesses check AI-generated code for vulnerabilities?
Arrange automated code scanning and independent technical review before publishing important changes. The Linux Foundation's policy recommendations also recommend reviewing new external software dependencies. Retest affected workflows after fixing any identified problems.
Can AI detect and fix vulnerabilities in its own code?
The 2026 research by Belozerov and colleagues found that AI models could detect and repair many confirmed vulnerabilities, though some problems remained unresolved. Have a qualified reviewer verify proposed fixes before publishing them.