Enterprise Agent RL Training & Self-Verification Platform
AgentLightning turns the two most important agent-engineering ideas of August 2026 into a self-hosted platform:
- Train agents with RL inside the real deployment harness — Microsoft's Agent Lightning v1.0 (Aug 25, 2026) showed that 6,000 samples of harness-based RL lifted Qwen3.5-9B from 41.8% → 56.4% on SWE-bench Verified, with zero changes to business code.
- Let the model judge itself — LLM-as-a-Verifier topped GitHub trending by demonstrating that best-of-N self-verification lets a 0.11-dollar open-source model beat a closed frontier model.
AgentLightning packages both into a zero-dependency core (pure Python standard library) with a FastAPI control plane, CLI, Python/TypeScript SDKs, a React console, and Docker/K8s/Helm deployment assets.
| Problem | AgentLightning's answer |
|---|---|
| Simulated environments don't transfer to production | Rollout runs the agent in real harnesses (Codex, DeepSeek Harness, Claude Code, local, mock) |
| Hand-tuned prompts plateau | PPO / GRPO optimize policy parameters against real reward signals |
| "What is a good answer?" is fuzzy | Pluggable reward functions: verifier (test pass rate), rule-based, LLM-as-a-verifier, safety |
| A single model is an unreliable judge of itself | Cross-model self-verification: best-of-N + majority voting + verifier-as-judge |
┌─────────────────────────────────────────────┐
│ Control Plane (FastAPI) │
│ /train /verify /runs /harnesses /healthz │
└───────────────┬─────────────────────────────┘
┌───────────────────────┼────────────────────────┐
│ CLI (agentlightning) │ Python SDK │ TS SDK │ React Console
└───────────────────────┴──────────────┴──────────┘
│
┌─────────────────────────▼─────────────────────────────┐
│ Rollout Engine │
│ policy ──► harness (codex/dsh/claude/local/mock) ──► │
│ trajectory (steps / observations) │
└─────────────────────────┬─────────────────────────────┘
│
┌─────────────────────────▼─────────────────────────────┐
│ Reward (verifier/rule/safety/swebench/composite) │
│ Trainer (PPO / GRPO, GAE, LR schedule, early stop) │
│ Self-Verify (best-of-N, majority, verifier-as-judge) │
└─────────────────────────┬─────────────────────────────┘
│
┌─────────────────────────▼─────────────────────────────┐
│ Storage (SQLite) · Observability (Prometheus+W3C) │
│ Security (policy/audit/redact) · Sandbox (subprocess/docker) │
└───────────────────────────────────────────────────────┘
# 1. Clone
git clone https://github.com/huzjie/agentlightning.git
cd agentlightning
# 2. (optional) create a virtualenv and install the API layer
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
# 3. Self-check (works fully offline, no keys required)
python -m agentlightning doctor
# 4. Run a training loop in mock mode
python -m agentlightning train --task "Solve: implement a function that sums two integers"
# 5. Self-verify a set of candidate answers
python -m agentlightning verify --task "capital of France" --n 4
# 6. Start the control plane + console
python -m agentlightning serve --port 8000
# open http://localhost:8000/Set environment variables (or edit config.json) to use real harnesses and
judge models. Double-underscore nesting is supported:
export AGENTLIGHTNING_HARNESS=codex
export AGENTLIGHTNING_PROVIDER=deepseek
export DEEPSEEK_API_KEY=sk-...
export AGENTLIGHTNING_TRAIN__EPOCHS=5
export AGENTLIGHTNING_REWARD__FUNCTIONS='["rule","safety","verifier"]'agentlightning/ # zero-dependency kernel
harness/ # codex / deepseek / claude_code / local / mock
reward/ # verifier / rule / safety / swebench / composite
policy/ # PolicyModel + checkpoint
rollout/ # RolloutEngine + sampler
trainer/ # PPO / GRPO / GAE / scheduler / early-stop
verify/ # SelfVerifier / best-of-N / majority
providers/ # 9 LLM providers + mock
storage/ # SQLite store
observability/ # Prometheus metrics + W3C trace
security/ # policy / audit / redact
sandbox/ # subprocess / docker
cli/ # doctor / train / rollout / verify / serve / config
api/ # FastAPI control plane (routes/)
sdk/ # Python client
sdk/typescript/ # TypeScript SDK
web/ # React console (zero-build)
k8s/ helm/ Dockerfile # deployment
docs/ # guides
tests/ # pytest suite
- Getting Started
- Core Concepts
- Reward Modeling
- Self-Verification
- Training Guide
- API Reference
- Deployment
- Security
- FAQ
Apache-2.0. See LICENSE.
AgentLightning is an independent project. It is inspired by, but not affiliated with, Microsoft's Agent Lightning or any vendor's Harness products.