BitBytecGet early access
Illustration of a lightning-shaped thread linking a small robot figure to a stack of glowing cards, suggesting agent training.

RESEARCH ·

Microsoft's Agent Lightning v1.0 trains real AI agents in 3,500 lines

Microsoft Research Asia has open-sourced a lightweight framework that lets AI agents learn by reinforcement learning without being rebuilt, lifting a small coding model by 14.6 points.

News from

Picture: BitBytec · Original illustration, BitBytec

The problem

AI agents are no longer just a model. They are systems built from a model, tools and an environment, and their capabilities increasingly depend on the "harness", the software that coordinates them. [1] Reinforcement learning, where an AI learns through trial and error guided by rewards and penalties, can make agents better. [1] But most systems for it force developers to reimplement the agent inside the training framework. Microsoft Research says that is costly, and that the agent being trained is then not quite the one that gets deployed. [1]

The approach

Researchers at Microsoft Research Asia have introduced what they call Harnessed Agentic RL, and open-sourced a rebuilt Agent Lightning v1.0. [1] The idea is that the same harness used in deployment takes part directly in training. [1]

It works by placing a proxy between the agent and the model. The agent keeps running as before, and you point the endpoint that called the model at Agent Lightning, which records the model calls. [1] Microsoft names coding agents such as mini-SWE-agent, OpenHands, OpenCode, Claude Code and Codex as examples of real harnesses. [1] The entire framework is about 3,500 lines of code. [1]

Practical details

The researchers describe four hard problems that come from letting the harness run the loop, including how text is converted back to tokens, how rewards are calculated when one run splits into several training samples, and how to schedule GPUs for unpredictable workloads. [1]

A feature called Collocated Async RL lets rollout and model updates share the same GPUs. In experiments it achieved about a 2x end-to-end speedup over synchronous training while using fewer GPUs than conventional asynchronous approaches. [1]

Agents run as standard Kubernetes jobs, on self-managed clusters, cloud Kubernetes or local infrastructure. Microsoft says other frameworks often rely on commercial sandbox services such as Modal Sandbox or E2B, where cost climbs quickly with scale. [1]

The result

To test it, the team built a pipeline using SWE-smith, mini-SWE-agent and the Qwen3.5-9B model. Training on about 6,000 samples raised its Pass@1 score on SWE-bench Verified from 41.8% to 56.4%, a gain of 14.6 percentage points. [1] These results are the researchers' own, from their blog post, and the blog links to a technical report for the full detail.

Why it matters

Many organisations want agents tuned to their own workflows, such as a support assistant or a coding helper, without sending everything to a model provider. This work suggests that training can be done on the agent you already run, with modest data and ordinary infrastructure, rather than a bespoke research setup.

It is still a research release aimed at engineers, not a product, and it assumes you have GPUs and Kubernetes skills. But the direction is useful to watch: smaller models that are trained against real tools may close some of the gap with much larger ones for specific jobs. Non-technical leaders should treat the headline number as a benchmark result on one task, not a guarantee for their own workload.

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

  • Microsoft Research
  • Agent Lightning
  • reinforcement learning
  • AI agents
  • coding agents

Sources

  1. Agent Lightning v1.0: A 3,500-Line Lightweight Agentic RL Framework for Training Agents with Real Harnesses — Microsoft Research (primary source)

Written with AI from the sources listed, checked against them before publishing.

Your idea. Your AI. Your creation.

What would you make first?

Describe it to the chat you already use. Accept the plan on your Mac. Watch your own coding agent build it.