← Back to Paper Radar

ClawGym II: Exploring Black-Box RL on Agent Harness

Huatong Song, Fei Bai, Ming Yang, Renyuan Li, Jia Deng, Jujie He, Zhange Zhang, Daixuan Cheng, Yan Xing, Qi Yun, Xuxing Chen, Danyang Li, Feng Chang, Chuan Hao, Ran Tao, Jian Yang, Bryan Dai, Wayne Xin Zhao, Mingjie Tang, Ji-Rong Wen
2026

Reading guide · Based on sections of the original paper

The authors describe a black-box RL framework that trains a model through unmodified agent harnesses such as OpenClaw and Claude Code. It runs rollouts in sandboxes, captures model calls at a serving proxy, rebuilds forked calls into prefix trees for PPO and GRPO, and keeps the trained tokens identical to the sampled ones.

Why read this

This is for practitioners who want to RL-train agents inside production harnesses and need concrete infrastructure and trajectory-recovery choices, with gains measured on ClawGym-Bench and PinchBench.

What the authors found

  • With Qwen3-30A3B, the authors report average Pass@1 gains on ClawGym-Bench over each model's own starting policy: +9.98 through OpenClaw (from the cold-start model, reaching 62.62) and +14.81 through Claude Code (from the base model, reaching 51.87). Scoring is hybrid: code checks plus a GPT-5.4 rubric. Under OpenClaw, the RL model also beats the ClawGym-30A3B SFT baseline by 5.80 points. 4.1.2 Results
  • Training inside the target harness matters. A model trained with white-box AgentLoop RL scores 59.90 in its own loop but only 50.33 under OpenClaw. That is +5.22 over the base model, yet below the 62.62 of the OpenClaw-trained black-box model. 4.6 Comparison with White-Box AgentLoop RL
  • Mix-harness GRPO, run from the base model with 32 task–harness instances × 8 rollouts and advantages normalized per task–harness pair, matches or slightly beats single-harness training under both harnesses. This conclusion rests on training curves rather than tabulated numbers. 4.3 Mix-Harness Training

Main limitation

The two harness families start from different initializations: OpenClaw runs from a cold-start model, Claude Code runs from the base model. This confounds cross-harness comparisons of gains and training dynamics. In addition, subagent and compaction trajectories are excluded from training, and PPO uses a simplified per-branch treatment. 4.1.1 Experimental Settings

Where to start

3.2.3 Policy Optimization over the Tree Structure · See how GRPO and PPO are adapted to multi-branch prefix trees: shared-prefix tokens are counted once, and PPO treats branches independently with γ=λ=1, which the authors note may increase advantage variance.

Abstract

Agent harnesses have substantially improved performance on long-horizon tasks by coordinating agent interactions with the environment. However, reinforcement learning through complex harnesses remains largely unexplored, as scaling such training to long-horizon agent tasks introduces fundamental challenges. In this work, we present a unified black-box RL framework for stable and scalable optimization of general agents through complex harnesses. Concretely, we first build a sandbox-based execution infrastructure that isolates task environments and harnesses within temporary sandboxes for large-scale concurrent rollouts. We then decouple policy optimization from opaque harness execution and place a serving proxy at the model boundary to capture model calls. To reconstruct multi-turn trajectories and improve training efficiency, we organize the captured calls into prefix trees and further adapt both critic-based PPO and critic-free GRPO to optimize over the recovered tree structure. Meanwhile, we maintain training-inference consistency throughout the optimization process. Finally, we introduce mix-harness training, allowing a single model to be jointly optimized by heterogeneous harnesses. With Qwen3-30A3B, black-box RL improves Pass@1 on ClawGym-Bench by 9.98 and 14.81 points through OpenClaw and Claude Code, respectively, while remaining stable over 200-400 optimization steps. Moreover, the framework yields consistent gains on more challenging tasks such as JobBench and OfficeQA. Overall, our framework enables effective, stable, and scalable optimization of general agents through black-box harnesses, supporting unified training across heterogeneous execution systems.

Generated automatically from paper sections on 2026-11-28.