{"id":102252,"date":"2025-06-13T19:38:46","date_gmt":"2025-06-13T17:38:46","guid":{"rendered":"https:\/\/staging.checkmarx.com\/?post_type=learn&#038;p=102252"},"modified":"2026-04-10T18:54:23","modified_gmt":"2026-04-10T16:54:23","slug":"why-ai-generated-code-may-be-less-secure-and-how-to-protect-it","status":"publish","type":"learn","link":"https:\/\/checkmarx.com\/learn\/ai-security\/why-ai-generated-code-may-be-less-secure-and-how-to-protect-it\/","title":{"rendered":"Why AI-Generated Code May Be Less Secure \u2013 and How to Protect It"},"content":{"rendered":"<p>Securing the software supply chain was tough enough when the proliferation of publicly available third-party libraries, modules, and packages made it all too easy for developers to import code that <a href=\"https:\/\/checkmarx.com\/blog\/code-exposure-vulnerabilities-in-your-code\/\">may be insecure<\/a> into applications.<\/p>\n\n\n\n<p>Now, the advent of generative AI coding tools has added another major challenge. Code generated by AI is essentially third-party code that, like other forms of external code (such as code from open-source repositories), could introduce security vulnerabilities and risks into a business.<\/p>\n\n\n\n<p>Hence, the need to add AI risk management protections to traditional application security testing procedures. Read on for guidance as we explain why and how businesses can mitigate the security risks of artificial intelligence coding tools.<\/p>\n\n\n\n<h2 class=\"wp-block-heading article-anchor\" id=\"article-anchor-1\">The ubiquity of AI-generated code<\/h2>\n\n\n\n<p>Ever since GitHub Copilot \u2013 the first AI-powered coding solution to go mainstream \u2013 was introduced in 2021, using AI for coding has become a commonplace practice among software developers. As Stack Overflow reported based on a 2024 developer survey, 76 percent of coders now employ AI to help write software. Even at large enterprises known for hiring talented developers, AI-generated code has gone mainstream. At Microsoft, for example, 30 percent of code is now written by AI, according to CEO Satya Nadella.<\/p>\n\n\n\n<p>This means that, like it or not, significant portions of the code within modern applications originate from AI tools. The amount of AI-generated code is likely only to grow as the sophistication of AI-assisted development tools increases.<\/p>\n\n\n\n<p>In many respects, this is a good thing. From a productivity standpoint, AI-generated code has much to offer because it can significantly reduce the time it takes developers to write and test software. Back in 2023 (when AI-assisted coding tools and integrations were not as mature as they are today), McKinsey concluded that AI can speed up total coding time by as much as 45 percent.<\/p>\n\n\n\n<p>There is also evidence that AI can improve the <a href=\"https:\/\/checkmarx.com\/blog\/the-buzz-around-developer-experience-unlocking-the-potential-of-superior-devex-with-codebashing-2-0\/\">developer experience<\/a>. 75 percent of coders report feeling more \u201cfulfilled\u201d when they use AI, presumably because AI can help automate tedious tasks like generating repetitive boilerplate code.<\/p>\n\n\n<section class=\"section-block-info light-theme\">\n    <div class=\"main-wrapper block-info__wrapper\">\n        <div class=\"block-info center\">\n\t\t\t\n\t\t\t<h2 class=\"section-title article-anchor\" id=\"article-anchor-2\">Don\u2019t Just Find Vulnerabilities\u2014Understand Them<\/h2>\t\t\t<p class=\"section-description\">Knowing your code is exposed is only half the battle. Learn how Checkmarx helps you identify, categorize, and prioritize code exposure risks before they reach production.<\/p>\n\t\t\t<div class=\"actions\">\n\t\t\t\t        <a href=\"https:\/\/checkmarx.com\/blog\/code-exposure-vulnerabilities-in-your-code\/\" class=\"btn btn-2 btn-bg white demo\">Explore code security best practices<\/a>\n        \t\t\t\t\t\t\t<\/div>\n        <\/div>\n    <\/div>\n<\/section>\n\n\n<h2 class=\"wp-block-heading article-anchor\" id=\"article-anchor-3\">How secure is AI-generated code?<\/h2>\n\n\n\n<p>From a security perspective, however, AI-generated code presents some potentially serious risks. Code produced by AI tools can contain multiple types of vulnerabilities and risks, such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Lack of proper input validation, leading potentially to <a href=\"https:\/\/checkmarx.com\/learn\/application-security\/sql-injection\/\">injection attacks<\/a>.<\/li>\n\n\n\n<li>Memory management problems, which threat actors could exploit to launch buffer overflow attacks.<\/li>\n\n\n\n<li>Insecure dependencies, which could lead to <a href=\"https:\/\/checkmarx.com\/learn\/supply-chain-security\/software-supply-chain-security-guide\/\">software supply chain<\/a> risks.<\/li>\n\n\n\n<li>\n<a href=\"https:\/\/checkmarx.com\/blog\/exposed-secrets-and-how-to-prevent-them\/\">Insecure management of secrets<\/a> (such as passwords, access keys, and tokens) that applications use to connect to other applications, databases, and so on.<\/li>\n<\/ul>\n\n\n\n<p>To be sure, these security shortcomings may be present in code written by humans, too. However, from a security perspective, there are several key distinctions between human-generated code and AI-generated code that can make security problems in the latter more common or severe.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">#1. Lack of review<\/h3>\n\n\n\n<p>Code written by a human receives careful consideration and analysis as the coder writes it. In contrast, there is no guarantee that a human will analyze, or think in any detail about, AI-generated code. If the code runs \u2013 as it often does \u2013 developers can blindly integrate it into their applications without checking whether it includes risks like insecure dependencies or memory management oversights.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">#2. Lack of contextual awareness<\/h3>\n\n\n\n<p>Most AI coding tools have limited understanding of contextual factors that could influence security best practices. This makes it harder for them to adhere to security best practices, especially those that are specific to a particular organization.<\/p>\n\n\n\n<p>For example, a human developer might know which types of data input an application should accept based on the role that the application plays in the business. An AI tool would have no way of knowing this because it doesn\u2019t know how the business works. All AI knows how to do is generate code. As a result, the AI tool would not be able to write input validation code as reliably as a human.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">#3. Inefficiency of fixing security mistakes<\/h3>\n\n\n\n<p>If a human makes a security mistake when writing code and catches the issue quickly, developers can resolve the issue without much difficulty. But in workflows where developers generate code using AI and then commit it to a repository without security testing or analysis, they may miss critical security issues until later in the <a href=\"https:\/\/checkmarx.com\/learn\/devsecops\/a-secure-sdlc-with-static-source-code-analysis-tools\/\">software development lifecycle (SDLC)<\/a>.<\/p>\n\n\n\n<p>This is a problem because the longer an issue persists within the SDLC, the more time and effort it typically requires on the part of developers to fix the problem. They may have to update other code that depends on or integrates with the insecure code as well as mitigate the insecure code itself. Overall, <a href=\"https:\/\/devops.com\/survey-ai-tools-are-increasing-amount-of-bad-code-needing-to-be-fixed\/\">68 percent<\/a> of developers say that they are now spending more time resolving security vulnerabilities than they did prior to using AI-generated code.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">#4. Hallucination risks<\/h3>\n\n\n\n<p>Generative AI tools can \u201challucinate,\u201d meaning they produce information that is inaccurate. This flaw may lead to security risks like <a href=\"https:\/\/www.darkreading.com\/application-security\/ai-code-tools-widely-hallucinate-packages\">package hallucination<\/a>, which occurs when AI code refers to packages or other dependencies that don\u2019t actually exist. If threat actors are able to plant packages containing malicious code in public repositories and assign names that match those of the hallucinated packages, applications that refer to the packages could end up downloading and executing malicious software.<\/p>\n\n\n\n<p>In some respects, these types of attacks are a variation on <a href=\"https:\/\/checkmarx.com\/blog\/a-new-stealthier-type-of-typosquatting-attack-spotted-targeting-npm\/\">typosquatting<\/a>, a method threat actors have long used to take advantage of mistakes made by developers when writing out package names or repository URLs. But AI opens the door to new types of attacks in this vein \u2013 and ones that are harder to detect because, unlike package names that contain typos, hallucinated package names often look legitimate.<\/p>\n\n\n<script src=\"https:\/\/player.vimeo.com\/api\/player.js\"><\/script>\n<script src=\"https:\/\/www.youtube.com\/iframe_api\"><\/script>\n<div class=\"aticle-video-wrapper\">\n    <p class=\"section-description-top\">Watch now<\/p>    <h3>AI Security Champion: Automatic Remediation For Devs<\/h3>\n    <div class=\"aticle-video-box\">\n                    <iframe width=\"913\" height=\"514\" src=\"https:\/\/www.youtube.com\/embed\/tmZN7k0cdPM?enablejsapi=1\" class=\"youtube-player\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n                <\/div>\n    <p>Find out how Checkmarx is using AI to its full potential by providing advanced application security throughout the SDLC. <\/p>\n            <a href=\"https:\/\/www.youtube.com\/watch?v=tmZN7k0cdPM\" class=\"btn btn-2 btn-bg accent demo\">Watch now<\/a>\n        <\/div>\n<script>\n    \/\/ For youtube video only\n    var playerReady = false;\n    var player;\n\n    function onYouTubeIframeAPIReady() {\n        const iframe = document.querySelector('iframe.youtube-player');\n        if (!iframe) {\n            console.warn('Youtube player not found');\n            return;\n        }\n\n        player = new YT.Player(iframe, {\n            events: {\n                onReady: () => {\n                    playerReady = true;\n                }\n            }\n        });\n    }\n\n\n    document.addEventListener('DOMContentLoaded', () => {\n        let videoBtn = document.querySelector('.youtube-overlay-image-link');\n\n        if (!videoBtn) return;\n\n\n        videoBtn.addEventListener('click', (e) => {\n            e.preventDefault();\n            videoBtn.style.display = 'none';\n\n            if (!player || !playerReady) {\n                console.warn('The player isn\\'t ready yet');\n                return;\n            }\n\n            player.playVideo();\n\n        })\n    })\n<\/script>\n\n\n<h2 class=\"wp-block-heading article-anchor\" id=\"article-anchor-4\">Testing AI-generated code for security flaws<\/h2>\n\n\n\n<p>While AI introduces novel types of security challenges, the good news is that developers and DevSecOps teams don\u2019t need fundamentally new types of security solutions for AI risk management. In general, the same types of security testing tools and techniques that help to protect traditional code can secure AI-generated code as well.<\/p>\n\n\n\n<p>Specifically, businesses should deploy the following types of tests for AI-generated code:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\n<strong>Software Composition Analysis (SCA) scanners<\/strong>, which can detect insecure dependencies and software supply chain security risks. Ideally, SCA tools used to test AI-generated code will be able to detect risks like hallucinated packages in addition to more traditional types of third-party code risks (like an external library subject to known vulnerabilities).&nbsp;<\/li>\n\n\n\n<li>\n<strong>Static Application Security Testing (SAST) tools,<\/strong> which check source code and executable files for flaws like injection and buffer overflow vulnerabilities. Emphasize scanners that start by scanning code in real time, before the first commit. This \u201cextreme shift left\u201d provides immediate feedback when code (whether human or AI-created) introduces potential security risks, before commit and running a complete SAST scan.<\/li>\n\n\n\n<li>\n<strong>Dynamic Application Security Testing (DAST) scanners<\/strong>, which evaluate running applications for security risks.<\/li>\n<\/ul>\n\n\n\n<p>Because no single type of security testing tool can guarantee protection against all types of risks, it\u2019s a best practice to deploy each of these types of testing solutions, preferably as a part of a unified platform that can correlate risk across the different tools and provide a single, unified view of risk. This is true of traditional, human-written code, but it\u2019s all the more important for AI-generated code, since the latter may not undergo thorough review by developers prior to being committed to a repository or compiled into an executable.<\/p>\n\n\n\n<h2 class=\"wp-block-heading article-anchor\" id=\"article-anchor-5\">Adding AI security to application security testing with Checkmarx One<\/h2>\n\n\n\n<p>As a comprehensive application security solution, Checkmarx One delivers all of the key capabilities \u2013 including <a href=\"https:\/\/checkmarx.com\/cxsca-open-source-scanning\/\">SCA<\/a>, <a href=\"https:\/\/checkmarx.com\/cxsast-source-code-scanning\/\">SAST<\/a>, and <a href=\"https:\/\/checkmarx.com\/checkmarx-dast\/\">DAST<\/a> businesses need to secure their code no matter who or what writes it. Learn more by <a href=\"https:\/\/checkmarx.com\/request-a-demo\/\">requesting a demo<\/a>.<\/p>\n\n\n<section class=\"section-block-info light-theme\">\n    <div class=\"main-wrapper block-info__wrapper\">\n        <div class=\"block-info center\">\n\t\t\t\n\t\t\t<h2 class=\"section-title article-anchor\" id=\"article-anchor-6\">Ready to Secure Your Code at the Source?<\/h2>\t\t\t<p class=\"section-description\">See how Checkmarx empowers your team to detect code exposure vulnerabilities early\u2014before they become real-world exploits.<\/p>\n\t\t\t<div class=\"actions\">\n\t\t\t\t        <a href=\"https:\/\/checkmarx.com\/request-a-demo\/\" class=\"btn btn-2 btn-bg white demo\">Request a Demo<\/a>\n        \t\t\t\t\t\t\t<\/div>\n        <\/div>\n    <\/div>\n<\/section>","protected":false},"author":84,"featured_media":102253,"parent":0,"menu_order":0,"template":"","meta":{"_acf_changed":true,"footnotes":""},"learn-cat":[1276],"class_list":["post-102252","learn","type-learn","status-publish","has-post-thumbnail","hentry","learn-cat-ai-security"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Why AI-Generated Code May Be Less Secure \u2013 and How to Protect It<\/title>\n<meta name=\"description\" content=\"Learn how AI-generated code could introduce security vulnerabilities and risks into a business, and can be done to secure it.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/checkmarx.com\/learn\/ai-security\/why-ai-generated-code-may-be-less-secure-and-how-to-protect-it\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Why AI-Generated Code May Be Less Secure \u2013 and How to Protect It\" \/>\n<meta property=\"og:description\" content=\"Learn how AI-generated code could introduce security vulnerabilities and risks into a business, and can be done to secure it.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/checkmarx.com\/learn\/ai-security\/why-ai-generated-code-may-be-less-secure-and-how-to-protect-it\/\" \/>\n<meta property=\"og:site_name\" content=\"Checkmarx\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Checkmarx.Source.Code.Analysis\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-10T16:54:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/checkmarx.com\/wp-content\/uploads\/2025\/06\/Testing-the-Testers_-How-to-Secure-GenAI-Powered-Code-Suggestions-scaled.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1381\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@checkmarx\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/checkmarx.com\/learn\/ai-security\/why-ai-generated-code-may-be-less-secure-and-how-to-protect-it\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/checkmarx.com\/learn\/ai-security\/why-ai-generated-code-may-be-less-secure-and-how-to-protect-it\/\"},\"author\":{\"name\":\"Avi Hein\",\"@id\":\"https:\/\/checkmarx.com\/#\/schema\/person\/3546917fa0246ce4d997275a745acd79\"},\"headline\":\"Why AI-Generated Code May Be Less Secure \u2013 and How to Protect It\",\"datePublished\":\"2025-06-13T17:38:46+00:00\",\"dateModified\":\"2026-04-10T16:54:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/checkmarx.com\/learn\/ai-security\/why-ai-generated-code-may-be-less-secure-and-how-to-protect-it\/\"},\"wordCount\":1280,\"publisher\":{\"@id\":\"https:\/\/checkmarx.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/checkmarx.com\/learn\/ai-security\/why-ai-generated-code-may-be-less-secure-and-how-to-protect-it\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/checkmarx.com\/wp-content\/uploads\/2025\/06\/Testing-the-Testers_-How-to-Secure-GenAI-Powered-Code-Suggestions-scaled.webp\",\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/checkmarx.com\/learn\/ai-security\/why-ai-generated-code-may-be-less-secure-and-how-to-protect-it\/\",\"url\":\"https:\/\/checkmarx.com\/learn\/ai-security\/why-ai-generated-code-may-be-less-secure-and-how-to-protect-it\/\",\"name\":\"Why AI-Generated Code May Be Less Secure \u2013 and How to Protect It\",\"isPartOf\":{\"@id\":\"https:\/\/checkmarx.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/checkmarx.com\/learn\/ai-security\/why-ai-generated-code-may-be-less-secure-and-how-to-protect-it\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/checkmarx.com\/learn\/ai-security\/why-ai-generated-code-may-be-less-secure-and-how-to-protect-it\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/checkmarx.com\/wp-content\/uploads\/2025\/06\/Testing-the-Testers_-How-to-Secure-GenAI-Powered-Code-Suggestions-scaled.webp\",\"datePublished\":\"2025-06-13T17:38:46+00:00\",\"dateModified\":\"2026-04-10T16:54:23+00:00\",\"description\":\"Learn how AI-generated code could introduce security vulnerabilities and risks into a business, and can be done to secure it.\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/checkmarx.com\/learn\/ai-security\/why-ai-generated-code-may-be-less-secure-and-how-to-protect-it\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/checkmarx.com\/learn\/ai-security\/why-ai-generated-code-may-be-less-secure-and-how-to-protect-it\/#primaryimage\",\"url\":\"https:\/\/checkmarx.com\/wp-content\/uploads\/2025\/06\/Testing-the-Testers_-How-to-Secure-GenAI-Powered-Code-Suggestions-scaled.webp\",\"contentUrl\":\"https:\/\/checkmarx.com\/wp-content\/uploads\/2025\/06\/Testing-the-Testers_-How-to-Secure-GenAI-Powered-Code-Suggestions-scaled.webp\",\"width\":2560,\"height\":1381,\"caption\":\"Application security testing for AI-generated code highlighting AI risk management and the security risks of artificial intelligence in modern development pipelines.\"},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/checkmarx.com\/#website\",\"url\":\"https:\/\/checkmarx.com\/\",\"name\":\"Checkmarx\",\"description\":\"The world runs on code. We secure it.\",\"publisher\":{\"@id\":\"https:\/\/checkmarx.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/checkmarx.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/checkmarx.com\/#organization\",\"name\":\"Checkmarx\",\"url\":\"https:\/\/checkmarx.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/checkmarx.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/checkmarx.com\/wp-content\/uploads\/2024\/02\/logo-dark.svg\",\"contentUrl\":\"https:\/\/checkmarx.com\/wp-content\/uploads\/2024\/02\/logo-dark.svg\",\"width\":1,\"height\":1,\"caption\":\"Checkmarx\"},\"image\":{\"@id\":\"https:\/\/checkmarx.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/Checkmarx.Source.Code.Analysis\",\"https:\/\/x.com\/checkmarx\",\"https:\/\/www.youtube.com\/user\/CheckmarxResearchLab\",\"https:\/\/www.linkedin.com\/company\/checkmarx\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/checkmarx.com\/#\/schema\/person\/3546917fa0246ce4d997275a745acd79\",\"name\":\"Avi Hein\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/checkmarx.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/checkmarx.com\/wp-content\/uploads\/2024\/06\/avatar_84.png\",\"contentUrl\":\"https:\/\/checkmarx.com\/wp-content\/uploads\/2024\/06\/avatar_84.png\",\"caption\":\"Avi Hein\"},\"url\":\"https:\/\/checkmarx.com\/author\/avihein\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Why AI-Generated Code May Be Less Secure \u2013 and How to Protect It","description":"Learn how AI-generated code could introduce security vulnerabilities and risks into a business, and can be done to secure it.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/checkmarx.com\/learn\/ai-security\/why-ai-generated-code-may-be-less-secure-and-how-to-protect-it\/","og_locale":"en_US","og_type":"article","og_title":"Why AI-Generated Code May Be Less Secure \u2013 and How to Protect It","og_description":"Learn how AI-generated code could introduce security vulnerabilities and risks into a business, and can be done to secure it.","og_url":"https:\/\/checkmarx.com\/learn\/ai-security\/why-ai-generated-code-may-be-less-secure-and-how-to-protect-it\/","og_site_name":"Checkmarx","article_publisher":"https:\/\/www.facebook.com\/Checkmarx.Source.Code.Analysis","article_modified_time":"2026-04-10T16:54:23+00:00","og_image":[{"width":2560,"height":1381,"url":"https:\/\/checkmarx.com\/wp-content\/uploads\/2025\/06\/Testing-the-Testers_-How-to-Secure-GenAI-Powered-Code-Suggestions-scaled.webp","type":"image\/webp"}],"twitter_card":"summary_large_image","twitter_site":"@checkmarx","twitter_misc":{"Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/checkmarx.com\/learn\/ai-security\/why-ai-generated-code-may-be-less-secure-and-how-to-protect-it\/#article","isPartOf":{"@id":"https:\/\/checkmarx.com\/learn\/ai-security\/why-ai-generated-code-may-be-less-secure-and-how-to-protect-it\/"},"author":{"name":"Avi Hein","@id":"https:\/\/checkmarx.com\/#\/schema\/person\/3546917fa0246ce4d997275a745acd79"},"headline":"Why AI-Generated Code May Be Less Secure \u2013 and How to Protect It","datePublished":"2025-06-13T17:38:46+00:00","dateModified":"2026-04-10T16:54:23+00:00","mainEntityOfPage":{"@id":"https:\/\/checkmarx.com\/learn\/ai-security\/why-ai-generated-code-may-be-less-secure-and-how-to-protect-it\/"},"wordCount":1280,"publisher":{"@id":"https:\/\/checkmarx.com\/#organization"},"image":{"@id":"https:\/\/checkmarx.com\/learn\/ai-security\/why-ai-generated-code-may-be-less-secure-and-how-to-protect-it\/#primaryimage"},"thumbnailUrl":"https:\/\/checkmarx.com\/wp-content\/uploads\/2025\/06\/Testing-the-Testers_-How-to-Secure-GenAI-Powered-Code-Suggestions-scaled.webp","inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/checkmarx.com\/learn\/ai-security\/why-ai-generated-code-may-be-less-secure-and-how-to-protect-it\/","url":"https:\/\/checkmarx.com\/learn\/ai-security\/why-ai-generated-code-may-be-less-secure-and-how-to-protect-it\/","name":"Why AI-Generated Code May Be Less Secure \u2013 and How to Protect It","isPartOf":{"@id":"https:\/\/checkmarx.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/checkmarx.com\/learn\/ai-security\/why-ai-generated-code-may-be-less-secure-and-how-to-protect-it\/#primaryimage"},"image":{"@id":"https:\/\/checkmarx.com\/learn\/ai-security\/why-ai-generated-code-may-be-less-secure-and-how-to-protect-it\/#primaryimage"},"thumbnailUrl":"https:\/\/checkmarx.com\/wp-content\/uploads\/2025\/06\/Testing-the-Testers_-How-to-Secure-GenAI-Powered-Code-Suggestions-scaled.webp","datePublished":"2025-06-13T17:38:46+00:00","dateModified":"2026-04-10T16:54:23+00:00","description":"Learn how AI-generated code could introduce security vulnerabilities and risks into a business, and can be done to secure it.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/checkmarx.com\/learn\/ai-security\/why-ai-generated-code-may-be-less-secure-and-how-to-protect-it\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/checkmarx.com\/learn\/ai-security\/why-ai-generated-code-may-be-less-secure-and-how-to-protect-it\/#primaryimage","url":"https:\/\/checkmarx.com\/wp-content\/uploads\/2025\/06\/Testing-the-Testers_-How-to-Secure-GenAI-Powered-Code-Suggestions-scaled.webp","contentUrl":"https:\/\/checkmarx.com\/wp-content\/uploads\/2025\/06\/Testing-the-Testers_-How-to-Secure-GenAI-Powered-Code-Suggestions-scaled.webp","width":2560,"height":1381,"caption":"Application security testing for AI-generated code highlighting AI risk management and the security risks of artificial intelligence in modern development pipelines."},{"@type":"WebSite","@id":"https:\/\/checkmarx.com\/#website","url":"https:\/\/checkmarx.com\/","name":"Checkmarx","description":"The world runs on code. We secure it.","publisher":{"@id":"https:\/\/checkmarx.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/checkmarx.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/checkmarx.com\/#organization","name":"Checkmarx","url":"https:\/\/checkmarx.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/checkmarx.com\/#\/schema\/logo\/image\/","url":"https:\/\/checkmarx.com\/wp-content\/uploads\/2024\/02\/logo-dark.svg","contentUrl":"https:\/\/checkmarx.com\/wp-content\/uploads\/2024\/02\/logo-dark.svg","width":1,"height":1,"caption":"Checkmarx"},"image":{"@id":"https:\/\/checkmarx.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Checkmarx.Source.Code.Analysis","https:\/\/x.com\/checkmarx","https:\/\/www.youtube.com\/user\/CheckmarxResearchLab","https:\/\/www.linkedin.com\/company\/checkmarx"]},{"@type":"Person","@id":"https:\/\/checkmarx.com\/#\/schema\/person\/3546917fa0246ce4d997275a745acd79","name":"Avi Hein","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/checkmarx.com\/#\/schema\/person\/image\/","url":"https:\/\/checkmarx.com\/wp-content\/uploads\/2024\/06\/avatar_84.png","contentUrl":"https:\/\/checkmarx.com\/wp-content\/uploads\/2024\/06\/avatar_84.png","caption":"Avi Hein"},"url":"https:\/\/checkmarx.com\/author\/avihein\/"}]}},"_links":{"self":[{"href":"https:\/\/checkmarx.com\/wp-json\/wp\/v2\/learn\/102252","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/checkmarx.com\/wp-json\/wp\/v2\/learn"}],"about":[{"href":"https:\/\/checkmarx.com\/wp-json\/wp\/v2\/types\/learn"}],"author":[{"embeddable":true,"href":"https:\/\/checkmarx.com\/wp-json\/wp\/v2\/users\/84"}],"version-history":[{"count":0,"href":"https:\/\/checkmarx.com\/wp-json\/wp\/v2\/learn\/102252\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/checkmarx.com\/wp-json\/wp\/v2\/media\/102253"}],"wp:attachment":[{"href":"https:\/\/checkmarx.com\/wp-json\/wp\/v2\/media?parent=102252"}],"wp:term":[{"taxonomy":"learn-cat","embeddable":true,"href":"https:\/\/checkmarx.com\/wp-json\/wp\/v2\/learn-cat?post=102252"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}