Where Should a Robot’s Intelligence Live? Code-as-Policy versus Agentic Control
We compared two ways of using GPT6-Astra to control a robot placing a LEGO brick in a box: a program written before execution and a model that keeps making decisions during it. Across 20 episodes each, they completed 6 and 18 placements, respectively. The recordings reveal where online reasoning helped and what it cost.
The task and how we measure it
The instruction is simple: put the red LEGO brick in the dark gray box. The robot must pick the target out from colored distractors, grasp and lift it, carry it over the box, and release it inside. Carrying out that sequence takes more than a plan for the expected case. The controller also needs a way to decide what to do when the next observation does not match that plan.
Progress, completion, and quality
Progress records task milestones on a 0–100 scale. The score sheet below defines the values used throughout the post.
| Milestone | Progress |
|---|---|
| No purposeful contact with the red brick. | 0 |
| Deliberate contact with the red brick. | 25 |
| Red brick grasped and lifted clear of the table. | 50 |
| Red brick carried to the box while still held. | 75 |
| Red brick inside the box. | 100 |
A Progress value of 100 means the brick is inside the box, where it may still be held by the gripper. Completion requires the brick to be released, fully inside the box, and at rest for at least two seconds at the end of the episode. A human operator scored every episode on-site against this rule.
A separate 100-point quality score describes how the robot got there: grasping contributes up to 30 points, transport 30, and placement 40. A recovered drop can lead to a completed task with a lower quality score. This keeps the outcome separate from the smoothness of the execution.
Read the full scoring rubric and a worked example
Select one scenario per category and add the points. Clean execution earns full credit; instability and recovery receive partial credit.
| Category / observed behavior | Points |
|---|---|
| Grasp QualityAcquire and hold the target clear of the table for ≥1 s. Stable = no visible slip or unintended rotation. | 30 max |
| First attempt: stable grasp and lift, without corrective grip adjustment. | 30 |
| First attempt: target retained, but slipping or rotation requires adjustment. | 25 |
| After one or more failed attempts: stable grasp and lift. | 20 |
| After one or more failed attempts: target retained, but grasp remains unstable. | 15 |
| Target contacted, but no retained lift; includes an immediate loss of grip. | 5 |
| No purposeful target contact, or only a distractor is grasped. | 0 |
| Object TransportationCarry the acquired target to a release pose fully above the box opening. | 30 max |
| Release pose reached with no slipping, drops, or unintended contact. | 30 |
| Release pose reached after correcting slippage or unintended contact; no drop. | 20 |
| Target dropped, reacquired, and delivered to the release pose. | 10 |
| Transfer started but release pose never reached; includes an unrecovered drop. | 5 |
| No transport beyond the initial lift, or no retained lift. | 0 |
| Placement QualityComplete = released, fully inside the box, and at rest for ≥2 s at episode end. | 40 max |
| Complete on the first placement attempt, without rim contact or correction. | 40 |
| Complete after rim contact or a failed placement attempt followed by correction. | 30 |
| Released, but finishes on the rim or only partly inside the box. | 15 |
| Held above the opening or inside the box, but never released. | 5 |
| Finishes outside the box after a miss or bounce, or placement is not reached. | 0 |
| Total possible | 100 |
Example Scored Trajectory
Two places to put the reasoning
We used GPT6-Astra to build two controllers for a bimanual YAM station. In code-as-policy, the model develops and tests a Python program, then we freeze that program for evaluation. The program reads observations and controls the robot without further model calls. In agentic control, the model stays in the execution loop: it requests camera snapshots, interprets them, and issues the next commands through a control harness.
Both systems use feedback. The architectural choice is where new evidence gets interpreted: by logic written before the episode, or by the model during the episode.
Code-as-policy
Reason during development. Run the resulting program on each episode.
Agentic control
Reason during execution. Revisit the next action as observations arrive.
One task, 20 episodes per controller
A human operator repositioned the target brick, colored distractors, and box between episodes. These layouts varied reach, clutter, and occlusion.
Getting hold of the brick is not enough
6 of 20 placements completed with code; 18 of 20 with agentic control
The code policy lifted the brick in 14 of 20 episodes, but completed only 6 placements. Agentic control retained a lift in 18 of 20 episodes and completed all of those placements. Much of the gap appeared after the brick was already in the gripper: the code policy often acquired the target without carrying the task through to release.
Half of the agentic completions involved grasp retries. 9 of its 18 completed episodes needed more than one grasp attempt; one also included a recovered drop. The partially filled dots in the Released column capture that distinction: the task finished, but the execution earned less than full quality credit. Of the code policy’s 14 retained lifts, four stopped short of the release pose and four reached it without letting go.
What happens after a failed attempt?
Retries carried nine agentic episodes through to completion
A missed grasp changes the scene: the target may move, rotate, or become harder to separate from its neighbors. In the successful retry episodes, the agentic controller repositioned and grasped again. The code policy made no second grasp attempt in this evaluation. Its failures included eight episodes in which it held the target but never completed placement. The figure groups each episode by the path it took to its final outcome.
A stalled placement versus a recovered drop
These two trajectories illustrate the difference. Code-as-policy - episode 15 carries a stable grasp to the box but never releases it. Agentic Policy - episode 8 shows repeated attempts to acquire the target, followed by a drop and a successful recovery. The videos play at 10× speed; the captions report elapsed time in the source recordings.
Persistence does not resolve every perception problem
The two agentic failures expose different limits. In Agentic Policy - episode 5, three attempts fail to retain the target, displacing it out of the visible work area on the last attempt. In Agentic Policy - episode 7, the gripper stays open and never purposefully contacts the partly occluded brick. Repeated action can make a scene harder, while continued observation need not produce an actionable grasp.
The price of staying in the loop
The additional completions came with more time and ongoing model use. To understand that tradeoff, we separate time to release from total recording length, and model costs during development from those during execution.
Successful code-policy placements finished sooner
Among completed placements, the median observed release time was about 131 seconds for code-as-policy and 175 seconds for agentic control. Those medians cover six and eighteen completions, respectively. The timeline shows the full sample, including the agentic recovery that reached release at about 419 seconds.
An incomplete episode ends at its recorded duration with no observed release.
14 end without a completed placement
ep 07ep 09ep 18ep 12ep 06ep 11ep 01ep 02ep 03ep 04ep 05ep 08ep 10ep 13ep 14ep 15ep 16ep 17ep 19ep 202 end without a completed placement
ep 09ep 01ep 10ep 12ep 14ep 16ep 18ep 02ep 11ep 17ep 15ep 03ep 19ep 20ep 04ep 13ep 06ep 08ep 05ep 07Each row is one episode; the two groups share a time scale. A dot marks observed release; a cross marks the end of an incomplete recording. Focus or hover for times; select for episode details.
Model cost moves from development into each episode
The code policy made no model calls during evaluation. Agentic control used $53.60 across its 20 episodes, averaging $2.68 per episode. It used an existing generic harness with no task-specific development, so its development cost for this task was $0. Counting task-specific development and evaluation model use, cost per completed placement was $8.31 for code-as-policy and $2.98 for agentic control.
| Model cost (USD) | Code-as-policy | Agentic control |
|---|---|---|
| Task-specific development | $49.85 | $0.00 |
| Evaluation · 20 episodes | $0.00 | $53.60 |
| Per episode · evaluation mean | $0.00 | $2.68 |
| Per completion · development + evaluation | $8.31 | $2.98 |
To project cost over repeated episodes, we divide total task-specific model spending by the expected number of completed placements:
- N
- Number of evaluation episodes
- D
- Task-specific development model cost (USD)
- c
- Mean runtime model cost per episode (USD)
- p
- Observed completion rate, held constant
Code-as-policy’s cost per completion declines as its development cost is spread across more episodes. Agentic control’s projected cost is constant: $2.68 per episode divided by a 90% completion rate gives $2.98 per completed placement.
With the observed completion rates and mean runtime model costs held constant, code-as-policy would become cheaper per completion at about 56 total episodes.
≈ 56 episodes
How the cost projection is calculated
Substituting the task-specific development costs, mean runtime costs, and completion rates gives two curves. Each reports USD per completed placement:
A · Code-as-policy
B · Agentic control
Setting the two costs equal locates the crossover:
The first whole episode count beyond that crossing is 56.
The reusable program also takes work to build
Code-as-policy development included stereo depth estimation, camera geometry, and compensation for joint-tracking error, as well as task logic. The milestones below show how that implementation progressed from control primitives to a frozen policy. Agentic control used an existing generic harness with Cartesian motion tools and required no task-specific development.
- Control primitives
Kinematics, bounded motion, and red-target detection.
- Visual feedback
Fresh stereo images guide alignment and approach.
- First retained lift
The brick lifts; occlusion still blocks placement.
- Camera geometry
A fitted overhead model supports transport planning.
- Box reached
The target is carried to the box, but not released.
- Policy frozen
v11 committed; subsequent evaluation: 6/20 complete.
Limitations
Scenes were arranged by hand
A human operator arranged each layout rather than generating it procedurally, so the two controllers did not face an identical, controlled set of scenes.
Motor heat may be a confounding factor
In the code-as-policy evaluation, time to first gripper closure increased by about 0.53 seconds per episode across the 14 episodes with a detected closure. Heat accumulating in the motors over the run may have contributed to this drift and affected outcomes.
Where should the intelligence live?
In the agentic recordings, the model could use new observations to choose another attempt, sometimes recovering from its own earlier actions. That flexibility was useful, and it required time and inference on each episode.
A reusable program can spread its development cost across repeated executions. Its recovery behavior depends on the logic built into it. Agentic control can make new decisions during execution.
A next experiment could combine the two: use a tested program for routine motion, check explicit milestones such as retained lift and confirmed release, and ask the model to intervene when progress stops. It would test the practical question raised by these recordings: how much online reasoning is needed, and at which moments does it earn its cost?
Explore all 40 episodes
All 40 evaluated episodes are listed below, numbered 1–20 within each controller. Select Video for the full top-down and active-wrist recording at 10×.
| Video | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Code-as-policy - episode 1 | 65G 30 · T 30 · P 5 | 75 | 0.00 | 0 | 180.0 | — | 1 | 0 | 0 | Incomplete | |
| Code-as-policy - episode 2 | 65G 30 · T 30 · P 5 | 100 | 0.00 | 0 | 180.0 | — | 1 | 0 | 0 | Incomplete | |
| Code-as-policy - episode 3 | 0G 0 · T 0 · P 0 | 0 | 0.00 | 0 | 180.0 | — | 0 | 0 | 0 | Incomplete | |
| Code-as-policy - episode 4 | 65G 30 · T 30 · P 5 | 100 | 0.00 | 0 | 180.0 | — | 1 | 0 | 0 | Incomplete | |
| Code-as-policy - episode 5 | 35G 30 · T 5 · P 0 | 50 | 0.00 | 0 | 180.0 | — | 1 | 0 | 0 | Incomplete | |
| Code-as-policy - episode 6 | 100G 30 · T 30 · P 40 | 100 | 0.00 | 0 | 180.0 | 135.4 | 1 | 0 | 0 | Complete | |
| Code-as-policy - episode 7 | 100G 30 · T 30 · P 40 | 100 | 0.00 | 0 | 180.0 | 124.4 | 1 | 0 | 0 | Complete | |
| Code-as-policy - episode 8 | 0G 0 · T 0 · P 0 | 0 | 0.00 | 0 | 180.0 | — | 0 | 0 | 0 | Incomplete | |
| Code-as-policy - episode 9 | 100G 30 · T 30 · P 40 | 100 | 0.00 | 0 | 180.1 | 126.8 | 1 | 0 | 0 | Complete | |
| Code-as-policy - episode 10 | 35G 30 · T 5 · P 0 | 50 | 0.00 | 0 | 180.0 | — | 1 | 0 | 0 | Incomplete | |
| Code-as-policy - episode 11 | 100G 30 · T 30 · P 40 | 100 | 0.00 | 0 | 180.1 | 155.1 | 1 | 0 | 0 | Complete | |
| Code-as-policy - episode 12 | 100G 30 · T 30 · P 40 | 100 | 0.00 | 0 | 180.0 | 133.2 | 1 | 0 | 0 | Complete | |
| Code-as-policy - episode 13 | 0G 0 · T 0 · P 0 | 0 | 0.00 | 0 | 180.1 | — | 0 | 0 | 0 | Incomplete | |
| Code-as-policy - episode 14 | 0G 0 · T 0 · P 0 | 0 | 0.00 | 0 | 180.0 | — | 0 | 0 | 0 | Incomplete | |
| Code-as-policy - episode 15 | 65G 30 · T 30 · P 5 | 75 | 0.00 | 0 | 180.1 | — | 1 | 0 | 0 | Incomplete | |
| Code-as-policy - episode 16 | 0G 0 · T 0 · P 0 | 0 | 0.00 | 0 | 180.0 | — | 0 | 0 | 0 | Incomplete | |
| Code-as-policy - episode 17 | 35G 30 · T 5 · P 0 | 50 | 0.00 | 0 | 180.1 | — | 1 | 0 | 0 | Incomplete | |
| Code-as-policy - episode 18 | 100G 30 · T 30 · P 40 | 100 | 0.00 | 0 | 180.0 | 127.9 | 1 | 0 | 0 | Complete | |
| Code-as-policy - episode 19 | 35G 30 · T 5 · P 0 | 50 | 0.00 | 0 | 180.0 | — | 1 | 0 | 0 | Incomplete | |
| Code-as-policy - episode 20 | 0G 0 · T 0 · P 0 | 0 | 0.00 | 0 | 180.0 | — | 0 | 0 | 0 | Incomplete | |
| Agentic Policy - episode 1 | 100G 30 · T 30 · P 40 | 100 | 1.76 | 1,165,654 | 144.1 | 131.1 | 1 | 0 | 28 | Complete | |
| Agentic Policy - episode 2 | 90G 20 · T 30 · P 40 | 100 | 2.22 | 1,487,241 | 176.6 | 167.0 | 2 | 0 | 32 | Complete | |
| Agentic Policy - episode 3 | 100G 30 · T 30 · P 40 | 100 | 2.72 | 1,804,890 | 209.0 | 196.8 | 1 | 0 | 38 | Complete | |
| Agentic Policy - episode 4 | 90G 20 · T 30 · P 40 | 100 | 3.55 | 2,613,439 | 278.5 | 269.1 | 2 | 0 | 52 | Complete | |
| Agentic Policy - episode 5 | 5G 5 · T 0 · P 0 | 25 | 2.79 | 2,017,358 | 231.3 | — | 3 | 0 | 41 | Incomplete | |
| Agentic Policy - episode 6 | 90G 20 · T 30 · P 40 | 100 | 3.81 | 2,811,720 | 359.2 | 347.2 | 2 | 0 | 57 | Complete | |
| Agentic Policy - episode 7 | 0G 0 · T 0 · P 0 | 0 | 2.36 | 1,660,755 | 394.2 | — | 0 | 0 | 39 | Incomplete | |
| Agentic Policy - episode 8 | 70G 20 · T 10 · P 40 | 100 | 5.07 | 3,592,506 | 428.1 | 418.7 | 7 | 1 | 51 | Complete | |
| Agentic Policy - episode 9 | 100G 30 · T 30 · P 40 | 100 | 1.80 | 1,105,828 | 151.9 | 130.8 | 1 | 0 | 24 | Complete | |
| Agentic Policy - episode 10 | 100G 30 · T 30 · P 40 | 100 | 1.71 | 1,140,166 | 149.1 | 137.4 | 1 | 0 | 32 | Complete | |
| Agentic Policy - episode 11 | 100G 30 · T 30 · P 40 | 100 | 2.11 | 1,399,134 | 185.2 | 173.3 | 1 | 0 | 32 | Complete | |
| Agentic Policy - episode 12 | 100G 30 · T 30 · P 40 | 100 | 2.05 | 1,275,515 | 152.2 | 139.9 | 1 | 0 | 30 | Complete | |
| Agentic Policy - episode 13 | 90G 20 · T 30 · P 40 | 100 | 3.12 | 2,236,377 | 286.9 | 273.4 | 3 | 0 | 47 | Complete | |
| Agentic Policy - episode 14 | 100G 30 · T 30 · P 40 | 100 | 2.25 | 1,507,923 | 167.5 | 155.1 | 1 | 0 | 34 | Complete | |
| Agentic Policy - episode 15 | 100G 30 · T 30 · P 40 | 100 | 2.33 | 1,510,694 | 187.3 | 177.9 | 1 | 0 | 32 | Complete | |
| Agentic Policy - episode 16 | 100G 30 · T 30 · P 40 | 100 | 2.37 | 1,550,287 | 174.2 | 160.8 | 1 | 0 | 41 | Complete | |
| Agentic Policy - episode 17 | 90G 20 · T 30 · P 40 | 100 | 2.44 | 1,586,145 | 183.3 | 176.3 | 2 | 0 | 31 | Complete | |
| Agentic Policy - episode 18 | 90G 20 · T 30 · P 40 | 100 | 2.27 | 1,602,436 | 175.2 | 163.4 | 2 | 0 | 36 | Complete | |
| Agentic Policy - episode 19 | 90G 20 · T 30 · P 40 | 100 | 3.36 | 2,373,709 | 256.7 | 244.0 | 3 | 0 | 49 | Complete | |
| Agentic Policy - episode 20 | 90G 20 · T 30 · P 40 | 100 | 3.51 | 2,583,275 | 267.3 | 253.4 | 2 | 0 | 48 | Complete |
Quality = grasp / 30 + transport / 30 + placement / 40. Progress measures task milestones on a 0–100 scale. Cost and tokens are per-episode model usage, excluding development. Length is the recorded episode duration. Release is the observed release time for a completed placement; a dash means no qualifying release was observed.