AI
New Framework Synthesizes Security Training Data by Injecting Vulnerabilities into Real Code
CyberForge generates verified, reproducible vulnerabilities in C/C++ repositories to help train AI agents that defend against software flaws.
Developing AI agents capable of finding and fixing software vulnerabilities has proven challenging due to the scarcity of realistic, reproducible training data. Researchers have introduced CyberForge, a framework that automatically generates security training datasets by injecting weaknesses into actual open-source C/C++ projects.
The Challenge#
Current LLM-based cybersecurity agents lag behind defensive needs. While these AI systems can help attackers locate exploitable flaws in code, defenders face a much harder task: they must identify and patch every vulnerability across expanding codebases. This asymmetry persists partly because training agents to perform stronger defensive work requires large amounts of verified security data—something historically difficult to obtain.
How CyberForge Works#
The framework injects vulnerabilities directly into real project repositories, then validates each one through dynamic testing. For each injected flaw, the modified code must still pass the project's existing unit tests, and researchers must generate a proof-of-vulnerability (PoV) that confirms the weakness triggers in the modified version but not in the original. This dual-validation approach ensures the training data is both realistic and reliable.
Because CyberForge generates vulnerabilities synthetically rather than relying on publicly disclosed CVE records, it can scale beyond historical vulnerability databases—producing far more training examples than traditional data augmentation methods.
Results and Impact#
The resulting corpus contains 1,034 verified vulnerabilities spanning 80 real-world projects and 63 different weakness categories. The injected flaws exhibit editing patterns similar to actual security patches found in real CVE data. When used to fine-tune AI models, the synthetic training set improved patch-repair performance by 3.3 to 14.7 percentage points across multiple configurations, from smaller to larger model scales. Notably, a 31-billion-parameter student model matched the performance of its larger teacher model (72.7% vs. 74.0%). The improvements also generalized to PatchEval, a separate test corpus covering other programming languages.

