option
Home
News
Google's AI Agent Automatically Rewrites Code to Fix Security Vulnerabilities

Google's AI Agent Automatically Rewrites Code to Fix Security Vulnerabilities

December 1, 2025
117

Google DeepMind has introduced a new AI agent that autonomously identifies and resolves critical security vulnerabilities in software code. Named CodeMender, the system has already delivered 72 security patches to major open-source projects within the past six months.

Detecting and resolving vulnerabilities remains a notoriously difficult and labor-intensive task, even with established automated techniques like fuzzing. Google DeepMind’s previous research, including AI-driven initiatives such as Big Sleep and OSS-Fuzz, has successfully uncovered new zero-day vulnerabilities in well-reviewed codebases. Yet this success introduces a new challenge: as AI accelerates the discovery of flaws, the pressure on developers to address them also grows.

CodeMender was created to address this growing imbalance. It functions as a fully autonomous AI agent that takes a complete approach to securing software. The system operates both reactively—patching newly identified vulnerabilities as they emerge—and proactively—rewriting existing code to eliminate entire classes of security risks before they can be exploited. This enables developers and project maintainers to focus more time on building new features and improving software performance.

The system relies on the sophisticated reasoning abilities of Google’s recent Gemini Deep Think models. This underlying technology helps the agent debug and resolve complex security issues with significant autonomy. CodeMender is also equipped with a suite of tools that allow it to carefully analyze and assess code before making any modifications. It further incorporates a validation phase to ensure proposed fixes are accurate and do not create unexpected issues, often referred to as regressions.

Given the high stakes involved in code security, even as large language models evolve, a single coding error can be extremely costly. CodeMender’s automated validation framework is thus essential. It systematically verifies that each proposed fix addresses the underlying cause of the vulnerability, maintains functional correctness, does not disrupt existing tests, and aligns with the project’s coding conventions. Only patches that meet all of these strict criteria are presented for human review.

To enhance the system's effectiveness, the DeepMind team developed new techniques for the AI agent. CodeMender employs advanced program analysis, drawing on static and dynamic analysis, differential testing, fuzzing, and SMT solvers. These tools help it thoroughly examine code patterns, control flow, and data flow to detect the underlying causes of security flaws and structural weaknesses.

The architecture also relies on a multi-agent setup, where specialized agents handle different aspects of a given problem. For example, one dedicated large language model-based tool analyzes differences between the original code and modified versions. This helps the main agent confirm that its proposed changes do not introduce unwanted side effects, and allows it to adjust its strategy as needed.

In one example scenario, CodeMender resolved a vulnerability involving a heap buffer overflow that was flagged in a crash report. Although the ultimate solution modified only a few lines of code, the root cause was not immediately clear. By employing debugger and code search tools, the agent identified that the actual issue stemmed from incorrect stack management of Extensible Markup Language (XML) elements during parsing, located in a different section of the codebase. In another instance, the agent developed a sophisticated patch for a complex object lifetime issue, adapting a custom C code generation system within the target project.

Beyond responding to known bugs, CodeMender is built to proactively strengthen software against future attacks. The team deployed the agent to add -fbounds-safety annotations to parts of libwebp, a widely used image compression library. These annotations guide the compiler to insert bounds checks into the code, helping prevent attackers from exploiting buffer overflows to run arbitrary code.

This improvement is especially relevant given that a heap buffer overflow in libwebp, documented as CVE-2023-4863, was previously exploited in a zero-click iOS attack. According to DeepMind, if these annotations had been in place at the time, that specific vulnerability—and most other buffer overflows in the annotated sections—would have been rendered unexploitable.

The AI’s proactive repair process involves detailed decision-making. When adding annotations, it can autonomously resolve new compilation errors and test failures that result from its own modifications. If validation uncovers that a change has disrupted functionality, the agent uses that feedback to self-correct and try an alternative solution.

Despite the encouraging initial results, Google DeepMind is proceeding cautiously with deployment, prioritizing reliability. Currently, every patch created by CodeMender is reviewed by human experts before being submitted to open-source projects. The team is incrementally increasing submissions to maintain high standards and systematically integrate feedback from the open-source community.

Looking forward, the researchers plan to connect with maintainers of mission-critical open-source projects and share CodeMender-generated patches. By incorporating community input, they aim to eventually release CodeMender as a publicly available tool for all software developers.

In the coming months, the DeepMind team also intends to publish technical papers and reports detailing their methodology and outcomes. This initiative represents an early step in exploring how AI agents can proactively repair code and fundamentally strengthen software security for everyone.

See also: CAMIA privacy attack reveals what AI models memorise

Interested in learning more about AI and big data from industry experts? Attend the AI & Big Data Expo in Amsterdam, California, or London. This comprehensive event is part of TechEx and runs alongside other top tech events including the Cyber Security Expo. Click here for more information.

