mlsanityData to 7 Oct 2026

LEGO-RL: Harness-Native Reinforcement Learning for Coding Agents

arXiv 2608.17393 ↗First posted 18 Aug 2026cs.AIcited by 3

On the map: LLM agents and tool use → Software engineering coding agents

Abstract (arXiv)

Reinforcement learning for coding agents increasingly relies on long-running agent harnesses to manage tool integration, repository contexts, and execution feedback. However, the native execution environments of these harnesses are inherently misaligned with policy-gradient training: environmental crashes and reward hacking corrupt outcome signals, while train-inference discrepancies decouple rollout behavior from policy updates. To address this, we present LEGO-RL, a framework that bridges native coding-agent harnesses with scalable policy-gradient optimization without modifying their internal control flow. LEGO-RL is built upon three pillars: (1) faithful optimization via in-process LLM proxying that captures raw generation streams for token-level alignment and robust trainer-side log-probability recomputation, even under harness-side compaction or re-serialization; (2) reliable execution via scalable sandbox orchestration featuring image caching and stage-wise defenses to mitigate reward hacking; and (3) observable training through an integrated plugin that automates validation and monitoring, paired with a Live UI for granular trajectory diagnostics. We evaluate LEGO-RL by training the sparse MoE model Qwen3.5-35B-A3B with GSPO across three native coding-agent harnesses. LEGO-RL improves Qwen3.5-35B-A3B across OpenHands SDK (64.0% to 70.4%), Claude Code (62.4% to 68.2%), and OpenCode (57.2% to 66.6%) on SWE-bench Verified, while maintaining a rollout-training probability correlation above 0.99.

Key facts. Cited by 3 papers in the map (data through 7 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 29 of its 36 references that are in the map. First posted on arXiv 18 Aug 2026.

Builds on

29 of 36 references.

Closest ancestors · 7

Same direction, newest first

  1. 2026CodeScout: An Effective Recipe for Reinforcement Learning of Code Search Agents18 Mar
  2. 2025SWE-rebench: An Automated Pipeline for Task Collection and Decontaminated Evaluation of Software Engineering Agents26 May
  3. 2025SWE-smith: Scaling Data for Software Engineering Agents30 Apr
  4. 2025R2E-Gym: Procedural Environments and Hybrid Verifiers for Scaling Open-Weights SWE Agents9 Apr
  5. 2024Training Software Engineering Agents and Verifiers with SWE-Gym30 Dec
  6. 2024OpenHands: An Open Platform for AI Software Developers as Generalist Agents23 Jul
  7. 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering6 May

Other references · 22

  1. 2017Proximal Policy Optimization Algorithmscited by 14,441
  2. 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 8,851
  3. 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,767
  4. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,193
  5. 2024HybridFlow: A Flexible and Efficient RLHF Frameworkcited by 1,980
  6. 2019Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelismcited by 1,829
  7. 2025Group Sequence Policy Optimizationcited by 788
  8. 2025SWE-Bench Pro: Can AI Agents Solve Long-Horizon Software Engineering Tasks?cited by 254
  9. 2025SWE-RL: Advancing LLM Reasoning via Reinforcement Learning on Open Software Evolutioncited by 246
  10. 2025AReaL: A Large-Scale Asynchronous Reinforcement Learning System for Language Reasoningcited by 234
  11. 2025The Landscape of Agentic Reinforcement Learning for LLMs: A Surveycited by 195
  12. 2025Multi-SWE-bench: A Multilingual Benchmark for Issue Resolvingcited by 165
10 more
  1. 2025Agent Lightning: Train ANY AI Agents with Reinforcement Learningcited by 94
  2. 2025AgentGym-RL: Training LLM Agents for Long-Horizon Decision Making through Multi-Turn Reinforcement Learningcited by 68
  3. 2025Stabilizing MoE Reinforcement Learning by Aligning Training and Inference Routerscited by 67
  4. 2025SkyRL-Agent: Efficient RL Training for Multi-turn LLM Agentcited by 44
  5. 2025Training Long-Context, Multi-Turn Software Engineering Agents with Reinforcement Learningcited by 34
  6. 2025Let It Flow: Agentic Crafting on Rock and Roll, Building the ROME Model within an Open Agentic Learning Ecosystemcited by 28
  7. 2026SWE-Universe: Scale Real-World Verifiable Environments to Millionscited by 16
  8. 2026daVinci-Env: Open SWE Environment Synthesis at Scalecited by 13
  9. 2026Polar: Agentic RL on Any Harness at Scalecited by 12
  10. 2026OpenForgeRL: Train Harness-native Agents in Any Environmentcited by 7

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 3.

3 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2026ClawGym II: Exploring Black-Box RL on Agent Harness
  2. 2026CodeMidas: Scaling Agentic Coding RL Environments from Code Itself
  3. 2026Cross-Benchmark Transfer from RL on Agentic Coding Tasks
  4. 2026DiDPO: Diff-in-Diff Policy Optimization for Coding Agent Training
  5. 2026KAT-Coder-V2.5 Technical Report
  6. 2026What Does Multi-Harness RL Learn? Credit Assignment and Portability in Coding Agents
  7. 2026Harness-R1: Learning to Edit Executable Runtime Harnesses from Agent Failure Trajectories
  8. 2025Agentic Reinforcement Learning for Real-World Code Repair