AI-Generated Code: Reliability and Security Challenges Revealed

AI-generated code - AI-Generated Code: Reliability and Security Challenges Revealed

The Rise of AI-Generated Code

AI-generated code is rapidly transforming the software development landscape. Leading tech companies like Google and Microsoft predict that within a few years, the vast majority of new code will be produced with the assistance of AI tools. According to Google, 75% of its new code was created using AI by April 2026, a dramatic increase from just 25% in late 2024. Microsoft’s CTO Kevin Scott anticipates this number could reach as high as 95% in the near future. While this surge in AI-generated code promises significant productivity gains, it also introduces critical questions about reliability, maintainability, and security.

Reliability Concerns: More Errors in AI-Generated Code

Recent studies highlight a growing concern: AI-generated code tends to be more error-prone than code written by humans. Research from CodeRabbit, a platform specializing in AI-powered code reviews, found that pull requests (PRs) containing AI code averaged 10.83 issues per request, compared to just 6.45 issues for human-authored code. This means that AI-generated code is producing approximately 1.7 times more issues. David Loker, CodeRabbit’s director of AI, notes that the volume of PRs has jumped by over 40% in just six months, largely due to the speed at which AI can generate code. However, this increased speed often comes at the cost of code quality, leading to more bugs and complications that need to be resolved.

Organizations eager to harness the productivity benefits of AI must balance these gains with the additional time required to manage and fix errors. Developers may also accept AI-generated code without fully understanding the logic behind certain implementation choices, which can create significant long-term maintenance problems. When issues arise later, the original developer may struggle to understand or fix the code efficiently.

Maintenance Issues and the Prevalence of Code Smells

Another significant challenge with AI-generated code is the rise of “code smells”—subtle issues that do not break the code immediately but make it harder to maintain over time. Sonar, a leader in automated code verification, found that over 90% of problems in code produced by large language models fall into this category. These maintainability issues can accumulate, making the codebase increasingly difficult for developers to work with and for AI systems to interpret accurately.

Anirban Chaterjee, Director of Product Marketing at Sonar, points out that code smells, while not always causing immediate outages or data leaks, significantly hinder readability and maintainability. As more AI-generated code enters production, the risks associated with these subtle flaws increase, especially as developers often lack full trust in the code produced by AI tools.

The Verification Gap: Trust and Oversight Challenges

The rapid proliferation of AI-generated code has created what experts call a “verification gap.” According to Sonar’s research, AI tools are now responsible for 42% of all committed code, with expectations for this to rise to 65% by 2027. Despite this growth, 96% of developers surveyed said they do not fully trust AI-generated code to be functionally correct, and less than half always review the code before committing it. This lack of thorough oversight means that flawed or vulnerable code can easily slip into production environments, compounding maintainability and security concerns.

Jeremy Katz, Sonar’s VP of Code Security, notes that developers face increasing pressure to review and merge large volumes of code quickly, often without the resources or time needed for deep verification. As a result, maintainability issues and security vulnerabilities may go unchecked, presenting significant risks to organizations.

Security Testing in the Age of AI Code

Security teams are also struggling to keep pace with the volume of AI-generated code. Research from ProjectDiscovery reveals that engineering teams are shipping code faster than ever, with about half of that increased speed attributed directly to AI assistance. However, the number of security professionals reviewing the code has not kept up, meaning only about a third of security teams feel they can comfortably manage the risk.

Rishiraj Sharma, CEO of ProjectDiscovery, observes that most security practitioners now spend over half their week validating findings rather than fixing issues. The overwhelming volume of code means that only clear, well-documented vulnerabilities are likely to be addressed, leaving many issues unresolved. Sharma believes that true trust in AI-generated code will come through transparency and the ability to audit and reproduce any findings made by AI systems.

The Future: Human-AI Collaboration

Despite these challenges, experts remain optimistic about the future of AI-generated code. Sharma argues that AI won’t replace security testers but will instead augment their capabilities, handling repetitive tasks while human experts focus on judgment and business context. The combination of AI speed and human insight is expected to help organizations bridge the verification gap and maintain secure, reliable codebases as the industry continues to evolve.


This article is inspired by content from Original Source. It has been rephrased for originality. Images are credited to the original source.

Analyzes how businesses deploy AI at scale across operations, analytics, and automation. Delivers practical insights for CXOs and technology leaders.

Subscribe to our Newsletter