AivexaNewsSearch
AI news for builders and product teamsChecked every hour

Agent Lightning v1.0: A 3,500-Line Lightweight Agentic RL Framework for Training Agents with Real Harnesses

Collected Oct 7, 2026

Microsoft Research Asia has open-sourced Agent Lightning v1.0, a rebuilt version of its agent reinforcement learning framework, organized around a paradigm the researchers call Harnessed Agentic RL. The release was summarized by Zhiyuan He, research software development engineer, and Yuqing Yang, principal research SDE manager, with the work affiliated with the MSRA System and Engineering Group in Shanghai. The core claim is that the same agent harness a team deploys can participate directly in RL training, rather than being reimplemented inside the training framework.

A harness, in this context, is the surrounding scaffolding of an agent: context management, tool protocols, execution logic and dependencies. Coding agents named in the announcement include mini-SWE-agent, OpenHands, OpenCode, Claude Code and Codex. Traditional agentic RL, as the researchers describe it, assumes the training framework owns the environment loop. In a ReAct-style cycle the model emits an action, the environment returns an observation, the observation goes back into context, and the loop continues, so an entire rollout maps to one continuous token trajectory. Early systems such as verl, AReaL and slime followed that design, which meant training an agent required rebuilding its loop. Agent Lightning instead inserts an LLM proxy between agent and model: the agent runs unmodified and simply points its model endpoint at the framework, which records the calls.

Version 1.0 is deliberately small. The whole system is about 3,500 lines of code across three components. An API Gateway stores rollouts, models and events and acts as an OpenAI-compatible LLM proxy, tying each model call to its rollout and capturing prompts, responses and log probabilities. A Rollout Controller launches agents either as local processes or as standard Kubernetes jobs, keeping execution separate from training. A Customized Trainer built on verl creates rollouts, waits for completion, collects samples and assembles final training data through a sample adapter.

The Kubernetes support is aimed at cost. Other harnessed frameworks, according to the announcement, often host agents on commercial sandbox services such as Modal Sandbox or E2B, where expense scales with the number of agents. Agent Lightning runs agents as ordinary Kubernetes jobs on self-managed clusters, cloud Kubernetes or local infrastructure, so existing capacity can be reused and large rollouts cost less. Native Kubernetes support also allows clusters to be replicated locally for testing purposes or in the cloud for scale, while keeping the pipeline open source and reproducible.

Because the harness owns the interaction loop, the trainer sees only a series of request and response pairs, and a single rollout may split into a variable number of samples. The researchers identify four resulting problems. Harnesses keep context as text while RL needs the token IDs actually sampled, so re-tokenizing through the chat template can shift token boundaries and block merging of adjacent calls. Retokenization, subagents and context summarization can split a rollout into several samples, and computing advantages at the sample level counts prolific rollouts repeatedly. Averaging loss by sample count similarly overweights rollouts that happen to produce more samples. And sample count and length are known only after the harness finishes, while GPU counts and parallelism settings are fixed, so the backend must map a variable workload onto fixed resources.

The framework's answer to rollout-time variance is Collocated Async RL, which lets rollout and model updates share one set of GPUs. When enough rollouts are collected, the gateway stops accepting new requests, waits for in-flight ones to finish, the update runs, and rollout resumes, with the transition invisible to the external harness. The researchers report roughly a 2x end-to-end speedup over synchronous RL while using fewer GPUs than conventional asynchronous RL. In practice that trade-off is a deliberate stall at each update boundary: throughput improves without a second GPU pool, but the harness must tolerate a brief pause.

The headline result is a coding agent pipeline built on SWE-smith, mini-SWE-agent and Qwen3.5-9B, covering data cleaning, environment construction, reward-hacking safeguards and RL training. The training set holds about 6,000 samples and the researchers say it needs no large-scale compute. RL training alone raised the model from 41.8% to 56.4% Pass@1 on SWE-bench Verified, an absolute gain of 14.6 percentage points; SWE-bench Verified is a curated benchmark of real GitHub issues that an agent must resolve. The experiments also support the rollout-level approach over sample-level handling: rollout-level advantage plus rollout-level normalization produced higher validation reward and more stable policy entropy during training on the SWE-smith validation set.

This suggests the most consequential shift is architectural rather than algorithmic. Teams that have tuned a harness heavily can bring it to RL as-is, which reduces both engineering effort and the mismatch between the trained agent and the shipped one. A likely trade-off is that the trainer gives up fine-grained control over the loop and must rely on recorded log probabilities and adapter logic to reconstruct usable samples, which puts weight on how well the proxy captures each call. The modest sample count is notable because small-scale RL runs are far easier to reproduce than large ones. A related paper, "Agent Lightning v1.0: Towards Harnessed Agentic RL," accompanies the release.

Why it matters: Teams running coding or general-purpose agents can, by inference, attach an existing harness to RL training by redirecting its model endpoint, without a rewrite and without paid sandbox services; those relying on commercial sandboxes may also see rollout costs fall by moving to their own Kubernetes capacity. The 14.6-point gain on about 6,000 samples suggests meaningful improvements are reachable at modest data and compute scale, and the 3,500-line codebase is small enough for teams to read, modify and extend the training pipeline themselves. As with any benchmark result, the gain reflects one model, harness and dataset combination, so teams should validate it against their own harness before assuming it carries over.

Read at Microsoft Research

Based on reporting from the original publisher. Visit the source for full context and later updates.

Publisher excerpt

Training AI agents with reinforcement learning can be challenging because their tools, context, and decision-making are managed by complex frameworks. Agent Lightning connects existing agents to RL training, making it easier to improve them without rebuilding them. The post Agent Lightning v1.0: A 3,500-Line Lightweight Agentic RL Framework for Training Agents with Real Harnesses appeared first on Microsoft Research .