Introduction
Large language models (LLMs) have demonstrated exceptional capabilities in software engineering, particularly when trained within executable runtime environments that provide verified feedback loops. However, in the cybersecurity domain, scalable and generalizable execution-grounded environments remain scarce.
To bridge this gap, researchers have introduced CTF-Dojo, the first large-scale, execution-grounded environment tailored for training cybersecurity agents. Featuring 658 reproducible Capture-The-Flag (CTF) challenges, the platform is paired with an automated containerization pipeline called CTF-Forge. By training open-weight models on a remarkably small dataset of execution-verified trajectories, the resulting agents rival proprietary frontier models like Gemini 2.5-Flash and DeepSeek-V3.
The Bottleneck in Cybersecurity Agents
While LLMs are highly proficient at writing code, cybersecurity requires complex "agentic" behavior. Models must reason across multiple steps, utilize specialized tools, and critically, verify whether an exploit actually works in a live environment.
Historically, training these agents has been bottlenecked by two major challenges:
- Manual Configuration: Setting up realistic cybersecurity environments is a grueling process. Configuring a single CTF challenge can take an expert hours, severely limiting scalability.
- Lack of Ground-Truth Execution: Most training data is "synthetic" (generated by other models) and lacks a ground-truth execution signal. Without the ability to "run the code" and verify if a flag is captured, models often learn brittle, theoretical strategies that fail in real-world scenarios.
Building the Dojo: CTF-Forge and Execution-Grounded Training
To overcome the scaling problem, the authors developed CTF-Forge, an automated pipeline that leverages LLMs (specifically DeepSeek-V3) to transform public CTF artifacts into fully functional Docker containers. In seconds, CTF-Forge analyzes challenge descriptions and files to generate Dockerfiles, network configurations, and metadata, eliminating weeks of expert configuration.
With the environment established, the researchers trained agents using rejection sampling fine-tuning. They deployed "teacher" models (Qwen3-Coder and DeepSeek-V3) into CTF-Dojo to attempt challenges. Only the successful "trajectories"—the exact sequences of commands and reasoning that led to a captured flag—were retained for training.
The team also implemented two innovative inference-time techniques:
- Writeups as Hints: Challenges were paired with publicly available human "writeups" (solutions) with the actual flags redacted. This provided the model with strategic inspiration without spoiling the exact answer.
- Runtime Augmentation: Environment variables like port numbers and file paths were randomized during data collection to prevent models from overfitting to static cues.
Evaluation and Key Insights
The models were trained on the new CTF-Dojo dataset, which consists of 658 Dockerized challenges sourced from the pwn.college archive, covering Cryptography, Reverse Engineering, and Web Exploitation. To rigorously test the agents, the researchers evaluated them across three established benchmarks: InterCode-CTF (high-school level), NYU CTF Bench (university level), and Cybench (professional grade).
The experiments revealed several critical insights:
- Execution is the Best Teacher: Training on just 486 execution-verified trajectories proved more effective than training on nearly 10,000 synthetic ones. This demonstrates a massive leap in data efficiency when models learn from verifiable feedback.
- The Power of Hints: Providing models with human writeups as non-referential hints boosted success rates by up to 64%, suggesting that LLMs struggle more with "strategy discovery" than with the technical execution of an exploit.
- Teacher Diversity Matters: Combining trajectories from different teacher models yielded better results than using a single teacher. Diverse training sets help mitigate the unique "blind spots" of individual models, improving overall generalization.
Results: A New Open-Weight Standard
The fine-tuned CTF-Dojo-32B model (based on Qwen3) achieved an average 31.9% Pass@1 across all benchmarks. This represents an 11.6% absolute gain over strong baselines, establishing a new open-weight state-of-the-art that competes directly with proprietary giants like DeepSeek-V3-0324 and Gemini-2.5-Flash.
Notably, the 32B model exhibited nearly linear performance scaling with the number of training trajectories. This suggests that as the CTF-Dojo dataset grows, the capabilities of these agents will continue to scale significantly.
Limitations and Future Directions
Currently, CTF-Dojo is limited to the pwn.college archive. While CTF-Forge is designed to be source-agnostic, expanding to other repositories will require even more robust automated environment configurations.
The authors also acknowledge the "dual-use" nature of this research. While these agents are built for defensive purposes—finding and fixing vulnerabilities—the same capabilities could theoretically be misused for automated offensive operations. To mitigate this, the project focuses strictly on secure container isolation and is positioned as a research and training framework rather than a deployment tool.
Looking ahead, future work will explore Reinforcement Learning (RL) with partial rewards. By awarding models "points" for getting closer to a flag, agents could learn not just from their successes, but from their failures, further advancing the frontier of execution-grounded ML training.
Summary updated