arXiv:2607.01764v1

Mastermind: Strategy-grounded Learning for Repository-Scale Vulnerability Reproduction

A dual-loop framework that learns reusable vulnerability-reproduction strategies while preserving task-local evidence across attempts.

Mingzhe Du, Luu Anh Tuan, Tianyi Wu, Renyang Liu, Zhijiang Guo, Dong Huang, See-Kiong Ng

National University of Singapore · Nanyang Technological University · The Hong Kong University of Science and Technology (Guangzhou)

Dual loop trace One complete Mastermind attempt
Animated dual-loop flow for Mastermind The flow starts from a task, activates curator experience, generates a planner strategy, executes a rollout, verifies a proof-of-concept, then sends feedback to both the experience loop and policy loop. Experience loop Policy loop Input Task Experience Curator Policy Planner Frozen actor Executor Rollout PoC Milestone Verifier
01
Task enters the system

A repository-level vulnerability task arrives with source, description, and benchmark interface.

Main attempt Experience loop Policy loop
84.5%GPT-5.5 pass rate
260training tasks
200held-out tasks
560GPT-5.5 rollouts
Abstract

Strategy, not trajectory, is the learning unit.

Repository-scale vulnerability reproduction requires an agent to inspect code, infer an input grammar, construct a proof-of-concept, and verify that the patched build no longer crashes.

Mastermind argues that these agents often fail because they choose the wrong investigation strategy, even when they can execute commands, edit files, and submit PoCs. The framework separates planning from acting: a trainable Planner learns reusable vulnerability-reproduction strategies through SFT and milestone-based GRPO, while a Curator preserves task-local experience across sequential attempts. The Planner is trained independently of the frozen Executor, so strategy learning can improve multiple action backbones without changing their command-generation capability.

Repository-scale SE agents Vulnerability reproduction Strategy-level RL CyberGym Planner-executor systems
Problem Characterization

Execution is stronger than the investigation plan.

Modern LLM agents can navigate repositories and run long software-engineering workflows, but vulnerability reproduction is judged by executable evidence. The agent must decide where to inspect, what input structure to infer, when to exploit, and how to revise after verifier feedback.

CyberGym exposes the gap. With a fixed GPT-5.5 executor, one-shot Level-1 attempts solve 23.5% of held-out tasks, independent Best-of-8 reaches 63.0%, and sequential task-local strategy revision reaches 77.0%.

The bottleneck is strategic: deciding what to try next, not merely executing commands.
1

Inspect the repository

Locate relevant source, parsers, fixtures, and vulnerable paths.

2

Infer an input grammar

Turn partial evidence into a concrete PoC construction strategy.

3

Validate the crash

Use dual-build feedback to distinguish target reproduction from wrong crashes.

4

Revise with evidence

Carry task-local findings forward instead of resampling from scratch.

Dual-loop Framework

Two substrates for two kinds of knowledge.

Transferable strategy instincts belong in Planner weights. Volatile facts about one repository belong in Curator experience.

Curator

Maintains task-local strategy records, verifier outcomes, failed inputs, file locations, and milestones. Before each attempt, it activates the evidence most relevant to the current vulnerability.

Planner

Emits a compact strategy that tells the executor where to inspect, what vulnerability mechanism to test, and how to validate the PoC. It learns through SFT and milestone-based GRPO.

Executor

Instantiates the strategy as repository actions, shell commands, file edits, and PoC submissions. The executor stays frozen, isolating gains from better planning.

Verifier

Provides execution-grounded feedback using CyberGym milestones, then routes the result back to Curator and Planner so both loops improve the next attempt.

Main Results

Learned planning transfers across frozen executors.

The same planner trained on GPT-5.4 mini trajectories improves GPT-5.4 mini, GPT-5.5, and GLM 5.1 without executor-specific retraining.

GPT-5.5 held-out pass rate

Best-of-8
63.0%
PAGENT + Best-of-8
70.5%
Iterative
77.0%
Base Planner
72.5%
Mastermind
84.5%

Strict milestone-7 pass rates on the 200-task CyberGym held-out split. Mastermind solves 169/200 tasks with 560 GPT-5.5 executor rollouts.

Frozen executorBaseMastermind
GPT-5.4 mini45.0%60.0%
GPT-5.572.5%84.5%
GLM 5.158.5%71.0%
Contributions

What the paper adds.

Mastermind reframes repository-scale vulnerability reproduction as strategy selection and iterative strategy refinement.

01

Strategy Bottleneck

Identifies high-level strategy selection as a primary failure mode, supported by strategy-sensitivity, Best-of-N, and iterative-experience analyses.

02

Efficient Training

Trains over compact natural-language strategies instead of full repository trajectories, making reinforcement learning practical for long-horizon SE agents.

03

Effective Inference

Improves multiple frozen executors and outperforms independent sampling, static-analysis guidance, richer context, and task-local iteration baselines.