Agent Lightning is Microsoft Research’s open-source framework for training AI agents with reinforcement learning, without rewriting the agent. Its proxy-based design observes an agent’s interactions through an API gateway and turns them into training data, so almost any existing agent, built with any framework or even none, can be optimized with RL. Released in 2025, it reached version 1.0 in 2026 and has earned about 18,800 stars on GitHub.
The framework is deliberately lightweight, around 3,500 lines of code, with three components: a Trainer built on verl and vLLM that builds samples and updates the policy, an API Gateway that proxies model requests and captures trajectories, and a Rollout Controller that runs agents locally or as native Kubernetes Jobs. Because agents keep their real tools, context and control flow, training reflects production behavior rather than a simulation of it. Microsoft reports substantial results, for example pure RL lifting a Qwen3.5 coding agent on SWE-bench Verified from 41.8% to 56.4% with only 6K training samples, and example pipelines cover search agents, math reasoning and computer-use agents.
Agent Lightning is completely free and open source under the MIT license. You supply the GPU infrastructure and models; there are no licensing fees or hosted tiers.
Agent Lightning is for ML engineers and research teams who already have working agents, coding, search or tool-use, and want to measurably improve them with reinforcement learning.