CyberFactory: Scaling Cyber Security Capabilities with Instances from the Wild

Jian Yang, Haau-Sing Li, Shawn Guo, Zixi Zhao, Yibo Tan, Jiajun Wu, Aishan Liu, Zhoujun Li, Xianglong Liu, Tianyu Zheng, Bryan Dai, Chengran Yang, Weifeng LvarXiv 2026

TL;DR

While closed-source AI models have shown impressive capabilities in cybersecurity, open-source alternatives lag behind due to a lack of reproducible training recipes and scalable, realistic data. This paper introduces CyberFactory, an open-source framework that transforms real-world software vulnerabilities into executable training environments to generate high-quality agentic data. By training on these trajectories, their new model, OpenAegis, internalizes expert-level vulnerability analysis workflows and outperforms much larger general-purpose models on real-world security benchmarks.

What Problem Does This Paper Address?

Large Language Models (LLMs) are increasingly capable of writing and debugging code, making them promising tools for automated cybersecurity defense and vulnerability discovery. However, top-tier security capabilities remain locked behind proprietary, closed-source models.

Existing open-source efforts face three major bottlenecks:

  1. Lack of Reproducibility: Frontier open-weight models do not share their specialized cybersecurity training pipelines.
  2. Fragmented Tasks: Open-source security datasets typically focus on isolated, gamified tasks like Capture-the-Flag (CTF) rather than real-world software vulnerabilities.
  3. Data Scaling Challenges: Generating effective "agentic" data—where a model interacts with a terminal, runs tests, and refines its approach based on feedback—requires strong domain expertise to guide the model through complex, long-horizon tasks without wasting computational budget.

CyberFactory bridges these gaps by providing an end-to-end, open-source pipeline that turns messy, real-world vulnerability data into rigorous, verifiable training trajectories.

Figure 1: CyberFactory turns real-world vulnerability evidence into executable, difficulty-calibrated supervision for training OpenAegis on vulnerability detection, patch generation, and CyberQA.

Methods

The authors developed CyberFactory to unify data construction, trajectory synthesis, and model training across three key tasks: Proof-of-Concept (PoC) exploit generation, vulnerability patching, and cybersecurity question answering (CyberQA).

The core methodology relies on three novel components:

  • Differential Verification: To ensure training data is high quality, CyberFactory validates generated PoCs differentially. A valid PoC must successfully trigger a crash or sanitizer failure in the vulnerable version of the software (pre-patch) but pass cleanly in the fixed version (post-patch).
  • Skill-Guided Trajectory Synthesis: Instead of letting a teacher model (like GLM 5.2) generate random actions, the authors inject a structured, task-independent "vulnerability-analysis skill." This skill forces the teacher to systematically inspect source code, formulate hypotheses based on domain priors, and validate evidence before acting.
  • Long-Horizon Context Compaction: Security agents easily exhaust context windows during multi-hour debugging sessions. When context usage hits 90%, CyberFactory compresses the history into a concise "continuation state" (summarizing open hypotheses, failed attempts, and build status) while discarding redundant logs, allowing the agent to continue seamlessly.

Finally, the synthesized trajectories are used for Supervised Fine-Tuning (SFT) to train OpenAegis. Crucially, OpenAegis does not receive the explicit "skill prompt" at inference time; it internalizes the workflow directly into its weights.

Figure 2: Cyber Factory pipeline from source adaptation to multi-task training and evaluation.

Datasets

CyberFactory aggregates and normalizes data from three major sources to build its training instances:

  • ARVO: A dataset of reproducible open-source vulnerabilities.
  • OSS-Fuzz: Real-world bugs found by Google's continuous fuzzing service.
  • From-the-Wild CVEs: Public Common Vulnerabilities and Exposures records, which are historically difficult to operationalize because they often lack explicit reproduction steps or environment configurations.

The models are evaluated on CyberGym, a rigorous benchmark requiring agents to reproduce real-world vulnerabilities given only a natural language description and the codebase.

Key Insights and Ideas

  • Behavioral Internalization: The most significant finding is that LLMs can internalize complex, multi-step expert workflows. After training on skill-guided trajectories, OpenAegis naturally mimics the teacher's systematic exploration and validation behavior without needing the explicit skill prompt at inference time.
  • Action Consolidation: Through SFT, the model learns to interact with the environment more efficiently. Instead of spamming simple "read" commands, OpenAegis shifts toward complex, multi-operation shell calls, executing more environment interactions before yielding control.
  • Compaction is a Game-Changer: Compressing the context window at a 90% threshold dramatically reduces context exhaustion failures (from 18.7% down to 7.0%) while significantly boosting success rates on long-horizon tasks.
Figure 3: Distribution of exploitation strategies across explicit skill elicitation and training-time internalization. Each bar is normalized within a model; for results that do not sum to 100%, the remaining strategies are unspecified; in-bar labels retain the reported percentages. GLM 5.2 + Skill receives the skill at inference time, whereas Qwen3.5 (397B-A17B) and OpenAegis do not.

Key Results

  • Benchmark Superiority: On the CyberGym benchmark under a strict one-hour budget, OpenAegis achieves a 58.1% Pass@1 rate.
  • Massive Baseline Improvement: This represents a 28.5 percentage point absolute gain over its base model, Qwen 3.5 (29.6%).
  • Beating Larger Models: OpenAegis comfortably outperforms substantially larger general-purpose models evaluated under the exact same scaffold, including Kimi K2.7 (51.7%) and GLM 5.2 (43.3%).
  • Teacher Efficiency Boost: Injecting the vulnerability-analysis skill into the teacher model (GLM 5.2) during data generation raised its Pass@1 from 43.3% to 46.5%, even though individual attempt times were cut from 60 minutes down to 15 minutes. This drastically increased the throughput of successful training data generation.

Limitations and Future Work

While CyberFactory marks a major step forward for open-source security AI, the authors note several limitations:

  • Artifact Boundaries: The framework is fundamentally bounded by the availability and quality of public CVE artifacts and underlying benchmark coverage.
  • Fuzzing vs. Manual Input: Some complex vulnerabilities still require manual input construction strategies rather than the automated, fuzzing-first approach currently prioritized by the framework.
  • Future Directions: The authors plan to expand the framework's language and project coverage, implement equally rigorous evaluations for the patching and CyberQA tracks, and develop adaptive agents capable of dynamically switching between different security analysis strategies.

Summary updated

BibTeX
@misc{yang2026cyberfactory,
  author = {Jian Yang and Haau-Sing Li and Shawn Guo and Zixi Zhao and Yibo Tan and Jiajun Wu and Aishan Liu and Zhoujun Li and Xianglong Liu and Tianyu Zheng and Bryan Dai and Chengran Yang and Weifeng Lv},
  title = {{CyberFactory: Scaling Cyber Security Capabilities with Instances from the Wild}},
  year = {2026},
  eprint = {2608.23181},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2608.23181},
}
Figure