RegHarness: Regulating What Code-as-Policy Agents Keep from Steps to Skills
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
Abstract
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 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
| 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) |
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 | decision (accept, revise, reject), rationale , defects , output_plan |
| ➋Code | task, API documentation, the step and its skill records, the draft, the static checker’s report | decision , rationale , defects , final_body |
| ➌Step | the step, executed code, test output (first 1,000 and last 3,000 characters), verifier status and reason, tries and plans left, first and last frames | action (commit, retry_step, replan, abort), rationale , corrective_action , edit_scale |
| ➍Final | that the task check is false; committed steps’ verdicts; end of the last output; last gripper reading | process_consistent , findings , evidence_gaps , next_attempt (1–5), recommendation = close |
| Predicate | Decision | |
|---|---|---|
| trial succeeds | ||
| R1 | retry , then R2–R3 | |
| R2 | replan | |
| R3 | abort | |
| R4 | replan | |
| R5 | retry ∗ |
| 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 |
| RATs | RATs + stepwise replay | RATs + refined skills | + Harness | RegHarness | |
|---|---|---|---|---|---|
| Loop | plan, write the whole program, static check, rehearse, execute, verify, diagnose, retry | RATs’ loop with --multiturn-reset : each step tested from a reset, committed steps replayed | as RATs | run-time governance ( Sec. 3 ) | as + Harness |
| Roles | planner, planner verifier, whole-program coder, static checker, per-step verifier, diagnoser, goal verifier, SubAgent | as RATs; the coder writes one step at a time | as RATs | 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, tries per step (code default 10); 180 s per step test incl. replay | 6 attempts; 180 s | 4 plans, 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 |
| 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 | |||||
| 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 | ✓ | ✓ | ✓ | ✓ | ✓ | |||||||
| First second | Only 2nd | Only 1st | Diff. | 95% interval | |
| Run-time governance | |||||
| RATs + Harness | 55 | 21 | [ , ] | ||
| RATs + refined skills RegHarness | 31 | 8 | [ , ] | ||
| Refined skills | |||||
| RATs RATs + refined skills | 74 | 10 | [ , ] | ||
| + Harness RegHarness | 57 | 4 | [ , ] | ||
| + 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) |
| + 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 |
| 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) |
AI Agent Governance
AI agent governance studies how to authorize, constrain, monitor, and hold autonomous and multi-agent systems accountable.
See all 479 papers