Agent Lightning v1.0: Training Coding Agents with Real Harnesses in 3,500 Lines
Seed story: "Agent Lightning v1.0: A 3,500-Line Lightweight Agentic RL Framework for Training Agents with Real Harnesses" (Microsoft) · search original Written from facts verified across 3 report(s) — original explainer, not a copy or translation. Sources at the end.
Microsoft Research Asia has open-sourced Agent Lightning v1.0, a lightweight agentic reinforcement learning framework that fits in approximately 3,500 lines of code, allowing developers to train autonomous agents using their existing deployment harnesses without code modifications. By supporting native Kubernetes integration and removing dependencies on paid commercial sandbox services, the framework reportedly boosted Qwen3.5-9B performance on SWE-bench Verified from 41.8% to 56.4% using just 6,000 training samples.
The Harnessed Agentic RL Paradigm
Agent Lightning v1.0 introduces a "Harnessed Agentic RL" paradigm that fundamentally shifts how developers approach agent training. Instead of forcing models to adapt to rigid, experimental environments, the framework allows agents to be trained directly within their existing deployment harnesses. This approach eliminates the need for code modifications, ensuring that the training environment mirrors production conditions precisely.
For engineering teams, this means a seamless transition from development to reinforcement learning without refactoring infrastructure. Key benefits include:
- Zero-Code Adaptation: Agents integrate with current harnesses without altering source code.
- Production Parity: Training occurs in the same environment where the agent will eventually deploy.
- Reduced Friction: Eliminates the overhead of building custom, isolated training sandboxes.
By leveraging the harnesses developers already use, Agent Lightning v1.0 streamlines the workflow. It bridges the gap between theoretical model improvement and practical deployment, allowing teams to ship more robust agents with less engineering overhead.
Architecture: Trainer, Gateway, and Rollout Controller
At the core of Agent Lightning v1.0 is a modular architecture designed to simplify the training loop. The system relies on three distinct components that work in concert to manage the reinforcement learning process. This separation of concerns allows developers to scale individual parts of the pipeline independently, reducing the complexity typically associated with agentic RL setups.
The primary components include:
- Trainer: Runs the underlying
verlandvLLMengines to handle model updates and inference. - API Gateway: Proxies requests between the agent and the training infrastructure.
- Rollout Controller: Responsible for launching and managing agent instances during the rollout phase.
By isolating the rollout logic from the training engine, the framework ensures that agents can be deployed and tested in realistic environments. This structure supports the "Harnessed Agentic RL" paradigm, allowing teams to integrate existing deployment harnesses without modifying agent code. For developers, this means a more straightforward path to training coding agents, as the infrastructure handles the orchestration of complex multi-step interactions automatically.
Native Kubernetes Integration and Cost Efficiency
Agent Lightning v1.0 eliminates the need for paid commercial sandbox services by enabling agents to run as standard Kubernetes jobs. This native integration allows developers to leverage existing cluster infrastructure for reinforcement learning rollouts, removing a significant external dependency from the training stack.
By standardizing execution on Kubernetes, the framework simplifies operational workflows and reduces overhead. Key benefits include:
- Infrastructure Reuse: Utilizes existing K8s clusters without specialized sandbox providers.
- Cost Reduction: Avoids recurring fees associated with commercial agent execution environments.
- Scalability: Aligns agent training with standard container orchestration practices.
For engineering teams, this means deploying coding agents for RL training becomes as straightforward as running any other microservice. It lowers the barrier to entry for agentic RL, allowing organizations to scale training pipelines using familiar DevOps tools rather than proprietary, potentially expensive, third-party platforms.
Benchmark Results: Qwen3.5-9B and 35B-A3B Improvements
The end-to-end coding agent training pipeline delivered substantial performance gains on SWE-bench Verified. For the Qwen3.5-9B model, Pass@1 scores rose from 41.8% to 56.4%, marking a 14.6 percentage point improvement. This result was achieved using approximately 6,000 training samples, demonstrating that significant capability increases are possible without massive data requirements.
A subsequent update extended these results to the larger Qwen3.5-35B-A3B model. This variant improved its SWE-bench Verified score from 47.8% to 61.6%, a 13.8 percentage point gain. Notably, this higher-level model required only 1,800 training examples to reach this new benchmark, highlighting the framework's efficiency.
For developers, these figures suggest that agentic RL can yield high-impact improvements with relatively modest computational and data overhead. The ability to boost real-world coding performance by over 13 percentage points using fewer than 6,000 samples makes advanced agent training more accessible for teams that lack the resources for traditional, data-heavy training runs.
Sample Efficiency and Training Pipeline Analysis
The sample efficiency of Agent Lightning v1.0 is particularly striking given the modest dataset sizes required to drive substantial performance gains. For the Qwen3.5-9B model, the framework utilized approximately 6,000 training samples to achieve a 14.6 percentage point improvement on SWE-bench Verified. Even more notably, the larger Qwen3.5-35B-A3B model required only 1,800 examples to secure a 13.8 percentage point increase. This disparity highlights that larger models can extract significant value from fewer interactions, reducing the computational overhead associated with data generation.
This efficiency translates directly into practical benefits for development workflows:
- Lower infrastructure costs for generating training trajectories.
- Faster iteration cycles due to reduced rollout times.
- Easier integration into existing CI/CD pipelines for agent updates.
By minimizing the sample count needed for meaningful metric gains, the framework makes agentic reinforcement learning more accessible. Developers can now experiment with high-level coding agents without the prohibitive expense of massive-scale data collection, streamlining the path from prototype to production-ready tooling.
Implementation Guide and Technical Report
Getting Started with Agent Lightning
To begin building with this framework, developers can access the open-source codebase directly from Microsoft Research Asia. The project is released under an MIT license, ensuring full freedom to integrate, modify, and deploy the system within your own infrastructure without restrictive commercial terms. This permissive licensing model lowers the barrier to entry for teams looking to experiment with agentic reinforcement learning in production environments.
For a deeper technical understanding, the accompanying paper is available on arXiv. The technical report was submitted on August 18, 2026, and provides comprehensive documentation on the framework's internal mechanics. Key resources for implementation include:
- The MIT-licensed source code repository.
- The August 18, 2026 arXiv technical report.
- Documentation detailing the Trainer, Gateway, and Rollout Controller components.
These materials provide the necessary context to configure the native Kubernetes integration and set up the API Gateway for proxying requests.
FAQ
How does Agent Lightning v1.0 improve coding agent performance on SWE-bench Verified?
Using the framework's end-to-end training pipeline, Qwen3.5-9B performance on SWE-bench Verified improved from 41.8% to 56.4% Pass@1. This 14.6 percentage point gain was achieved using approximately 6,000 training samples.
What is the 'Harnessed Agentic RL' paradigm introduced by Agent Lightning?
It is a paradigm that allows agents to be trained using their existing deployment harnesses without requiring any code modifications. This approach is part of a lightweight agentic reinforcement learning framework implemented in approximately 3,500 lines of code.
Does Agent Lightning v1.0 require paid commercial sandbox services to run?
No, the framework supports native Kubernetes integration, enabling agents to run as standard Kubernetes jobs. This eliminates the dependency on paid commercial sandbox services.
Sources
Put an AI coding agent to work in your own workspace
MeshCode is an AI coding agent workspace — delegate the tedious parts of shipping software and stay in control. Free to start.
Try MeshCode →