Diffusion policies, which generate short action sequences by denoising random noise, are a leading way to learn robot skills from demonstrations. Once deployed, they meet constraints the demonstrations never contained, and retraining for each is impractical. A safety filter edits the policy's action to satisfy them, but the edit ignores the task, and a large edit can leave the policy where it cannot continue. We propose CAST (Certified Action Selection at Test time): draw a few action chunks from the frozen policy, certify each with a barrier condition, and execute the certified chunk that a learned value ensemble ranks highest. We prove that a certified step is safe whatever the critic does; that, whenever a certified sample exists, the executed chunk stays within log N nats of the policy conditioned on feasibility, while a safety-filter projection can be singular to it; and that an exact closed-loop identity splits the gain of ranking into availability, spread and the critic's target. Certifying the next chunk is not enough: a generative controller can have safe actions available now and none later. We characterise the safe control authority of a frozen policy under finite sampling, and CAST-V preserves it through a policy-conditioned viability, estimated with a model under a finite-sample guarantee or learned from the controller's own logs (CAST-VL). On robomimic manipulation, a planar quadrotor, a MuJoCo humanoid and a unicycle, with frozen policies, CAST raises joint task-and-constraint success above the output filter in nearly every setting; certifying before ranking is decisive where a filter's edit is large, and viability removes most dead ends that one-step certification cannot see. Project page: https://clmoro.github.io/cast.
Figures & tables
Figure 1: Edit or select. A keep-out zone, unseen in training, blocks one of the two routes of a frozen unicycle policy. (a) A safety filter keeps the robot in the safe set h≥0 (shading: the barrier), but its rollouts on the blocked route stall at the zone: the policy never learned to continue from there (40 rollouts, with counts). (b) Viability v of the policy’s certified chunks, by simulation: the probability that it keeps sampling certified chunks over the next 8 decisions. Certified chunks exist in the red region too, but lead to a dead end; of the N=8 drawn at one decision four head into it, and cast -V executes a viable one. (c) The same map from a network trained on the controller’s logs, without model rollouts ( cast -VL): its boundary v=0.5 (black) follows the simulated one (white) where the rollouts pass. (d) Joint success on 500 unseen zones per policy; cast , cast -V and cast -VL use the task critic, MPPI the model, map and goal.
Method
R1 moving
R2 fast
R3 effort
R4 ceiling
R5 pillar
max. viol.
obstacle
obstacle
budget
+ wall
(%)
Frozen policy
0.34
0.28
0.00
0.08
0.17
73.5
Output filter (CBF-QP)
0.61
0.49
0.37
0.47
0.53
2.5
In-denoising projection
0.60
0.51
0.39
0.45
0.52
1.0
DPCC
0.58
0.57
0.51
0.40
0.53
1.5
Latent noise optimisation
0.59
0.43
0.26
0.42
0.47
1.5
Table 1: Robomimic Can, joint success under five requests (200 paired episodes each). Methods without a critic stay within 0.08 of the output filter except under R3; cast adds 0.28–0.36 to it. The R3 filter caps every chunk; with cast ’s cap it reaches 0.46 on Figure 3 b’s scenarios ( cast : 0.71).
Figure 2: New requests, frozen models. Joint success on requests fixed in advance and evaluated once (right: the camera-only Can policy under R1 and two budgets, 0.20 and 0.30). Whiskers: 95 % intervals over shared scenarios. Select-then-filter and all other arms: Table B .
Figure 3: The levers of Theorem 3 on Can (200 shared scenarios per point; bands: 95 % intervals). (a) cast keeps its lead as the obstacle grows. (b) Under a tight budget, ranking first falls to plain scaling. (c) Two to four samples give the whole gain; large batches lose part of it. (d) The camera-only policy: the lead holds at 9 cm, not at 12 cm.
Figure 4: Dynamic systems, three frozen policies each. (a) The filter’s thrust edits keep a no-fly zone but crash the vehicle; cast (request-conditioned critic) takes the other route. (b) Unseen zones, 500 scenarios per policy (“req.”: request-conditioned critic). (c) Quadrotor energy budget; at b=1.01 almost no chunk fits and scaling does better. (d) Humanoid effort budget, 300 scenarios per policy (shaded: added later). 95 % intervals.
Appendix figures & tables17 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 5: Every setting at a glance. Paired differences in joint success with 95 % bootstrap intervals over shared scenarios. (a) cast minus the output filter (for budgets: scaling the policy’s own chunk), task critic unless the setting has only a request-conditioned one. (b) cast minus select-then-filter with the same samples and critic (pedestrian: the request-conditioned pair): certifying first adds where the filter’s edit is large (the budgets on Can and on the quadrotor) and is level or slightly behind elsewhere (small detours; mild scalings on Square and the humanoid). (c) cast -V minus cast with the same critic: large where a certified step can lead into a state from which the policy cannot continue (a blocked route, a crossing pedestrian, a fall under the humanoid’s budget), small under the quadrotor’s energy budget, level on Square and negative on Can’s new geometries and budgets, where cast ’s own choice is already viable and keeping options open costs progress. Pooled cells as in the main text and Table B .
Figure 6: Rollouts in three simulators: edit (top) or select (bottom). Manipulation (robomimic Can, moving obstacle 0.10 m / 75, one scored scenario): rendered frames with the hand path, the virtual cylinder at four times (faded) and its barrier-gradient field projected into the camera; the output filter keeps the clearance but stalls until the time limit, cast delivers the can. Quadrotor (no-fly zone unseen in training): the vehicle drawn to scale along its flight over the zone’s barrier field; the filter’s thrust corrections crash it, cast (request-conditioned critic) executes a certified sample of the other learned route. Humanoid (effort budget b=0.55 , an illustration scenario): MuJoCo frames; scaling the torques to the cap makes it fall, cast -V keeps walking within the budget. Arrows: ∇h , coloured by the barrier value h (red: at the boundary; blue: far).
Figure 7: More rollouts: edit (upper row of each block) or select (lower row). Top, manipulation (rendered; the rendered episodes equal the scored ones). Can, keep-out pillar ( +2 cm; red wireframe): the filter’s corrections keep the hand out of the pillar but it never transports the can; cast carries it around. Can, effort budget b=0.20 : the filter caps every chunk and the hand stalls with the can; cast executes certified low-effort chunks and delivers it. Square, moving obstacle (policy s0, −2 cm): the filter’s fallback holds the nut near the obstacle until the time limit; cast inserts it. Hand paths projected into the camera. Bottom, dynamic systems, drawn to scale from the recorded states: 40 rollouts per panel as mean ± sd per route and outcome (numbers: rollouts in the group; groups of one are not drawn; crosses: a group that stalls or crashes), one flight with the vehicle drawn. Unicycle and quadrotor no-fly zone : the zones of Figures 1 and 4 a fixed, cast -V with the task critic. Quadrotor energy budget b=1.015 : the first 40 scored scenarios of policy s0, re-simulated for drawing (outcomes differ slightly from the scored run), cast with the task critic; scaling the thrust to the cap costs altitude.
Figure 8: Safe set, feasible fraction and viability. Unicycle (Figure 1 ’s zone) and quadrotor (Figure 4 a’s zone), on a slice of the state space (heading at the goal and cruise speed; level flight): (a) the CBF safe set h≥0 that a filter protects, with ∇h ; (b) the feasible fraction β(s) , the share of 64 frozen-policy chunks the certificate accepts; (c) cast -V’s viability estimate at the state, v(s) : the fraction of 16 critic-free certified continuations started at s that find a certified sample at each of the next L=8 decisions (a chunk’s viability is v at the state it leads to), its region v≥0.5 (dashed) and 40 rollouts per controller with this zone fixed, as mean ± sd per route and outcome (filter: grey; cast -V: dark blue; crosses: a group that stalls or crashes). States inside the safe set and with certified samples available can still be dead ends for this policy; the filter’s rollouts end there, cast -V’s avoid them. Humanoid (effort budget 0.55; 16 scenarios): the certified region of the budget, torso height with the fall threshold, and distance walked; the filter rides the cap and falls in 15 of 16, cast -V in 1. Illustration data, not scored.
Figure 9: The boundary a frozen policy needs, simulated and learned. Four keep-out zones that the learned network never saw (unicycle, policy s0; the slice of the state space of Figure 8 ). Colour: mean viability of the policy’s certified chunks at each state (16 samples). The CBF boundary h=0 (red) is what a filter protects; the viability boundary v=0.5 lies far outside it and moves with the zone. Top: by simulation, as cast -V estimates it. Bottom: from the network trained on logs of the critic-free controller ( cast -VL), with both boundaries. The two agree on 72–90 % of about 42 000 certified chunks per zone (AUC 0.85–0.97); the learned map is softer inside the dead-end regions, which the logs rarely visit, and matches where the rollouts pass: cast -VL reaches the goal in 37–39 of 40 rollouts. Illustration data, not scored.
Figure 10: Two diagnostics. (a) Viability or success as the learning target? Both networks are trained on the same logged episodes of the critic-free controller, with the same features, architecture and recipe; only the label differs (viability of the executed chunk, or the episode’s joint success). Unicycle, unseen zones, three policies × 500 scored scenarios; bands: 95 % intervals, and at 100 episodes the range of three disjoint subsets, in each of which viability is ahead. With 300 episodes the two are level (+0.01 [ − 0.00, +0.03]), with 1000 the success critic is slightly ahead ( − 0.01 [ − 0.03, − 0.00]), and with 3000 by 0.02. Viability is the cheaper label to learn and needs no task outcome; a success critic can replace it when logs are plentiful. (b) Where violations come from. Square, new requests, learned predictor (1 200 scored episodes per controller): share of violating episodes among those that executed at least one fallback chunk failing the certificate (an uncertified correction, or the hold backup, which is accepted without margins) and among those whose chunks were all certified. Theorem 1 covers the second group; none of its episodes violated.
Figure 11: A moving obstacle in space and time. Unicycle with a pedestrian crossing the corridor (random-walk speed 0.3–0.6 m/s, noisy tracker, constant-velocity forecast with per-step conformal margins at level 0.99). Left: three scored scenarios (policy s0) where the filter fails and cast -V succeeds; the robot’s plane is the floor, time goes up, the pedestrian is a slanted tube and the central obstacle a vertical cylinder. The filter’s evasive corrections push the robot into the wall (scenarios 1 and 3) or into contact with the pedestrian (scenario 2); cast -V passes ahead of the pedestrian. Right: joint success over three policies × 500 shared scenarios. Critics trained on 6000 frozen-policy episodes per policy (task critic held-out R2 0.19–0.20; request-conditioned critic, which also sees the forecast, 0.68–0.71). cast -VL: cast -V’s rule with viability learned from 6000 logged episodes per policy of the critic-free certified controller (no crash or contact counts as viable; planned, scored once): 0.95, +0.23 [+0.19, +0.26] over the filter, +0.12 [+0.08, +0.15] over MPPI and +0.13 [+0.10, +0.16] over model-based cast -V. A success critic trained on the same kind of logs lifts cast itself to 0.98. Planned contrasts: cast (request critic) − filter +0.024[−0.018,+0.066] , so with critics trained on frozen-policy episodes cast alone does not beat the filter; cast -V (task critic) − cast (task critic) +0.093[+0.071,+0.115] ; cast -V − MPPI −0.011[−0.051,+0.028] . Also: cast -V − filter +0.099[+0.059,+0.139] , − select-then-filter (request critic) +0.057[+0.033,+0.082] . Pedestrian contact: 0.9–2.4 % for the certified controllers with frozen-policy critics (tracker noise), 0.1 % for cast -VL and the log-trained critic, 0 for MPPI.
Cell
Frozen
Filter
Crit.-free
Sel.-filter
cast
+ guard
cast -V
Can, obst. 0.10 m / 75
0.27
0.58
0.58
0.89
0.91
0.92
0.89
Can, obst. 0.10 m / 125
0.28
0.56
0.54
0.89
0.89
0.90
0.90
Can, obst. 0.20 m / 75
0.38
0.56
0.56
0.83
0.85
0.90
0.83
Can, obst. 0.20 m / 125
0.36
0.58
0.56
0.88
0.90
0.92
0.88
Can, pillar +2 cm
0.17
0.54
0.57
0.88
0.88
0.91
0.77
Can, pillar −2 cm
0.18
0.55
0.58
0.91
0.88
0.91
0.77
Appendix
Table 2: Every arm in every cell of Figure 2 , with further camera-only cells (9 and 12 cm: Figure 3 d; τ : scale of the policy’s initial denoising noise, τ=1 elsewhere) (joint success; 200 shared scenarios per cell; – not run). Frozen: the policy’s own sample, ignoring the request. For budgets, “Filter” scales the policy’s own chunk to the cap ( cast with N=1 ; the per-chunk cap filter: Table B ) and select-then-filter selects, then scales.
System
Controller
Policy samples
Model steps
ms
Joint success
Unicycle
cast , N=8
8
96
1.7
0.81
Select-then-filter
8
12
1.5
0.86
MPPI (256 samples, horizon 20)
0
5 120
0.9
0.91
cast , N=256
256
3 072
33.0
0.37
cast , N=1024
1024
12 288
146.4
0.14
cast -V, L=8
≤ 1 032
≤ 13 408
18.4
0.99
Appendix
Table 3: Compute per decision on the zone tasks (task critic, mean of three policies). Policy samples and simulated model steps are per decision ( cast -V: worst case N+NMmL samples, certificate rollouts of every sample and NML simulated chunks; lazy search and early stops use fewer); ms: measured, one CPU thread, 500 episodes batched. cast with N=256 and N=1024 gives the plain selector about as many samples as cast -V’s unicycle worst case; cast -VL adds one network call to cast .
cast -V variant (default L=8 , M=4 , vmin=0.5 )
Joint success
ms / decision
L=1
0.823 [0.797, 0.848]
6.0
L=2
0.829 [0.804, 0.854]
8.0
L=4
0.803 [0.776, 0.830]
13.3
L=8 (default)
0.993 [0.988, 0.997]
18.4
M=1
0.979 [0.970, 0.987]
4.8
M=2
0.971 [0.961, 0.981]
7.7
Appendix
Table 4: cast -V ablation on the unicycle’s unseen zones (task critic, three policies × 500 shared scenarios): lookahead L , continuations M , threshold vmin , viability alone, cast -VL and a success critic trained on the same logs (network cost on top of cast ). Viability is nearly always close to 0 or 1, so even M=1 separates the candidates; L must cover the time to commit to a route.
per-step margins (Figure 11 )
episode margins (Theorem 1 b)
Controller
Fallback
Joint
Contact (%)
Joint
Contact (%)
Filter
edit
0.72
1.5
0.61
0.9
backup
0.84
3.5
0.76
2.0
cast
edit
0.73
2.4
0.60
0.7
backup
0.87
3.7
0.81
1.3
cast -V
edit
0.82
1.0
0.91
0.0
Appendix
Table 5: The fallback, edit or certified backup, with the crossing pedestrian (three policies × 500 shared scenarios, the controllers of Figure 11 ). “Edit”: the output filter’s correction, executed even if it does not end certified. “Backup”: instead, the rest of the braking backup certified with the last certified chunk (Proposition 6 ). Left: the per-step forecast margins of Figure 11 ; right: margins calibrated over whole episodes ( ε=0.05 ), as Theorem 1 (b) assumes. No contact began in a certified chunk in any of the 30 000 episodes. With edits, every contact began in an uncertified correction (76 of 76, per-step margins). With the backup and episode margins, no contact occurred during a certified step; all 50 came after the backup had brought the robot to rest. With per-step margins, which give no episode-level guarantee, 48 contacts fell inside the backup’s certified steps. Joint success with the backup minus with edits, episode margins: filter +0.15 [+0.11, +0.18], cast +0.21 [+0.18, +0.24], cast -V +0.02 [+0.01, +0.03].
Budget b
filter
critic-free
sel.-then-filter
cast
cast + guard
shuffled
cast -V
1.01
0.17
0.02
0.11
0.00
0.00
0.03
0.01
1.015
0.58
0.62
0.71
0.83
0.74
0.61
0.89
1.02
0.59
0.77
0.83
0.97
0.96
0.74
0.99
1.025
0.58
0.74
0.92
0.99
0.98
0.73
1.00
1.03
0.58
0.72
0.97
1.00
0.99
0.71
1.00
1.05
0.63
0.68
1.00
1.00
1.00
0.67
1.00
Appendix
Table 6: Planar quadrotor: joint success, mean of three policies (500 shared scenarios each); “shuffled”: cast with its critic’s scores permuted. No certified controller entered a zone or exceeded a budget.
Budget
filter
critic-free
sel.-then-filter
cast
cast + guard
cast -V
0.50 †
0.00
0.00
0.04
0.01
0.00
0.16
0.52 †
0.00
0.00
0.16
0.09
0.01
0.51
0.55
0.02
0.03
0.60
0.57
0.35
0.86
0.58
0.18
0.25
0.82
0.82
0.79
0.87
0.60
0.35
0.43
0.86
0.85
0.87
0.86
0.65
0.48
0.51
0.88
0.88
0.88
0.89
Appendix
Table 7: Humanoid: joint success, mean of three policies (300 shared scenarios each). No certified controller exceeded the budget. † : budgets added after the planned run.
unseen zones from the family
fixed zone
Controller
joint
violation
stall
joint
violation
stall
Frozen policy
0.479
0.503
0.000
–
–
–
Output CBF filter
0.721
0.000
0.205
0.726
0.000
0.207
Predictive safety filter
0.746
0.000
0.157
0.732
0.000
0.182
DPCC
0.741
0.000
0.205
0.735
0.000
0.219
Critic-free selection
0.738
0.000
0.187
–
–
–
Appendix
Table 8: Unicycle with a keep-out zone: joint success, violation and stall rates, mean of three policies (500 scenarios each). Left: new zones of the family, unseen by the critics; right: one fixed zone. Matched critics differ only in the label. The planners do not use the policy (one set of 500 scenarios). Arms that draw extra samples use independent latents.
Obstacle radius (cm)
frozen
filter
DPCC
critic-free
sel.-then-filter
cast
cast + guard
3
0.46 (v18)
0.56 (v1)
0.56
0.55
0.87
0.86
0.92
6
0.34 (v35)
0.56 (v2)
0.58 (v0.5)
0.57 (v1)
0.85
0.87
0.90 (v2)
9
0.24 (v52)
0.50 (v6)
0.52 (v8)
0.53 (v6)
0.78 (v6)
0.81 (v6)
0.83 (v6)
12
0.11 (v76)
0.34 (v30)
0.36 (v32)
0.34 (v31)
0.51 (v32)
0.55 (v32)
0.58 (v30)
Effort budget b
chunk cap
scaling
critic-free
sel.-then-scale
cast
cast + guard
0.10
0.09
0.10
0.08
0.07
0.28
0.27
Appendix
Table 9: Can sweeps behind Figure 3 : joint success, 200 shared scenarios per cell; (v %) marks violation rates of at least 0.5 %; at 9 and 12 cm every controller violates, as empty batches become frequent (Safety paragraph of Section 5.4 ). “Chunk cap” caps every chunk; “scaling” is cast with N=1 . The guard column of the sample sweep, the scaling column and the last row were added after the planned run (best of eight without a request: 0.905 on the scenarios of the ranking intervention).
Unseen zones
cast
cast -V, model
cast -VL
Unicycle, exact model
0.81
0.99
0.95
Unicycle, actuator gain 0.85
0.70
0.96
0.93
Unicycle, actuator gain 0.7
0.65
0.89
0.90
Quadrotor, exact model
0.68
0.93
0.98
Appendix
Table 10: cast -V without simulated continuations (unseen zones, 3 policies × 500 shared scenarios). Model: simulated continuations. Logs: an ensemble trained on 3000 logged episodes per policy of the critic-free certified controller, labels in hindsight (held-out AUC ≥0.975 ). Gain g : execution scales the commands, predictions keep the nominal model. Logs minus model under mismatch: − 0.01 [ − 0.02, +0.00] (pooled over both gains); violations at g=0.7 (worst policy; cast , cast -V, cast -VL): 38 %, 6.4 %, 1.6 %. Proposition 8 does not cover the learned estimate.
Margins
sε
miscoverage
miscoverage
collision
P^[B]
joint success
cast − filter
offline, all
closed loop
decisions
cast / filter
cast / filter
cast / filter
cast / filter
ε=0.5
1.07
0.505
0.400 / 0.415
0.000 / 0.005
0.080 / 0.045
0.69 / 0.43
+0.27 [+0.18,+0.34]
ε=0.2
1.17
0.185
0.165 / 0.185
0.000 / 0.000
0.090 / 0.090
0.67 / 0.39
+0.28 [+0.20,+0.36]
ε=0.05
1.30
0.041
0.045 / 0.055
0.000 / 0.000
0.120 / 0.110
0.64 / 0.38
+0.26 [+0.18,+0.34]
per step 0.99 †
1.00
0.733
0.565 / 0.625
0.000 / 0.000
0.055 / 0.030
0.70 / 0.47
+0.23 [+0.15,+0.31]
Appendix
Table 11: Episode-level calibrated safety on Can (200 episodes per cell; cast with the unanimity guard). sε : margin factor over the per-step 0.99 margins. † The per-step margins that apply after the first decision, the reference for sε .