# Reinforcement Building: Toward Self-Improving Harnesses for Defensive Software Security Agents

> Reinforcement Building (RB) adapts a vulnerability-repair harness from execution traces, changing tools and instructions while leaving model weights untouched. On SEC-bench, success rates rose from 45.5% to 77.7% for Gemma-4-31B and from 4.8% to 40.8% for Gemma-4-E4B.

- arXiv: https://arxiv.org/abs/2611.36559
- Authors: Amine Lbath, Aurelien Delaitre, Vadim Okun, Massih-Reza Amini
- Published: 2026-12-01
- Topic: Agents
- Visual carousel: https://instaxiv.com/p/2611.36559
- Explanation by InstaXiv, a secondary educational summary. Cite the original paper for exact results. InstaXiv is not affiliated with or endorsed by arXiv or Cornell University.

## Can a repair agent improve without changing its weights?

**77.7%** RB 31B SEC-bench success vs 45.5% base harness

## A repair agent includes its harness

**Hand-built for one model:** A harness coordinates agents, instructions, tools and runtime controls; designs tuned for one model can deliver smaller gains or even hurt on another.

**Reinforcement Building (RB):** 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

![Figure 1](https://cdn.instaxiv.com/figures/2611.36559/figure1.webp)

Follow the actor tags: the target model attempts repairs, the optimizer proposes harness edits, and deterministic code grades, checks and gates candidates. (Figure 1)

## A failed run is more than zero

**Scalar reward:** RLVR uses binary execution rewards; when success is rare, almost every episode earns zero, and the reward itself gives no diagnosis of failed steps.

**Trace plus verdict:** 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

![Figure 4](https://cdn.instaxiv.com/figures/2611.36559/figure4.webp)

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. (Figure 4)

## SEC-bench: RB lifts both Gemma models

| Method | 31B success (%) | E4B success (%) |
| --- | --- | --- |
| Base harness | 45.5 | 4.8 |
| ContraFix | 64.3 | 33.5 |
| RLVR | 57.5 | 4.5 |
| WSP | 59.8 | 11.8 |
| **Reinforcement Building (+21% rel. both)** | **77.7** | **40.8** |

_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

![Figure 2](https://cdn.instaxiv.com/figures/2611.36559/figure2.webp)

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. (Figure 2)

## E4B gains carry beyond SEC-bench

**Gemma-4-E4B, base:** Gemma-4-E4B's base harness scores 4.8% on SEC-bench, 3.7% on CyberGym-E2E and 0.0% on PatchBench.

**Gemma-4-E4B, RB:** 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?

![Figure 3](https://cdn.instaxiv.com/figures/2611.36559/figure3.webp)

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. (Figure 3)

## 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

![Figure 8](https://cdn.instaxiv.com/figures/2611.36559/figure8.webp)

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. (Figure 8)

## 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.

Best used when: Most useful when a team has representative repair episodes, an execution oracle, and can inspect the resulting model-specific harness.

## Key takeaways

- 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.

## Links

- arXiv: https://arxiv.org/abs/2611.36559
- PDF: https://arxiv.org/pdf/2611.36559

## Citation

```bibtex
@article{lbath2026reinforcement,
  title   = {Reinforcement Building: Toward Self-Improving Harnesses for Defensive Software Security Agents},
  author  = {Lbath, Amine and Delaitre, Aurelien and Okun, Vadim and Amini, Massih-Reza},
  journal = {arXiv preprint arXiv:2611.36559},
  year    = {2026},
  url     = {https://arxiv.org/abs/2611.36559}
}
```
