Introducing CodeMender: an AI agent for code security
While large language models improve rapidly, mistakes in code security can be costly. CodeMender’s automated validation process ensures that code changes are correct across many dimensions by displaying only high-quality patches for human review that, for example, fix the root cause of the issue, are functionally correct, cause no regressions, and follow style guidelines.
As part of our research, we’ve also developed new techniques and tools that allow CodeMender to reflect on code and validate changes more effectively. This includes:
- Advanced program analysis: We have developed tools based on advanced software analysis that include static analysis, dynamic analysis, differential testing, fuzzing, and SMT solvers. By using these tools to systematically audit code patterns and control data flow and flow, CodeMender can better identify the root causes of security flaws and structural vulnerabilities.
- Multi-agent systems: We have developed special-purpose agents that enable CodeMender to address specific aspects of the underlying problem. For example, CodeMender uses a large language model-based critique tool that highlights differences between original and modified code in order to verify that proposed changes do not introduce regressions, and self-corrects as needed.
Fix vulnerabilities
To effectively patch a vulnerability, and prevent it from occurring again, Code Mender uses a debugger, source code browser, and other tools to identify root causes and place patches. We’ve added two examples of CodeMender patch vulnerabilities in the video below.
Example 1: Identify the root cause of the vulnerability
Below is an excerpt of the proxy logic around the debug root cause generated by CodeMender, after analyzing the output results of the debugger and the code finder.
Although the latest patch in this example only changed a few lines of code, the root cause of the vulnerability was not immediately clear. In this case, the crash report showed a heap buffer overflow, but the actual problem was elsewhere – incorrect stack management of Extensible Markup Language (XML) elements during parsing.
Example 2: The agent is able to generate non-trivial patches
In this example, the CodeMender agent was able to come up with a simple patch that addresses a complex issue with object lifetime.
The agent was not only able to discover the root cause of the vulnerability, but was also able to modify an entire custom system to generate C code within the project.
Don’t miss more hot News like this! AI/" target="_blank" rel="noopener">Click here to discover the latest in AI news!
2025-10-23 23:05:00