AI News is delivered by TechForge Media. Discover other upcoming enterprise technology events and webinars here.

Related article
Ollie bets privacy focus to win AI assistant race Ollie bets privacy focus to win AI assistant race To be genuinely helpful, an AI assistant must understand its user deeply. Ollie, a personal assistant designed for daily life, operates on the premise that this doesn’t require surrendering your data or compromising your privacy.While certain enterpr
How AI LIVE: London Will Explore AI & Industrial Automation How AI LIVE: London Will Explore AI & Industrial Automation The summit will convene C-suite executives from around the globe to address pressing challenges in global industries, ranging from AI-driven disruption to economic volatility.AI LIVE: The London Summit will gather over 2,000 international leaders und
Anthropic Enters AI Legal Tech Market as Competition Intensifies Anthropic Enters AI Legal Tech Market as Competition Intensifies Anthropic unveiled a suite of new chatbot capabilities on Tuesday, aimed at delivering automated support to legal practices. These enhancements expand upon Claude for Legal, the firm-specific platform introduced earlier this year, by adding specializ
Related Special Topic Recommendations
Music composition AI Vocal Demo Tools for Songwriters, Hooks, Toplines, and Multilingual Draft Sessions
AI Vocal Demo Tools for Songwriters, Hooks, Toplines, and Multilingual Draft Sessions

2026 Latest Best AI Vocal Demo Tools for Songwriters, Hook Creators, and Multi-Language Content Teams! XIX.AI has curated a top-rated list of powerful game-changing tools that go through rigorous real-world tests. You’ll find detailed free vs paid comparison data, comprehensive rankings, and must-try options to help you boost writing efficiency and unlock your creative potential. Explore now to discover your perfect tool for all your content needs!

9 tools
xix.ai
Business Best AI Competitive Research Tools for Small Businesses
Best AI Competitive Research Tools for Small Businesses

2026 Latest Best Top-rated AI Competitive Research Tools for Small Businesses! XIX.AI has curated a highly powerful game-changing collection, updated weekly with rigorous real-world tests and detailed rankings. You can find a comprehensive free vs paid comparison to help you identify the must-try tools that boost your productivity and give you a competitive edge. Explore now to discover your perfect tool!

9 tools
xix.ai
Image editing Photoshop AI Retouch Tools for Ecommerce Apparel, Skin Cleanup, and Color Consistency
Photoshop AI Retouch Tools for Ecommerce Apparel, Skin Cleanup, and Color Consistency

2026 Latest Best Photoshop AI retouch tools for ecommerce apparel, skin cleanup, and color consistency! This top-rated curated list features powerful game-changing solutions that help you boost writing efficiency, streamline content creation, and achieve perfect visual results effortlessly. Each tool has undergone real-world tests through weekly updated rankings, complete with free vs paid comparison details. Backed by XIX.AI, it’s the must-try guide for anyone aiming to unlock your AI edge. Explore now!

10 tools
xix.ai
Prompt Best AI Prompt Libraries for ChatGPT Workflows
Best AI Prompt Libraries for ChatGPT Workflows

2026 Latest Best Top-Rated AI Prompt Libraries for optimizing all types of ChatGPT workflows. XIX.AI has curated a powerful, game-changing collection that goes through rigorous real-world tests to ensure top performance. You can find detailed free vs paid comparisons and expert rankings to help you choose the must-try tools that boost your productivity and unlock your AI edge. Explore now!

11 tools
xix.ai
Education and Learning AI Quiz Builder Platforms for Teachers, Tutors, and Cohort-Based Learning Programs
AI Quiz Builder Platforms for Teachers, Tutors, and Cohort-Based Learning Programs

2026 Latest Best AI Quiz Builder Platforms for Teachers, Tutors, and Cohort-Based Learning Programs! XIX.AI has curated a top-rated list of powerful game-changing tools that go through real-world tests to deliver accurate rankings. These must-try platforms help boost writing efficiency, streamline content creation, and simplify quiz design across all learning scenarios. Explore now to discover your perfect tool for unlocking your AI edge in teaching!

13 tools
xix.ai
code AI Pull Request Review Tools for GitHub Teams Handling Refactors, Bugs, and Security Gaps
AI Pull Request Review Tools for GitHub Teams Handling Refactors, Bugs, and Security Gaps

2026 Latest Best AI Pull Request Review Tools for GitHub Teams are here on XIX.AI! This top-rated curated list showcases powerful game-changing solutions that streamline refactoring, bug fixing, and security gap detection across all team workflows. Enjoy a free vs paid comparison along with real-world tests and detailed rankings to help you find the perfect tool that boosts productivity significantly. Explore now to unlock your AI edge!

12 tools
xix.ai
Comments (0)
0/500
OR