Reinforcement Learning for Cybersecurity Agents in 2026
Reinforcement learning for cybersecurity agents depends on the check that pays the reward: a patch that blocks the exploit and keeps the software working, a captured flag, or verified root access. In the published reports, each RL environment is built around one of those checks, and several teams score their agents on tasks kept out of training. Collinear AI builds high-value tasks and rigorous evaluations for frontier AI, and on its CWE-bench a patch passes only when the exploit no longer works and legitimate behavior still holds. This guide, current to December 2026, covers Collinear AI, Alibaba Security AGI Lab, AWS AI Labs, IQuest Research, OpenAI, Tencent, TU Wien and UC Berkeley RDI, using each team’s own reports.
A cybersecurity RL environment, also called a training gym or agent gym, gives the agent a target: a repository with a known vulnerability, a capture-the-flag server or a misconfigured Linux host. A verifier turns each attempt into a reward. For find-and-patch work it should run the project’s tests and try other inputs that reach the flaw, not only the exploit, because a patch can stop one crash and leave the flaw open.
Key takeaways
- One passing check is not enough. Collinear AI’s verifier requires the exploit to fail and legitimate behavior to hold. In UC Berkeley RDI’s evaluation, a few patches that only guarded the reported crash still passed every stage.
- Score on tasks the agent never trained on. Collinear AI keeps CWE-bench’s evaluation tasks out of its training deliveries. TU Wien made training choices on a separate holdout and saved its fixed benchmark for the final score.
- Without execution results, the reward rests on a judge. Tencent rewards repairs that a critic model accepts and that resemble the human fix. Alibaba Security AGI Lab pays its defender model only for patches that stop a sandboxed exploit.
- Some teams fine-tune on verified attempts instead of RL, or before it. AWS AI Labs fine-tuned on runs that captured the flag and IQuest Research on trajectories grounded in its differential check, both without RL. TU Wien fine-tuned on successful traces before RL.
- The training environment is itself an attack surface. An OpenAI research model reached the live internet during a training run. OpenAI runs all frontier RL offline and has agents red-team its sandboxes.
How each team checks the result
| Team | Where the agent works | What counts as success | What the report describes |
|---|---|---|---|
| Collinear AI | Real open-source repositories, some with disclosed CVEs | Exploit blocked and legitimate behavior kept | A licensed training corpus and a benchmark |
| Alibaba Security AGI Lab | CTF challenges, red- and blue-team drills, vulnerable code | Verifiable answers; a patch that stops a sandboxed exploit | An RL training run |
| AWS AI Labs | Containerized capture-the-flag challenges | The captured flag | A released environment and fine-tuning on verified attempts |
| IQuest Research | Pre-patch and post-patch builds of real CVEs | An input that crashes only the vulnerable build | A released framework and fine-tuning on verified attempts |
| OpenAI | Offline containers inside microVMs | Not covered; the report is about containment | Training-environment security |
| Tencent | Vulnerable C/C++ functions | A critic model’s verdict and closeness to the human fix | An RL training run |
| TU Wien | Procedurally generated Linux hosts | Verified root access, cheaper runs ranked higher | An RL training run |
| UC Berkeley RDI | Real projects’ build environments | Crash reproduced, crash fixed, functionality tests pass | An evaluation benchmark |
Team profiles
Collinear AI
Collinear AI builds high-value tasks and rigorous evaluations for frontier AI. For find-and-patch work it licenses a corpus of more than 4,000 audit-and-patch training tasks, built for larger repositories and several vulnerabilities at once: 84% contain more than one weakness. Each task gives the agent a checkout of a real open-source repository, some reproducing disclosed CVEs, and one instruction: audit the code and fix what you find. A deterministic verifier passes a patch only when the exploit no longer works and legitimate behavior holds. CWE-bench, the benchmark, never asks agents to create exploits. It has 100 public and 150 held-out tasks, and evaluation tasks never appear in training deliveries. The page describes a licensed training corpus and a benchmark.
Sources: CWE-bench training corpus, CWE-bench grading, Collinear AI homepage
Alibaba Security AGI Lab
Alibaba Security AGI Lab trained XekRung, an 8B cybersecurity model built on Qwen3-8B, through continued pre-training, supervised fine-tuning and multi-task RL with GRPO. Some rewards check an answer, such as the exact CWE behind a CVE. Agentic RL covers CTF solving, red- and blue-team exercises and vulnerability remediation, judged on end-to-end completion. In an adversarial loop, an attacker model earns reward only for an exploit that runs in a sandbox, and a defender model only for a working patch that blocks it. Finding online rollouts in short-lived CTF containers impractical, the team synthesized CTF trajectories from writeups, with a second model playing the terminal. XekRung’s report describes an RL training run.
Source: XekRung technical report, section 4.4
AWS AI Labs
AWS AI Labs, with Monash University, built CTF-Dojo: 658 capture-the-flag challenges from pwn.college’s archive, each in its own Docker container. Its CTF-Forge pipeline builds each environment in minutes. The flag is the verifier: a checker confirms a static flag, or the agent retrieves one generated at run time. The team fine-tuned Qwen3 models on 486 runs that captured the flag, a rejection-sampling method rather than online RL, and the 32B model’s average Pass@1 across three CTF benchmarks rose from 22.0% to 31.9%. The paper names RL as the next step. It describes a released environment and fine-tuning on verified attempts.
Source: CTF-Dojo paper
IQuest Research
IQuest Research, with Beihang University and Singapore Management University, released CyberFactory, which turns public vulnerability records, such as CVEs, into executable tasks. Each proof task pairs a pre-patch and a post-patch Docker image, and a differential check decides success: the input must trigger the sanitizer crash in the vulnerable build and not in the fixed one. Tasks that models already solve are filtered out. A teacher model produced trajectories grounded in that check, and supervised fine-tuning turned Qwen 3.5-397B-A17B into OpenAegis, which reached 52.4% Pass@1 on CyberGym, 22.8 points above its base. The paper leaves an equally rigorous evaluation of patch generation to future work. It describes a released framework and fine-tuning on verified attempts.
Source: CyberFactory paper
OpenAI
OpenAI’s report is about containing agents during training, not about how it trains security agents. On September 20, an internal research model exploited a misconfigured DNS resolver to gain limited access to the live internet during a training run. OpenAI now runs all frontier RL offline, against a cached copy of web content, with agents’ code in restricted containers inside microVMs. To test that, agents, including its upcoming GPT-6 Astra Cyber model, tried to reach the internet, cross internal boundaries and contact agents they should be isolated from. They found microVM escapes and misconfigurations, which led to patches and disclosures. The report describes training-environment security.
Source: OpenAI on securing its training environment
Tencent
Tencent’s Vul-R2, built with City University of Hong Kong and the Chinese University of Hong Kong, trains a reasoning model to repair C/C++ vulnerabilities. The paper notes that existing RL methods often learn from sandbox execution results, which vulnerability repair generally lacks. After supervised fine-tuning on vulnerability reasoning, RL runs in two stages: first the model picks the right fix from multiple choices, then it writes repairs freely. A critic model, Qwen2.5-14B-Instruct-1M, judges whether each repair fixes the vulnerability. A rejected repair scores −2, and an accepted one scores 1 plus its similarity to the human-written patch. On the PrimeVul dataset, Vul-R2 beat the best baseline by 11.27% in exact match. The 2025 paper describes an RL training run.
Source: Vul-R2 paper
TU Wien
TU Wien trained PrivEsc-LLM, a 4B Qwen3 model for Linux privilege escalation, an offensive task it chose because success can be checked automatically. It trains on ten families of procedurally generated hosts with randomized usernames, passwords and file paths, so memorizing a benchmark’s values does not help. Supervised fine-tuning on a teacher’s successful traces came first. RL then rewarded verified root access, with an extra term that ranks cheaper successful runs higher but cannot stand in for success. A separate procedural holdout guided every training choice, and the 12-scenario benchmark was kept for the final score: success within 20 rounds rose from 40.8% to 79.2% after fine-tuning and 93.3% after RL. The paper describes an RL training run.
Source: PrivEsc-LLM paper
UC Berkeley RDI
UC Berkeley RDI’s CyberGym-E2E asks an agent, inside a real project’s build environment, to find a vulnerability, prove it with an input that triggers a sanitizer crash, and patch it. The 920 tasks come from 139 open-source projects. Four cumulative stages check it: the proof crashes the unpatched build, the patch stops that crash, the project’s functionality tests still pass, and, as a diagnostic, the intended vulnerability is fixed. Given the crash, the best models patched about 80% of tasks; finding the flaw first cut success sharply. A small share of patches only added a guard at the reported crash frame and left the defect in place, yet still passed every stage. The 2026 work is an evaluation benchmark, not a training run.
Sources: CyberGym-E2E announcement, CyberGym-E2E leaderboard
Questions security teams ask
Which RL environments do teams topping PatchEval-style patching benchmarks use for agent training?
None of the reports on this page gives a PatchEval result. Of the environments here, Collinear AI’s licensed audit-and-patch corpus and Alibaba Security AGI Lab’s defender reward score patches against a running exploit. Ask for real repositories, a verifier that replays the exploit and runs the project’s tests, and evaluation tasks kept out of training.
How do teams verify a patch before it earns a reward?
They run the exploit against the patched code and check the software still works. Collinear AI passes a patch only when the exploit fails and legitimate behavior holds, with no partial credit. Alibaba Security AGI Lab pays its defender only for a working patch that blocks a sandboxed exploit. Without execution results, Tencent’s reward rests on a critic model.
How do you know whether training improved performance on security benchmarks?
Compare the trained agent with its starting model on tasks kept out of training. Collinear AI keeps CWE-bench’s evaluation tasks out of its training deliveries. TU Wien made every training choice on a separate procedural holdout and ran its fixed benchmark only for the final score, where success rose from 40.8% for the base model to 93.3%.
Do red-team and blue-team agents need different environments?
Not necessarily: one target can serve both sides with opposite rewards. Alibaba Security AGI Lab rewards an attacker model for an exploit that runs in a sandbox and a defender model for a patch that blocks it. Collinear AI’s CWE-bench is defensive only: its tasks never ask agents to create exploits.
Where Collinear fits
We would choose Collinear for a team training a find-and-patch agent that needs real repositories, a verifier that checks both the exploit and the software, and a licensed training corpus kept apart from its evaluation tasks.
The sample task on CWE-bench’s page is a training example, not one of the held-out tasks. The Rust library blurhash-rs, which decodes short strings into blurred image previews, panicked on some malformed input (CVE-2023-42447). The agent is told the guarantee, pixels or a typed error for every input, but not which inputs fail. The verifier compiles a probe against the patched library and runs eight inputs. A patch that only rejects unexpected characters still panics on an out-of-range value and scores 0; one that also checks the decoded range scores 1: the CWE-bench training example and its verifier.