Google DeepMind Unveils CodeMender: AI That Patches and Secures Vulnerable Code

In a major step toward AI-driven cybersecurity, Google DeepMind has unveiled CodeMender — an artificial intelligence (AI) agent that automatically detects, patches, and rewrites vulnerable code to prevent future exploits.

Security News 2 min read

Google DeepMind Unveils CodeMender: AI That Patches and Secures Vulnerable Code

In a major step toward AI-driven cybersecurity, Google DeepMind has unveiled CodeMender — an artificial intelligence (AI) agent that automatically detects, patches, and rewrites vulnerable code to prevent future exploits.

What Is CodeMender?

According to DeepMind researchers Raluca Ada Popa and Four Flynn, CodeMender’s AI agent is designed to be both reactive and proactive:

  • Reactive: Instantly patches newly detected vulnerabilities.
  • Proactive: Rewrites existing codebases to eliminate entire classes of security flaws.

“By automatically creating and applying high-quality security patches, CodeMender helps developers and maintainers focus on what they do best — building good software,” DeepMind said.

In just six months of development, 72 security fixes have already been upstreamed to major open-source projects — including those with millions of lines of code.

How It Works

Under the hood, CodeMender uses Google’s Gemini Deep Think models to:

  • Detect and debug code vulnerabilities.
  • Identify the root cause of each issue.
  • Generate and apply fixes automatically.
  • Validate patches through a large language model (LLM)-based critique tool that compares original and modified code to prevent regressions.

The AI can even self-correct its patches when inconsistencies or side effects are detected.

Collaboration With Developers

Google plans to collaborate directly with open-source maintainers, offering CodeMender-generated patches and collecting feedback to refine the system for wide-scale use.

This initiative complements Google’s ongoing efforts in AI-powered vulnerability discovery, including OSS-Fuzz and Big Sleep, as well as its Secure AI Framework (SAIF) — a set of principles for securing AI systems.

AI Vulnerability Reward Program (AI VRP)

Google also announced an AI Vulnerability Reward Program that rewards security researchers for finding AI-specific flaws — such as prompt injections, jailbreaks, and model misalignment — with payouts of up to $30,000.

The Bigger Picture

CodeMender marks a turning point in how AI can be used to defend, not just attack.
By automatically repairing and rewriting vulnerable code, tools like CodeMender could transform software maintenance, giving defenders a long-awaited edge over cybercriminals and state-sponsored attackers.


Blog

Security 4 min read

FortiMail Gateway Zero-Day Under Active Exploitation

Fortinet has warned customers that a critical zero-day vulnerability in FortiMail is being actively exploited in the wild, putting internet-exposed email security gateways at immediate risk.

AI 5 min read

MI5 Warns of CGTRI Front Linked to Chinese Intelligence

The U.K.’s domestic security service, MI5, has issued an unusually direct public warning about the China General Technology Research Institute (CGTRI), alleging that the research body has strong links to China’s Ministry of State…