AI News
AI News AgentToolingDeepMind3 min read

Google introduces CodeMender to protect code

Google DeepMind has introduced CodeMender, an AI agent that detects and fixes software vulnerabilities. In six months, it submitted 72 patches to open-source projects, although every patch still undergoes human review.

Google DeepMind has introduced CodeMender, an artificial intelligence agent that detects and fixes security vulnerabilities in code. During its first six months of development, the system generated 72 patches submitted to open-source projects, including some with up to 4.5 million lines of code.

The tool is designed to work on two fronts. It can respond to a newly discovered vulnerability while also reviewing older code to replace unsafe structures or functions with more resilient alternatives.

From finding the flaw to fixing it

CodeMender uses Gemini Deep Think models alongside debugging, code search, and automated analysis tools. It does not just point out that a program fails: it tries to determine why the problem occurs and prepares a patch that addresses the original cause.

To verify the result, it combines several techniques, including:

  • Static and dynamic program analysis.
  • Differential testing, fuzzing, and mathematical verifiers.
  • Specialized agents that review the changes.
  • Compilation and automated testing to detect errors or regressions.

Fuzzing involves sending large numbers of unexpected inputs to a program in an attempt to trigger failures. It is useful for finding vulnerabilities, but it does not always explain their origin or produce a solution ready to apply.

In one of the examples shared by Google, a report showed a memory overflow, but the real cause was the incorrect handling of XML elements while parsing a file. The final patch changed only a few lines, although finding the problem required reviewing the program's internal behavior.

It also tries to prevent future attacks

CodeMender can rewrite parts of a project to add security mechanisms proactively. Google tested it on libwebp, a widely used library for processing images, using -fbounds-safety annotations.

These annotations allow the compiler to add bounds checks. This reduces memory overflows, a type of failure that can allow malicious code to execute. Google says a libwebp vulnerability identified as CVE-2023-4863 was used in an attack requiring no user interaction against iOS devices.

According to DeepMind, applying these protections would have prevented that vulnerability and many other overflows in the modified areas from being exploited. The claim applies to the protected code, not to the entire library or to every future flaw.

Humans still have the final say

CodeMender is not fixing software autonomously and without supervision. All of its patches are reviewed by researchers before being submitted to projects, and the maintainers of those libraries decide whether to accept them.

That caution matters because a security patch can also break existing features or introduce new errors. The system tries to prevent this by comparing behavior before and after the change, running tests, and correcting itself when it detects compilation or functional failures.

For you, the most relevant change is not that AI will immediately replace programmers. It is that it could reduce the time needed to keep the software components you use without seeing them secure: libraries, browsers, operating systems, and applications.

CodeMender is still a research project, and Google has not announced an open version for all developers. The company plans to publish more technical results and expand its contact with maintainers of critical projects. The point to watch is whether its patches maintain that quality as they are applied to more code and in less controlled scenarios.

Google introduces CodeMender to protect code | neversleep.ai