Reinforcement Building: Toward Self-Improving Harnesses for Defensive Software Security Agents
Lbath et al. in Agents
Can a repair agent improve without changing its weights?
Reinforcement Building: Toward Self-Improving Harnesses for Defensive Software Security Agents
A repair agent includes its harness
A harness coordinates agents, instructions, tools and runtime controls; designs tuned for one model can deliver smaller gains or even hurt on another.
RB reads the target model's repair traces and edits its surrounding harness, leaving the model weights fixed.
That makes a model-specific rebuild automatic.
One build round turns traces into edits
- 1
Run the target
Each round draws 24 unused training vulnerabilities per pass, runs two attempts each, and grades patches with an execution oracle.
- 2
Diagnose failures
The optimizer reads actions, oracle verdicts and developer fixes, comparing successes and failures on the same vulnerability.
- 3
Propose harness edits
It proposes two plans, each capped at six edits to instructions, tools, agents, memory, delegation or runtime controls.
- 4
Gate and confirm
Held-out tasks and fresh confirmation keep only statistically supported positive gains; the target model's weights stay fixed.
Three actors split one build round

Follow the actor tags: the target model attempts repairs, the optimizer proposes harness edits, and deterministic code grades, checks and gates candidates.
A failed run is more than zero
RLVR uses binary execution rewards; when success is rare, almost every episode earns zero, and the reward itself gives no diagnosis of failed steps.
RB leaves model weights fixed; its optimizer reads commands and oracle output to compare attempts and locate recurring harness failures. The target model never sees the verdict.
Even a failed run can point to a useful harness change.
The gate rejects promising-looking plans

Upper panels track training success; lower panels show candidate gains on held-out gate tasks. RB rejected 17 of 22 rounds, including positive-gain plans caught by tool or step checks.
SEC-bench: RB lifts both Gemma models
SEC-bench CVE split, three-pass means. Learned methods use shared ARVO data; delta is vs. ContraFix, as reported.
RB gains repairs with fewer regressions

Against the base, RB gains 47 and loses 11 SEC-bench tasks for Gemma-4-31B, and gains 72, loses 4 for Gemma-4-E4B; ContraFix gains 39 but loses 34 on Gemma-4-31B.
E4B gains carry beyond SEC-bench
Gemma-4-E4B's base harness scores 4.8% on SEC-bench, 3.7% on CyberGym-E2E and 0.0% on PatchBench.
RB reaches 40.8%, 12.2% and 10.4%, respectively. ContraFix is higher on CyberGym-E2E at 17.1%, though the paper reports no significant method advantage over RB on either harder benchmark.
RB improves all three here, but not every point estimate leads.
How much training to match RLVR?

The log-scale x-axis counts training episodes; the y-axis is SEC-bench success. Gemma-4-31B reaches 77.7% with RB after 190 episodes; RLVR needs 1,408 for the same rate.
RB targets each model's failure mode
- 1
Gemma-4-31B
The base agent often looped; RB added a three-repeat guard and up to two restarts with a note.
- 2
Gemma-4-E4B
It often stopped before verification; RB added fixcheck, which rebuilds the project and reruns the PoV, and bars finishing until it reports fixed locally.
- 3
Measured behavior
On SEC-bench, RB cut unfinished 31B episodes from 45% to 0.5%, and E4B episodes ending without a patch from 32% to 7%.
Tools, notes and instructions work together

Each bar removes one component from E4B's built harness; bars average two passes, dots show each pass. Restoring base instructions costs 35.5 percentage points, and tool or memory losses overlap.
What these results do not establish
Evaluation scope
The main comparison covers two Gemma targets and three held-out benchmarks; vulnerabilities were public, and experiments ran in isolated containers.
Fix access
Primary builds let the optimizer read developer fixes. Two four-round E4B builds without fixes still reached 20.2% on SEC-bench, versus 4.0% for base in those runs.
Cross-model reuse
A harness built for Muse-Glimmer-30B lowered GPT-OSS-120B's SEC-bench success by 12.2 percentage points.
Dual use
RB improves security agents and is dual-use; this study applies it only to defensive vulnerability repair.
Why it matters
- Trace-level diagnosis can tune a harness when successful episodes are scarce.
- For a new target, build a model-specific harness from repair traces and keep edits only after held-out, fresh-run confirmation.
- Whether one generation can reliably build the next one's harness on private projects remains open.
14 slides, 4 min
1 day ago