Skip to main content
Mallory
← Back to News
ai-platform-securityleaked-secret-api-key

Security Risks and Challenges of AI-Generated Code for Developers

Emerging Technology Risk · 2 sources · Updated 5mo ago · First seen Oct 16, 2025

Security Risks and Challenges of AI-Generated Code for Developers

The widespread adoption of generative AI (GenAI) tools in software development has significantly increased productivity, enabling developers to document, write, and optimize code at unprecedented speeds. According to a 2023 McKinsey study, organizations have rapidly integrated AI into their development workflows, with 83% using AI for code creation and 57% relying on AI-powered coding tools as a standard practice. However, this surge in AI-assisted coding has introduced new security risks, as traditional security models focused on perimeter or infrastructure controls do not adequately protect the data and code generated by these tools. Studies have revealed that nearly half of code snippets produced by popular AI models contain vulnerabilities, underscoring the prevalence of insecure code generation. High-profile incidents, such as Samsung's 2023 ban on ChatGPT following a sensitive code leak, highlight the real-world consequences of insufficient safeguards when using GenAI in development environments. The responsibility for securing data and code remains with developers, even as cloud providers secure the underlying infrastructure. The rapid pace of AI-generated code has outstripped the ability of traditional secure coding training to keep up, shifting the focus from training human programmers to ensuring that AI systems themselves are capable of secure coding. Industry experts note that AI is currently less effective at producing secure code than human programmers, with multiple studies and reports from sources like Schneier on Security, Veracode, and SC Media confirming this trend. The volume of vulnerabilities continues to rise, with over 47,000 publicly known vulnerabilities expected in a single year and at least 130 new vulnerabilities reported daily. This ongoing wave of vulnerabilities leads to constant exploitation and patching, further emphasizing the need for secure coding practices at the AI level. While AI has delivered substantial productivity gains—developers report 30% to 40% increases—these benefits are undermined by the security shortcomings of AI-generated code. The industry is now at a crossroads, where the imperative is to teach AI systems to code securely, rather than relying solely on human oversight or post-development security reviews. Integrating security into the AI coding process and providing developers with tools that embed data protection are seen as essential steps to address these emerging challenges. The shift towards AI-driven development necessitates a reevaluation of security strategies, focusing on proactive measures that align with the realities of modern software engineering. Without such changes, organizations risk exposing themselves to significant security threats stemming from the very tools designed to enhance their productivity.

Why it matters

Impact assessment

AI-assisted software development affects organizations that use GenAI coding tools in engineering workflows, especially software vendors, enterprises with internal development teams, and any business handling sensitive source code or regulated data in prompts. The primary impact is increased risk of insecure code introduction and data leakage rather than a single product-specific outage, with potential downstream effects including breaches, compliance exposure, remediation cost, and reputational damage.

Supporting details

  • Affected populations:
    • Developers using AI code assistants for code generation, documentation, and optimization
    • Organizations embedding GenAI into SDLC workflows
    • Teams handling proprietary source code, credentials, customer data, or regulated datasets in AI prompts
  • Severity:
    • Insecure code generation can introduce exploitable vulnerabilities into production software
    • Sensitive data entered into AI tools can be exposed outside intended trust boundaries
    • Business impacts include incident response cost, delayed releases, legal/compliance risk, and loss of intellectual property
  • Scope:
    • Exposure is widespread because the story cites broad enterprise adoption of AI coding tools
    • Risk is systemic across workflows rather than tied to one vendor, CVE, or campaign
  • Known incidents:
    • Samsung reportedly banned ChatGPT in 2023 after a sensitive code leak incident
  • Key extracted facts:
    • 83% of organizations use AI for code creation according to the cited 2023 McKinsey study
    • 57% use AI-powered coding tools as a standard practice
    • A cited November study found nearly half of code snippets from five popular AI models contained vulnerabilities
New surface, new adversariesTrack how attackers are adapting to this technology.
Track this risk
Event timeline

How this story unfolded

Events from the most recent confirmed update back to the earliest known activity.

4 events · Jan 1, 2023 – Oct 16, 2025
  1. Oct 16, 20251y ago

    Security awareness advocates urge training AIs to code securely

    On 2025-10-16, KnowBe4 published guidance emphasizing the need to improve how AI systems generate code so that AI-assisted development does not amplify insecure coding practices.

  2. Oct 16, 20251y ago

    Industry calls for developer-first security in GenAI workflows

    On 2025-10-16, commentary from security practitioners argued that organizations should embed data protection, tokenization, synthetic data, and other controls earlier in the software development lifecycle to secure AI-assisted development.

  3. Oct 16, 20251y ago

    Research finds many AI-generated code snippets contain vulnerabilities

    By October 2025, studies cited in the coverage reported that nearly half of AI-generated code snippets from popular models contained security vulnerabilities, underscoring the need for safer AI-assisted coding practices.

  4. Jan 1, 20234y ago

    Samsung bans ChatGPT after sensitive code leak

    In 2023, Samsung reportedly banned employee use of ChatGPT after sensitive source code was leaked through the service, highlighting data exposure risks from generative AI in development workflows.

Do you run this?Follow how adversaries are adapting to this technology, and where it touches your stack today.
Track This Risk
Mallory platform

See the full picture, correlated to your attack surface.

This page covers what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which threat actors are using it right now, and what to deploy next.

Exposure mappingMap indicators from this story to your assets and identify affected systems in minutes.
Threat actor evidenceEvery observed campaign, victim, and pivot linked to actors named in this story.
Associated malwareMalware, exploits, and IOCs connected to the activity described here.
Detection signaturesYARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.
Scheduled alertsGet matching new stories delivered to your team as they break, not the next morning.
AI threadsAsk questions about this story and take action on the answers.