In the world of AI agents, "learning by doing" usually requires a playground. For software engineering agents, that playground is a GitHub repository and a compiler. But in cybersecurity, the playground is often a "Capture The Flag" (CTF) environment—a complex, fragile, and ephemeral setup that is notoriously difficult to maintain or even spin up years after a competition ends.
A new paper, "Cyber-Zero: Training Cybersecurity Agents without Runtime," introduces a clever way to bypass this "runtime bottleneck." Instead of needing a live environment to train agents, the researchers simulated the environment itself using Large Language Models (LLMs), turning static text-based "writeups" into high-quality training data.
TL;DR
Cyber-Zero is the first framework that trains cybersecurity agents without requiring a live execution environment. By using a dual-LLM "persona" system to turn public CTF writeups into interactive training sequences, it enables open-source models like Qwen3 to match the performance of frontier proprietary models like Claude 3.5 Sonnet at a fraction of the cost.
What Problem Does This Paper Address?
To build a capable cybersecurity agent, you need trajectories: step-by-step logs of an expert interacting with a system, failing, debugging, and eventually succeeding.
In software engineering, we have millions of GitHub issues and pull requests to learn from. In cybersecurity, we have CTF writeups—blog posts where hackers explain how they solved a challenge. However, these writeups are natural language narratives, not raw terminal logs. To turn a writeup into a training "trajectory," you would normally need to recreate the original vulnerable server, which is often impossible because the code is lost or the configurations are outdated.
This data scarcity has created a massive gap: proprietary models are decent at security tasks, but open-source models fail because they simply haven't seen enough "agentic" security data.
Methods: The Dual-LLM Persona
The authors propose a "runtime-free" synthesis pipeline. Instead of a real Linux terminal, they use a Dual-LLM Persona approach to simulate the hacking process:
- Persona 1: The CTF Player. An LLM prompted to act like an expert security engineer. It is given the challenge description but not the solution.
- Persona 2: The Bash Terminal. A second LLM that acts as the "Dungeon Master." It has access to the original writeup and the "ground truth" flag. It simulates the terminal's response to the Player's commands.
If the Player gets stuck, the Terminal can provide a "hint" (wrapped in special tags) to keep the trajectory moving. Crucially, these hints are stripped out during training so the final model learns to solve problems independently.
To ensure quality, they use a Policy Improvement Algorithm that validates the generated trajectories. A trajectory is only kept if it successfully recovers the correct flag and passes an "LLM-as-a-Judge" check to ensure the reasoning matches the expert logic in the original writeup.
Datasets
Using this method, the researchers curated a massive dataset for training and evaluation:
- Training Data: 6,188 high-quality synthesized trajectories derived from 4,610 unique CTF challenges spanning 2017–2025.
- Evaluation Benchmarks: They tested the agents on three established benchmarks: InterCode-CTF (high-school level), NYU CTF Bench (university-level), and Cybench (professional-level).
Key Insights and Ideas
- The "DM" Advantage: Using an LLM to simulate a terminal allows for the creation of "negative" data—realistic failed attempts and debugging sessions—which are often missing from clean, successful-only writeups.
- SWE Skills Don't Transfer: One of the most surprising findings was that models trained specifically for software engineering performed poorly on cybersecurity tasks. Hacking requires a different "adversarial" reasoning pattern that general coding models lack.
- Democratizing Performance: The 32B version of Cyber-Zero achieved performance comparable to proprietary models that are likely much larger. This suggests that domain-specific data quality is more important than raw parameter count for specialized agents.
- Task Diversity > Repetition: Training on a wide variety of challenges provided better gains than simply generating more trajectories for the same few tasks.
Key Results
Fine-tuning on Cyber-Zero trajectories led to massive improvements for open-weight models, effectively closing the gap with state-of-the-art proprietary systems.
- Performance Gains: The Cyber-Zero models achieved an average absolute improvement of 13.1% over their Qwen3 baseline counterparts.
- Closing the Gap: Cyber-Zero-32B matched or exceeded the capabilities of frontier models like Claude 3.5 Sonnet and DeepSeek-V3 across the evaluated benchmarks.
- Cost-Effectiveness: While proprietary models cost between $22 and $44 in tokens to solve a single successful task, the Cyber-Zero models achieved similar results for a few cents per task.
Limitations and Future Work
The authors are transparent about the risks of a "runtime-free" approach:
- Hallucination: Since the "Terminal" is just an LLM, it might occasionally hallucinate command outputs that wouldn't happen in a real Linux environment.
- Tooling Constraints: The current synthesis doesn't fully support complex interactive tools like
gdb(debuggers) or web browsers, which are essential for high-level exploit development. - The "Never Fails" Bias: Because the training data uses hints to ensure the "Player" always eventually finds the flag, the resulting models might be overly optimistic or struggle when a challenge is truly unsolvable.
Future work involves integrating real execution environments where possible to create a "hybrid" training system and expanding the agent's toolkit to include more sophisticated forensic and reverse-engineering tools.
Summary updated