Securing Code in the Era of Agentic AI

AI coding assistants like GitHub Copilot are transforming the way developers write software, boosting productivity, and accelerating development cycles. However, while these tools generate code more efficiently, they also introduce new risks more efficiently—potentially embedding security vulnerabilities that could lead to severe breaches down the line. What is your plan for reducing risk from the vast amount of insecure code coming through agentic AI in software development? 

The Role & Risks of Agentic Workflows in AI Coding Assistants  

At Veracode, we’ve been talking about the risks of AI code generation for years. The rise of agentic AI adds a whole new layer to this risk.  

Agentic workflows in software development, like GitHub Copilot’s recently announced agent mode, where AI agents autonomously complete coding tasks, debugging, and testing cycles, increase the already heightened risks of AI-generated code. These workflows speed development at a massive scale but also introduce security risks that are difficult to see and detect. AI-driven agents often lack contextual awareness of security best practices, leading to: 

  1. Automated decision-making that prioritizes functionality over security. 
  2. Over-reliance on unverified code repositories, increasing third-party risk. 
  3. Persistent vulnerabilities that are perpetuated across iterations of AI-generated code. 

The advancement of AI for software development continues to outpace security controls. Organizations must implement security guardrails that integrate into agentic workflows, ensuring that security checks are part of the automation process. 

The Risks of AI-Generated Code  

Studies have shown that AI-generated code can contain security flaws at a similar or higher much higher rate than manually written code. A study by Stanford University found that 40% of AI-generated code suggestions from GitHub Copilot contained security vulnerabilities. Another report from NYU researchers discovered that AI-assisted code had nearly three times more security flaws than human-written code in certain scenarios.  

Additionally, according to our soon-to-be-released  State of Software Security 2025 report (click here to register for the webinar):  

  1. Since 2020, the average time to fix security flaws has increased by 47%. Teams can’t keep up with the scale of flaws being created. 
  2. Half of organizations have critical security debt, meaning they have unresolved, high-exploitability vulnerabilities lingering for years and that they keep accumulating. 
  3. 70% of this critical security debt stems from third-party code and the software supply chain. Even if your developers aren’t using AI to generate code, the libraries they use likely are. 

These vulnerabilities range from common weaknesses like SQL injection to complex logic errors that can expose applications to exploitation. The speed and efficiency of AI-generated code means that these flaws can proliferate quickly if security is not prioritized. 

Best Practices for Securing AI-Generated Code  

Organizations leveraging AI-powered development should take proactive measures to ensure security, including: 

  1. Automating Security Scanning: Run automated security scans (like Static Analysis) on all code, AI-generated or not, before deployment. 
  2. Manual Code Reviews: AI-generated code should always be reviewed by experienced engineers. 
  3. Third-Party Library Audits: Ensure AI-generated code does not introduce vulnerabilities from unverified third-party components using Software Composition Analysis (SCA).
  4. Embedding Security in Agentic Workflows: Automate security policies to ensure that AI agents enforce secure coding standards. 
  5. Adopting AI-Powered Security Tools: Implement tools like Veracode Fix to automatically remediate security risks in real time. 

Here’s an example of a scenario where these best practices helped: A global financial services company implemented AI-assisted coding in a critical payments platform. Within weeks, internal security scans revealed that over 60% of AI-generated code suggestions contained high-severity vulnerabilities, including SQL injection and authentication bypass flaws. Left unaddressed, these vulnerabilities could have exposed millions of customer records. The company quickly turned to Veracode Fix, which automated flaw remediation and reduced their security exposure by 75% in under three months

Veracode’s Approach: AI-Powered Security for AI-Powered Code  

At Veracode, we believe that security should be embedded into every stage of the software development lifecycle—especially in an era where AI is writing more of the code we rely on. Our approach to securing AI-generated code includes: 

  1. AI-Assisted Flaw Remediation with Veracode Fix  – Veracode Fix leverages AI to remediate vulnerabilities in AI-generated code and suggest secure fixes in real time. By integrating directly into developer workflows, Veracode Fix ensures that all code, especially AI-generated, meets the highest security standards before it is deployed. 
  2. AI-Powered Governance and Compliance – As AI-generated code becomes more prevalent, organizations must implement governance frameworks to maintain compliance with security regulations. Veracode’s security and compliance tools help businesses manage AI-driven development in line with industry standards. 

A Call to Action: Secure AI-Generated Code from the Start  

AI coding assistants and agentic workflows are here to stay, and they will continue to evolve at a rapid pace. Organizations must recognize that security cannot be an afterthought in this transformation to keep risk and security debt under control . By integrating Veracode into their development workflows, teams can confidently harness the power of AI while ensuring that security remains a top priority. 

Want to see how Veracode can help secure your AI-generated code? Request a demo today and ensure your AI-assisted development remains secure from the start. 

To learn more about how Veracode is securing AI-generated code, visit Veracode.com