RegHarness: Regulating What Code-as-Policy Agents Keep from Steps to Skills
Authors: Shengming Liu, Yunyi Gao, Xinyi Wang, Jianyong Sun, Shuai Wang, Yi Deng, Li Chenye, Mingcai Zhou, Sim Kuan Goh
Organizations: School of Artificial Intelligence and Robotics, Xiamen University Malaysia, Sepang, Selangor, Malaysia · Embodied AI, Beijing Zhongke Huiling Robot Technology Co., Ltd., Beijing, China · Institute of Automation, Chinese Academy of Sciences, Beijing, China
Code-as-Policy agents generate, execute, and revise robot programs, but often lack explicit mechanisms to govern what persists across executions: which actions are retained within a trial and which code modifications carry over to subsequent runs. This leaves two critical aspects of agent behavior insufficiently controlled: step-level execution and cross-run adaptation. We present RegHarness, a two-level harness that governs both forms of persistence for the RATs agent team, without relying on a vision-language-action (VLA) policy or demonstrations. Within each trial, run-time governance evaluates each proposed step from a reset scene, replaying the committed steps, while a fixed-rule controller commits the step only when both RATs' verifier and a task-long LLM auditor approve it. Between runs, a coding agent uses logged failures to develop and test revisions to skills, primitives, and rules, which remain disabled by default until explicitly enabled by the authors. Using a single low-cost model across all run-time roles, RegHarness achieves an 87.8% success rate (158/180) on paired LIBERO-PRO trials, compared with 39.4% for RATs, and a 72.0% success rate on MolmoSpaces trials. A 2×2 ablation study of RegHarness's two levels shows that its skill refinement alone increases RATs' successful trials from 71 to 135, whereas run-time governance alone achieves 105 and RATs' native stepwise reset-and-replay mode achieves only 46. These findings suggest that, for Code-as-Policy agents operating with low-cost models, task success depends not only on how generated programs are executed, but also on the quality of the reusable skills they invoke and how those skills evolve across runs.
Figures & tables
Figure 2: RegHarness regulates what persists within a trial and between runs. (a) The auditor audits plans ➊, drafts ➋, step tests ➌ and finished plans that fail the task check ➍. Each step test resets the scene and replays the committed steps on the executor of RATs’ stepwise mode. The controller commits a step only if the verifier passes it and the auditor proposes commit . (b) The coding agent (Claude Opus 5.5) turns failures into default-off switches that the authors enable.
Setting
Object
Goal
Spatial
Method
Skills
Step commit
Trials
Pos
Task
Pos
Task
Pos
Task
All
RATs
released
–
180
18
12
12
12
9
8
71/180 (39.4)
RATs + stepwise replay
released
verifier, forced
180
11
15
7
8
1
4
46/180 (25.6)
RATs + refined skills
refined
–
180
25
24
21
19
20
26
135/180 (75.0)
+ Harness
released
verifier + auditor
180
21
15
18
15
19
17
105/180 (58.3)
RegHarness
refined
verifier + auditor
180
27
26
26
23
27
29
158/180 (87.8)
Table 1: RegHarness solves 158 of the 180 paired LIBERO-PRO trials, against 71 for RATs and 135 for RATs with the refined skills, and 86.7% (260/300) over five initial states. All rows use deepseek-flash in every role, score one run per task and initial state and count successes (of 30 per cell; of 50 in the last row); initial state 0 is the development state and states 1–4 are test states, and RATs counts scored executions only ( Sec. 4.1 ). Step commit : –, none; forced, a step whose tries run out is kept unverified.
Figure 3: Selected successes in which run-time governance stops an execution that the verifier accepts or redirects one that it rejects. Each row is one trial, labelled with its configuration; borders mark stopped (amber, red) and corrected (green) executions, and the other pills are controller decisions. In rows 1–3 (LIBERO-PRO), a step audit ➌ rejects a wrong-bowl grasp, the holding check overturns an accepted empty grasp before a step audit retry, and a final audit ➍ traces a failed task check to the wrong object. In row 4 (MolmoSpaces), the step audit turns three tries the verifier rejects into retries.
Figure 4: Real-robot setup and an example task. (a) The Kinova Gen3 arm with its two-finger gripper, and color and depth images from the single fixed RGB-D camera. (b) Task 2, “put the cream cheese on the bowl”: the initial scene, the grasp, the transport and the final state.
Figure 5: Both levels of RegHarness raise success, each by less when the other is present, while RATs’ own stepwise replay lowers success. Success (%) on the 180 paired LIBERO-PRO trials for each pairing of skill library (lines) and control loop (columns), and for RATs + stepwise replay (triangle); slopes give the change from run-time governance and brackets the change from the refined skills, in points.
Appendix figures & tables12 assets
Supplementary material from the paper’s appendix.
Appendix
Audit
Shown
JSON reply
➊Plan
task, scene summary, API documentation, the plan (skills by interface only), the planning rules
Table S1 : The four audits. All are turns of one auditor conversation per trial; only the step audit receives images.
Predicate
Decision
T(s)=1
trial succeeds
R1
a=commit∧¬κ
retry , then R2–R3
R2
a=retry∧r=0∧q>0
replan
R3
a=retry∧r=0∧q=0
abort
R4
a=abort∧q>0
replan
R5
a∈{replan,abort}∧q=0∧r>0
retry ∗
Appendix
Table S2 : The controller’s rules, read top to bottom after every step test. a : the auditor’s proposal; κ : Eq. 3 ; r , q : tries left for the step and plans left after this one. ∗ The coder is also asked to redo the step and check the effects of the earlier ones.
Class
Items
Contents
In + Harness
Consistency fixes
78
success read only from the task check; correct initial-state loading; infrastructure faults discarded; an error after the task check passed counts as a success
all kept (4 rewritten)
Harness wrapper
49
rule text (13), skill-interface view (5), control layer (31): audits, controller, holding check, final audit
all kept (2 rewritten)
Skill revisions
40
library and runtime patches (9), new skills and perception interfaces (15), primitive fixes incl. the grasp-network frame (12), prompt text (4)
all removed
Undecided
27
documentation fact corrections (13), manipulation principles (8), six others
3 kept, incl. grasp-sample reuse
Appendix
Table S3 : The change register on LIBERO-PRO. The 194 changes of RegHarness relative to the released RATs code, by class, and what + Harness keeps. The refined library has 71 entries: the 59 released ones, patched, plus 2 guidance entries, 6 new skills and 4 new perception primitives, written by the coding agent.
Figure S1 : RegHarness solves 55.0% of the paired trials with its first plan, more than RATs with its whole budget, and 87.8% within four; RATs + refined skills reaches 75.0% with six attempts. An attempt is one whole program for RATs and RATs + refined skills , one stepwise pass through a plan for RATs + stepwise replay , and one plan of up to four tries per step for + Harness and RegHarness, so attempts are not equal work; dotted: the four-attempt budget of the last three.
coder writes one step at a time; drops planner verifier, rehearsal, SubAgent, feedback generator and the goal verifier’s LLM analysis; diagnoser on ambiguous verdicts only; adds the auditor
as + Harness
Budget; time per execution
6 attempts; 180 s
4 attempts, ≤4 tries per step (code default 10); 180 s per step test incl. replay
6 attempts; 180 s
4 plans, ≤4 tries per step; 480 s per step test
as + Harness
Rehearsal
yes, unscored
no
yes
no
no
task check read
after each scored execution
once, at the end of each attempt; reaching the goal mid-attempt does not end it
as RATs
after every step test; the trial ends when it holds
as + Harness
Commit
none; a retry is a new whole program, prompted with the previous program, the diagnosis and segments marked as working
on verifier succeeded , also after an error; forced after the last try
as RATs
Eq. 3
as + Harness
Appendix
Table S4 : Every known difference between the five LIBERO-PRO systems. “As X”: as in system X.
RATs
RATs + stepwise replay
RATs + refined skills
+ Harness
RegHarness
#
Instruction
0
1
2
0
1
2
0
1
2
0
1
2
0
1
2
3
4
Obj-Pos
0
alphabet soup
⋅
⋅
✓
⋅
✓
✓
⋅
⋅
✓
✓
✓
✓
✓
✓
G
✓
✓
1
cream cheese
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
A
✓
✓
✓
✓
✓
✓
2
salad dressing
✓
✓
✓
⋅
⋅
⋅
⋅
⋅
✓
A
A
A
✓
✓
✓
✓
A
3
bbq sauce
✓
⋅
⋅
✓
⋅
⋅
✓
✓
⋅
✓
✓
✓
✓
✓
A
A
A
Appendix
Table S5 : Per-task outcomes on the Object, Goal and Spatial suites, by initial state. ✓ success, ⋅ failure; for + Harness and RegHarness a failed trial shows its class ( Tab. S8 ). Object instructions read “Pick the ⟨ object ⟩ and place it in the basket”, Spatial ones “Pick the akita black bowl ⟨ location ⟩ and place it on the plate”.
RATs
RATs + stepwise replay
RATs + refined skills
+ Harness
RegHarness
#
Instruction
0
1
2
0
1
2
0
1
2
0
1
2
0
1
2
3
4
Spa-Pos
0
between the plate and the ramekin
✓
⋅
✓
⋅
⋅
⋅
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
✓
1
next to the ramekin
⋅
✓
⋅
⋅
⋅
⋅
✓
⋅
✓
✓
✓
✓
✓
✓
✓
✓
✓
2
from table center
⋅
⋅
⋅
⋅
⋅
⋅
✓
⋅
✓
S
✓
✓
✓
✓
✓
✓
✓
3
on the cookies box
⋅
⋅
⋅
⋅
⋅
⋅
⋅
✓
✓
✓
✓
A
✓
✓
✓
✓
✓
Appendix
Table S5 : (continued) Spatial suite, and totals over all 60 tasks.
First → second
Only 2nd
Only 1st
p
Diff.
95% interval
Run-time governance
RATs → + Harness
55
21
1.2×10−4
+18.9
[ +9.4 , +28.3 ]
RATs + refined skills → RegHarness
31
8
2.9×10−4
+12.8
[ +5.6 , +20.6 ]
Refined skills
RATs → RATs + refined skills
74
10
3.3×10−13
+35.6
[ +26.1 , +45.0 ]
+ Harness → RegHarness
57
4
4.9×10−13
+29.4
[ +21.1 , +38.3 ]
Appendix
Table S6 : Paired comparisons on the 180 paired trials : discordant trials, exact two-sided McNemar p , and the difference in points with its task-clustered bootstrap 95% interval ( Appendix C ).
Figure S2 : In two tasks the cabinet settles differently after each reset. Each row: the first frames of two step tests with no committed steps in one + Harness trial. The cabinet, with the bowls on and in it, is displaced; the plate and the box are not.
+ Harness
RegHarness
Trials
180
180
300
Plans audited
530
327
544
rewritten
52.8%
67.6%
67.3%
Drafts audited
3,207
2,660
4,460
rewritten
56.5%
48.5%
48.5%
Step tests (per trial)
3,185 (17.7)
2,648 (14.7)
4,440 (14.8)
Appendix
Table S7 : How often each mechanism of run-time governance acts , on the 180 paired trials and, in the last column, all 300 trials of RegHarness. “Passed” refers to the per-step verifier and “proposed” to the step audit.
+ Harness
RegHarness
Class
180
180
300
A
Misidentified object or part
17
6
16
B
Instruction or target region misread
4
3
4
C
Flat plate not grasped or pushed
4
7
11
D
Low handle out of reach
3
3
5
E
Holding-verification false negative taken as a stop
0
0
1
Appendix
Table S8 : Failure classes, one per failed trial. –: none among the 13 RegHarness failures checked for these classes; the other 27 were not checked. No trial is classed H3 (budget used up on a feasible task) or H4 (other error caused by run-time governance).
RATs
+ Harness
RegHarness
Calls per trial (auditor)
57.3
79.5 (39.8)
65.6 (33.0)
Input tokens, M (cached)
0.54 (23.2%)
5.75 (89.5%)
5.56 (87.4%)
Output tokens, M
0.274
0.386
0.341
Cost per trial
1.51 (1.51)
2.25 (2.25)
2.16 (1.42)
Cost per success
3.83
3.85
2.46
Minutes per trial
50 (46)
70 (72)
66 (43)
Appendix
Table S9 : Estimated model cost (CNY) and wall-clock time per trial on the 180 paired LIBERO-PRO trials. Parentheses: the auditor’s calls, the cached share of the input, medians. Costs include discarded processes; times depend on how many trials ran in parallel ( Tab. S4 ).