Mastermind: Strategy-grounded Learning for Repository-Scale Vulnerability Reproduction
cs.AI
Submitted: 2026-07-02
Updated: 2026-10-04
Code: https://github.com/Elfsong/ICSE-Mastermind-preprint
License: http://creativecommons.org/licenses/by/4.0/
The gist: Repository-level vulnerability reproduction is a demanding software engineering (SE) task: an agent must inspect a codebase, infer the input grammar that reaches a vulnerable path, construct a
Terminology
Abstract
Repository-level vulnerability reproduction is a demanding software engineering (SE) task: an agent must inspect a codebase, infer the input grammar that reaches a vulnerable path, construct a proof-of-conceptv(PoC), and verify that the crash disappears on the patched build. Recent LLM agents can often execute these steps when the approach is correct, yet they still fail by choosing the wrong strategy. This paper argues that strategy, rather than the full action trajectory, is the right learning unit for such SE agents: it is compact enough to optimize, concrete enough to guide execution, and stable enough to store and reuse across attempts. We present Mastermind, a dual-loop framework that separates transferable strategy learning from task-specific experience. A trainable planner learns reusable vulnerability-reproduction strategies through SFT and milestone-based GRPO, while an experience loop maintains task-local strategy records that guide subsequent attempts. The planner is trained independently of the executor, allowing strategy learning to improve multiple frozen executors without modifying their action-generation capability. We evaluate Mastermind on CyberGym using 260 training tasks and 200 held-out evaluation tasks. With GPT-5.5 as the frozen executor, Mastermind achieves an 84.5% pass rate, outperforming open-book PoC context (60.0%), Best-of-8 sampling (63.0%), and iterative improvement (77.0%). The same planner also improves GPT-5.4 mini and GLM 5.1 from 45.0% and 58.5% to 60.0% and 71.0%. These results demonstrate that learning high-level strategies is an effective and transferable mechanism for improving repository-scale SE agents.
Sources
- PilotRL: Training Language Model Agents via Global Planning-Guided Progressive Reinforcement Learning
- Plan-and-Act: Improving Planning of Agents for Long-Horizon Tasks
- CoDA: A Context-Decoupled Hierarchical Agent with Reinforcement Learning
- Expanding LLM Agent Boundaries with Strategy-Guided Exploration
- A-MEM: Agentic Memory for LLM Agents
- Tree Search for LLM Agent Reinforcement Learning
- Turn-PPO: Turn-Level Advantage Estimation with PPO for Improved Multi-Turn RL in Agentic LLMs
- Program Analysis Guided LLM Agent for Proof-of-Concept Generation
- DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models
- Illuminating search spaces by mapping elites
- ARVO: Atlas of Reproducible Vulnerabilities for Open-Source Software
- Large Language Monkeys: Scaling Inference Compute with Repeated Sampling
- Proximal Policy Optimization Algorithms
- Afterburner: Reinforcement Learning Facilitates Self-Improving Code Efficiency Optimization
- Ockhamareto: Pareto-Gated Segment-Level Credit Assignment for Concise Unit-Test Generation with Reinforcement Learning
- Cybench: A Framework for Evaluating Cybersecurity Capabilities and Risks of Language Models
- NYU CTF Bench: A Scalable Open-Source Benchmark Dataset for Evaluating LLMs in Offensive Security
- EnIGMA: Interactive Tools Substantially Assist LM Agents in Finding Security Vulnerabilities
- Cybersecurity AI: The World's Top AI Agent for Security Capture-the-Flag (CTF)
- Secure Code Generation via Online Reinforcement Learning with Vulnerability Reward Model
Related papers
- MAVEN-T: Reinforced Heterogeneous Distillation for Real-Time Multi-Agent Trajectory Prediction
- Model Discovery Agent: LLM-assisted Bayesian experiment design for data-efficient discovery of mechanistic world models
- Agents' Last Exam
- The Clinician's Veto: Navigating Trust, Liability, and Uncertainty in Autonomous AI Prescribing
- MindHelper: Closed-Loop Embodied Mental-State Reasoning for Precision Intervention
- Incumbent Advantage: Brand Bias and Cognitive Manipulation Dynamics in LLM Recommendation Systems