Literature
Display
← All papers

X-Safe: Embodiment-Agnostic Safeguarding for Robot Arm Manipulation Policies via Action Masking

Alex Beaudin · Hanna Krasowski · Kartik Nagpal · Sanjit A. Seshia · Murat Arcak · Negar Mehr

Preprint posted · arXiv (preprint) ↗

Robotics7 min text · CondensedOriginal paper ↗
Contents

Reading guide

This edition covers all eight pages and the appendix: five figures, two exact tables, three algorithms, four equations, both full propositions and 39 references. The main distinction is between confidence about a sampled region’s unsafe volume and the collision risk of actions selected inside it. Read the guarantee conditions and fallback alongside the empirical results; the paper’s uniform-action assumption does not follow merely from selecting one action.

At a glance

X-Safe constructs local configuration-space polytopes from batched collision checks, then radially contracts a policy’s action support toward those regions. On Panda simulation and xArm7 hardware, it reduces observed collisions while preserving more task success than the RAIL comparison in simulation. It still needs calibrated robot/scene geometry, an accurate collision checker and quasi-static obstacles. Its formal result bounds the probability of excessive unsafe volume in sampled polytopes; interpreting that as policy execution risk needs additional selection/model assumptions, and the fallback is outside that guarantee.

I Introduction

A portable safeguard can reuse kinematics and a collision checker instead of learning a separate safety function for each embodiment. X-Safe seeks local safe action regions and uses an interior-directed fallback rather than always stopping. Embodiment-agnostic means sharing the procedure, not eliminating robot geometry, scene estimation, calibration or action-limit choices. Empirical performance and safety remain conditional on those inputs.

Complete original Fig. 1: Overview of our safeguarding method, X-Safe, that can take action sequences from policies together with a scene, i.e., safety-relevant state. The middle box illustrates safeguarding for n n actions in two exemplary directions of the configuration space. At t = 1 t=1 , the action set 𝒜 \mathcal{A} is fully enclosed in the safe polytope 𝒫 s \mathcal{P}_{s} and consequently the action remains the same. In contrast, at t = 2 t=2 , the safe polytope intersects with the action set in the direction of the masking ray, and the proposed action a 2 a_{2} is corrected to a 2 safe a_{2}^{\mathrm{safe}} . The safeguarding sequentially corrects all n n actions.
Fig. 1: Overview of our safeguarding method, X-Safe, that can take action sequences from policies together with a scene, i.e., safety-relevant state. The middle box illustrates safeguarding for nn actions in two exemplary directions of the configuration space. At t=1t=1, the action set 𝒜\mathcal{A} is fully enclosed in the safe polytope 𝒫s\mathcal{P}_{s} and consequently the action remains the same. In contrast, at t=2t=2, the safe polytope intersects with the action set in the direction of the masking ray, and the proposed action a2a_{2} is corrected to a2safea_{2}^{\mathrm{safe}}. The safeguarding sequentially corrects all nn actions.
Original selectable diagram labels
  • Policy
  • image-based
  • or
  • state-based
  • or
  • teleoperated
  • Safeguarding with X-Safe
  • t=1t=1
  • t=2t=2
  • …
  • t=nt=n
  • action ata_{t}
  • original pose qtq_{t}
  • action set 𝒜⁡(st)\mathcal{A}(s_{t})
  • safe action atsafea^{\mathrm{safe}}_{t}
  • masking ray
  • safe polytope 𝒫st\mathcal{P}_{s_{t}}
  • Environment
  • xArm7
  • Panda
  • a1:na_{1:n}
  • asafe1:na^{\mathrm{safe}}_{1:n}
  • policy state stπ←st+nπs^{\pi}_{t}\leftarrow s^{\pi}_{t+n}
  • safety-relevant state st←st+ns_{t}\leftarrow s_{t+n}

II Related Work

Projection, reachability and control-barrier methods trade different modeling assumptions, compute costs and task interference. Ray masking contracts a support set along its intended direction, avoiding the boundary mass created by ordinary projection of unsafe actions. That geometric difference does not itself prove collision freedom or make a learned policy uniform. The comparison with RAIL concerns the specific retained task and its reachability-based implementation.

III Problem Formulation

The safeguard sees joint configuration plus object poses/dimensions, which can differ from the policy’s image/state input. Actions are local joint changes bounded by per-joint limits. A MuJoCo-style twin supplies a collision predicate for proposed configurations. Equation 1 states a desired pointwise action-risk objective, while Equations 3–4 prove a different unsafe-volume confidence statement. They should not be treated as interchangeable. These definitions concern modeled configurations, not an independently proven swept-path, tracking-error, force or dynamic-obstacle guarantee.

Original mathematical definitions and guarantee conditions

We denote sets and set operations with calligraphic letters. We let the function 𝚟𝚘𝚕\mathtt{vol} denote the Lebesgue measure for a set and ⟨A,b⟩𝒫\langle A,b\rangle_{\mathcal{P}} abbreviate a polytope 𝒫\mathcal{P} in halfspace representation 𝒫={x∣A​x≤b}\mathcal{P}=\{x\mid Ax\leq b\}. We define the safety-relevant state s=(q,senv)∈𝒮s=(q,s^{\mathrm{env}})\in\mathcal{S} comprised of a configuration q∈ℝD​o​Fq\in\mathbb{R}^{DoF}, with D​o​F{DoF} being the degrees of freedom of the manipulator, and the object-based scene representation senvs^{\mathrm{env}}. The scene representation senvs^{\mathrm{env}} describes the pose and dimensions of objects in the environment apart from the robotic manipulator. The actions a∈𝒜a\in\mathcal{A} are defined relative to the current configuration of the robotic manipulator qq, where the action set is 𝒜⁡(s)⊂ℝD​o​F\mathcal{A}(s)\subset\mathbb{R}^{DoF}. Intuitively, actions are viewed, locally, as relative changes in the configuration qq and clipped to 𝒜⁡(s)\mathcal{A}(s) based on a maximum joint difference Δmax\Delta_{\max}. Note that we omit the state-dependent notation for readability, and 𝒜n\mathcal{A}^{n} is the action set for nn sequential actions.

Original mathematical definitions and guarantee conditions

The violation function C:𝒮→{0,1}C:\mathcal{S}\rightarrow\{0,1\} maps a state ss to 00 if it is safe, and 11 if a collision occurs. Thus, we can define the safe state-dependent set 𝒞ssafe={a∣C(s′)=0,s′=(q+a,senv),a∈𝒜}\mathcal{C}_{s}^{\text{safe}}=\{a\mid C(s^{\prime})=0,s^{\prime}=(q+a,s^{\mathrm{env}}),a\in\mathcal{A}\}. Note that, in practice, the violation function CC is available through simulation frameworks, e.g., MuJoCo [36]. Specifically, senvs^{\mathrm{env}} and qq are used to define a virtual twin of the physical environment, and forward kinematics allow for rapidly evaluating CC for configurations q′=q+aq^{\prime}=q+a that result from local actions aa. Let the policy π\pi take a state sπ∈𝒮πs^{\pi}\in\mathcal{S}_{\pi} as argument and output action sequences in 𝒜n\mathcal{A}^{n}. Note that the state space of the policy 𝒮π\mathcal{S}_{\pi} can be different from the state space of the safeguard 𝒮\mathcal{S}, e.g., a vision-based policy π\pi that uses images as state and vision-based perception that obtains senvs^{\mathrm{env}} for the safeguard.

Original mathematical definitions and guarantee conditions

Given the violation function CC, and a performant policy π\pi (i.e., near-optimal with high success rate), our goal is to construct a safe policy πsafe\pi^{\mathrm{safe}} that satisfies a probabilistic safety guarantee. To that end, we define a safeguarding function ℱ\mathcal{F} that wraps π\pi and satisfies

Complete original Equation 1
Original selectable equation
Equation 1
ℙ[ℱ(π(sπ),s)∉𝒞ssafe]≤δ, for all safe s,\mathbb{P}\left[\mathcal{F}(\pi(s^{\pi}),s)\notin\mathcal{C}_{s}^{\mathrm{safe}}\right]\leq\delta,\text{ for all safe }s, (1)
Original mathematical definitions and guarantee conditions

where δ∈(0,1]\delta\in(0,1] is a small tolerable probability of safety violation. In words, ℱ\mathcal{F} modifies π\pi such that the resulting action is safe with high probability. The probability in (1) comes from ℱ\mathcal{F}, which may be stochastic, or simply work under limited information. Of course, ℱ=0\mathcal{F}=0, i.e. stand still, satisfies (1), so another consideration for ℱ\mathcal{F} is to leverage π\pi. The safe policy, then, is given by

Complete original Equation 2
Original selectable equation
Equation 2
πsafe​(s)=ℱ⁡(π⁡(sπ),s).\pi^{\mathrm{safe}}(s)=\mathcal{F}(\pi(s^{\pi}),s). (2)

IV X-Safe: Probabilistic Safeguard for Manipulation

The method repeatedly samples/refines local polytopes, masks each proposed action if the test passes, and otherwise moves toward a candidate polytope’s Chebyshev center. Sequential execution uses the resulting predicted configurations. The complete statistical conditions, action masks and fallback branch remain visible in the original algorithms; the center of an unverified region is not certified collision-free by the volume theorem.

Complete original Fig. 2: Illustration of 𝙱𝚒𝚜𝚎𝚌𝚝𝚃𝚘𝙵𝚛𝚎𝚎 \mathtt{BisectToFree} and 𝙿𝚕𝚊𝚌𝚎𝙽𝚘𝚗𝚁𝚎𝚍𝚞𝚗𝚍𝚊𝚗𝚝𝙷𝚢𝚙𝚎𝚛𝚙𝚕𝚊𝚗𝚎𝚜 \mathtt{PlaceNonRedundantHyperplanes} . Sampled collision points p i p_{i} for non-redundant hyperplanes in red, where for p 1 p_{1} the bisection with a limit of 4 steps is illustrated with gray ticks. The points c ​ f i cf_{i} are the last collision-free points. The hyperplanes h i h_{i} are placed tangent to a sphere around q t q_{t} with radius c ​ f i cf_{i} and go through c ​ f i cf_{i} . The hyperplanes form the polytope 𝒫 \mathcal{P} .
Fig. 2: Illustration of 𝙱𝚒𝚜𝚎𝚌𝚝𝚃𝚘𝙵𝚛𝚎𝚎\mathtt{BisectToFree} and 𝙿𝚕𝚊𝚌𝚎𝙽𝚘𝚗𝚁𝚎𝚍𝚞𝚗𝚍𝚊𝚗𝚝𝙷𝚢𝚙𝚎𝚛𝚙𝚕𝚊𝚗𝚎𝚜\mathtt{PlaceNonRedundantHyperplanes}. Sampled collision points pip_{i} for non-redundant hyperplanes in red, where for p1p_{1} the bisection with a limit of 4 steps is illustrated with gray ticks. The points c​ficf_{i} are the last collision-free points. The hyperplanes hih_{i} are placed tangent to a sphere around qtq_{t} with radius c​ficf_{i} and go through c​ficf_{i}. The hyperplanes form the polytope 𝒫\mathcal{P}.
Original selectable diagram labels
  • h2h_{2}
  • h3h_{3}
  • h1h_{1}
  • 1
  • 2
  • 3
  • 4
  • 𝒟\mathcal{D}
  • qtq_{t}
  • p3p_{3}
  • p1p_{1}
  • p2p_{2}
  • c​f2cf_{2}
  • c​f1cf_{1}
  • c​f3cf_{3}
  • Collision points pi∈Scolp_{i}\in S_{\mathrm{col}} Closest free points c​ficf_{i}
    Collision regions Polytope 𝒫\mathcal{P} from hyperplanes hih_{i}

IV-A Safe Polytope Computation

Uniform configuration samples drive a collision-fraction test; colliding samples produce new separating planes via bisection. The adaptation adds 4×DoF directed samples, chooses the last collision-free bisection point and returns a passed flag. Those extra samples probe relevant directions but do not make the entire region collision-free. Successful statistical termination is essential; the prose explicitly limits the guarantee when the iteration cap is reached.

Proposition 1 bounds the probability that unsafe volume exceeds epsilon. With Table I’s delta=0.005, epsilon=0.02 and tau=0.5, its displayed sufficient sample condition requires at least 2,120 uniform samples, while the table uses M=1,024. This does not meet the printed sufficient condition. It does not prove that a separately implemented statistical test can never certify a region; that implementation/alternative justification is not supplied here.

Original mathematical definitions and guarantee conditions

We assume that safety constraints encompass self-collision and collision with quasi-static environment objects. Specifically, the unsafe set 𝒰=𝒰robot∪𝒰env\mathcal{U}=\mathcal{U}^{\mathrm{robot}}\cup\mathcal{U}^{\mathrm{env}}, where 𝒰robot\mathcal{U}^{\mathrm{robot}} describes self-collisions, and 𝒰env\mathcal{U}^{\mathrm{env}} describes environmental collisions, which can vary when the environment objects change, i.e., quasi-static setting. Obtaining a closed-form representation of 𝒰\mathcal{U} is generally intractable in configuration space. However, the violation function CC, typically implemented with a simulation framework, can assess if a state s∈𝒰s\in\mathcal{U}, in which case it returns 11.

Original mathematical definitions and guarantee conditions

Thus, based on CC, we aim to define an algorithm that provides configuration space sets, locally at the current configuration, that have only a low probability of intersection with 𝒰\mathcal{U}. Specifically, we adapt the sampling-based method of Edge Inflation – Zeroth Order (EI-ZO) [34, 35]. EI-ZO computes maximal probabilistically collision-free polytopes in the robot’s configuration space to build a graph of convex sets, and we adapt it to an efficient algorithm for local safe polytopes, i.e., 𝙻𝚘𝚌𝚊𝚕𝙿𝚘𝚕𝚢𝚝𝚘𝚙𝚎\mathtt{LocalPolytope}, in Alg. 1.

Complete original Algorithm 1 𝙻𝚘𝚌𝚊𝚕𝙿𝚘𝚕𝚢𝚝𝚘𝚙𝚎 \mathtt{LocalPolytope}, all Require/Ensure text and numbered lines.
Algorithm 1 𝙻𝚘𝚌𝚊𝚕𝙿𝚘𝚕𝚢𝚝𝚘𝚙𝚎\mathtt{LocalPolytope}
Original selectable algorithm
Require: Domain 𝒟⊆ℝD​o​F\mathcal{D}\subseteq\mathbb{R}^{DoF}, local configuration edge (q1,q2)(q_{1},q_{2}) with q1,q2∈𝒟q_{1},q_{2}\in\mathcal{D}, parameters ε,δ,τ\varepsilon,\delta,\tau, maximum number of iterations NiterN_{\mathrm{iter}}, number of samples MM.
Ensure: Polytope 𝒫⊆𝒟\mathcal{P}\subseteq\mathcal{D}, Boolean passed indicating if 𝒫\mathcal{P} satisfies (1) for (ε,δ)(\varepsilon,\delta).
1: k←1k\leftarrow 1, 𝒫←𝒟\mathcal{P}\leftarrow\mathcal{D}
2: 𝚙𝚊𝚜𝚜𝚎𝚍←False\mathtt{passed}\leftarrow\texttt{False}
3: for k=1,…,Niterk=1,\dotsc,N_{\mathrm{iter}} do
4:   S∼𝚄𝚗𝚒𝚏𝚘𝚛𝚖𝚂𝚊𝚖𝚙𝚕𝚎⁡(𝒫,M)∪ℰ⁡(q1,q2)S\sim\mathtt{UniformSample}(\mathcal{P},M)\cup\mathcal{E}(q_{1},q_{2})
5:   Scol←𝙿𝚘𝚒𝚗𝚝𝚜𝙸𝚗𝙲𝚘𝚕𝚕𝚒𝚜𝚒𝚘𝚗⁡(S)S_{\text{col}}\leftarrow\mathtt{PointsInCollision}(S)
6:   δk←6​δπ2​k2\delta_{k}\leftarrow\frac{6\delta}{\pi^{2}k^{2}}
7:   if 𝚄𝚗𝚊𝚍𝚊𝚙𝚝𝚒𝚟𝚎𝚃𝚎𝚜𝚝⁡(δk,ε,τ,Scol,M)\mathtt{UnadaptiveTest}(\delta_{k},\varepsilon,\tau,S_{\text{col}},M) passes then
8:    𝚙𝚊𝚜𝚜𝚎𝚍←True\mathtt{passed}\leftarrow\texttt{True}
9:    break
10:   end if
11:   Sfree∗←𝙱𝚒𝚜𝚎𝚌𝚝𝚃𝚘𝙵𝚛𝚎𝚎⁡(Scol,q1,q2)S^{*}_{\text{free}}\leftarrow\mathtt{BisectToFree}(S_{\text{col}},q_{1},q_{2})
12:   𝒫←𝙿𝚕𝚊𝚌𝚎𝙽𝚘𝚗𝚁𝚎𝚍𝚞𝚗𝚍𝚊𝚗𝚝𝙷𝚢𝚙𝚎𝚛𝚙𝚕𝚊𝚗𝚎𝚜⁡(𝒫,Sfree∗)\mathcal{P}\leftarrow\mathtt{PlaceNonRedundantHyperplanes}(\mathcal{P},S^{*}_{\text{free}})
13: end for
14: return 𝒫,𝚙𝚊𝚜𝚜𝚎𝚍\mathcal{P},\,\mathtt{passed}
Original mathematical definitions and guarantee conditions

In essence, EI-ZO samples points in the configuration space, counts the number of points in collision 𝙿𝚘𝚒𝚗𝚝𝚜𝙸𝚗𝙲𝚘𝚕𝚕𝚒𝚜𝚒𝚘𝚗\mathtt{PointsInCollision}, and checks if the number of colliding points is below a threshold defined by the statistical test 𝚄𝚗𝚊𝚍𝚊𝚙𝚝𝚒𝚟𝚎𝚃𝚎𝚜𝚝\mathtt{UnadaptiveTest}. The test checks if there is enough data to have confidence 1−δ1-\delta that the true fraction in collision is less than ε\varepsilon, given the observed samples. If the test passes, then, in all likelihood, a probabilistically safe polytope has been found. Otherwise, the collision points refine the polytope by generating additional hyperplanes at boundary points between free space and collision found by bisection (see Fig. 2). Then new samples are drawn from 𝒫\mathcal{P}, and the process iterates (more details see [35]).

Original mathematical definitions and guarantee conditions

To compute the probabilistic guarantees for the polytope generated by EI-ZO, we define an admissible volume fraction which allowed to be in collision ε\varepsilon and a confidence threshold δ\delta. Further, we introduce a decision threshold τ\tau, which is typically set to 0.50.5, in order to balance the power and cost of the statistical test. Consequently, the polytope returned by EI-ZO exhibits the probabilistic guarantee stated in Prop. 1.

Complete original Proposition 1, full hypotheses and numbered inequality.
Original selectable proposition and assumptions
Proposition 1 (Safe polytope [34]).

Let 𝒞ssafe\mathcal{C}_{s}^{\text{safe}} denote the true safe region at the current state ss. Let an error tolerance ε\varepsilon, a confidence δ\delta, and a decision threshold τ\tau be given. Suppose that 𝙻𝚘𝚌𝚊𝚕𝙿𝚘𝚕𝚢𝚝𝚘𝚙𝚎\mathtt{LocalPolytope} returns (𝒫s,𝚙𝚊𝚜𝚜𝚎𝚍)(\mathcal{P}_{s},\mathtt{passed}). Then, for any number of samples M≥2​log⁡(1/δ)(ε​τ2)M\geq\frac{2\log(1/\delta)}{(\varepsilon\tau^{2})}, 𝒫s\mathcal{P}_{s} satisfies

Equation 3
ℙ[𝚟𝚘𝚕⁡(𝒫s∖𝒞ssafe)𝚟𝚘𝚕⁡(𝒫s)>ε]≤δ.\mathbb{P}\left[\frac{\mathtt{vol}(\mathcal{P}_{s}\setminus\mathcal{C}_{s}^{\mathrm{safe}})}{\mathtt{vol}(\mathcal{P}_{s})}>\varepsilon\right]\leq\delta. (3)
Original mathematical definitions and guarantee conditions

Intuitively, the polytope returned by the algorithm has a low probability, δ\delta, of containing many unsafe states (specifically, a fraction greater than ε\varepsilon).

Original mathematical definitions and guarantee conditions

Our main adaptations to EI-ZO are threefold. First, we add the extra samples ℰ\mathcal{E} to the set of uniform configuration-space samples (Line 4, Alg. 1). In particular, the 4×D​o​F4\times DoF extra samples ℰ\mathcal{E} surround the local configuration edge q1q_{1} and q2q_{2} in axis-aligned directions (see Fig. 3). Typically, the q1q_{1} and q2q_{2} of interest are the current configuration qtq_{t} and candidate action configuration qt+atq_{t}+a_{t}. Second, we speed up termination at the expense of slightly more conservative sets by placing hyperplanes at the last collision-free point along the direction defined by q1q_{1} and q2q_{2}. As in EI-ZO, free points in a direction of interest are determined with bisection, but 𝙱𝚒𝚜𝚎𝚌𝚝𝚃𝚘𝙵𝚛𝚎𝚎\mathtt{BisectToFree} returns the last free instead of the last colliding point. Finally, the statistical test in EI-ZO (Line 7, Alg. 1) provides the probabilistic safety guarantee for the polytope stated in Prop. 1 only if the algorithm terminates within the maximum number of iterations NiterN_{\mathrm{iter}}. To detect if NiterN_{\mathrm{iter}} is sufficient to pass the statistical test, we return an additional Boolean value 𝚙𝚊𝚜𝚜𝚎𝚍\mathtt{passed}.

Complete original Fig. 3: Set of extra samples ℰ \mathcal{E} in configuration space surrounding the points of interest q 1 q_{1} and q 2 q_{2} .
Fig. 3: Set of extra samples ℰ\mathcal{E} in configuration space surrounding the points of interest q1q_{1} and q2q_{2}.
Original selectable diagram labels
  • c1c_{1}
  • c2c_{2}
  • q1q_{1}
  • q2q_{2}
  • Δmax\Delta_{\max}
  • ℰ={∙∣∀cDoF}\mathcal{E}=\{{\color[rgb]{0.9063,0.2969,0.2344}\bullet}\mid\forall c_{\text{DoF}}\}

IV-B Action Masking Safeguard

RayMask preserves the proposed direction and scales its magnitude by the ratio of polytope and action-set ray lengths when contraction is needed. It can intervene even for a currently collision-free proposal because it contracts the whole support in that direction. The resulting action distribution is generally not uniform over the polytope.

Proposition 2 applies only when all n polytope tests pass and gives an n×delta union bound on excessive unsafe volume. It does not bound arbitrary policy-action collision probability by delta. The discussion explicitly assumes uniform action selection to connect volume to risk; selecting just one point is not a proof of uniformity. A policy can concentrate on a small residual collision pocket. Even under genuine conditional uniformity, combining a good-region risk epsilon with a region-failure probability delta gives at most epsilon+delta×(1−epsilon), rather than delta alone. No density-control proof is provided for learned/adversarial RayMask outputs.

The fallback uses equal-sized steps toward the Chebyshev center when a test fails. It improves escape behavior empirically but has no retained certificate here; a failed test is not repaired mathematically by choosing an interior point.

Original mathematical definitions and guarantee conditions

Given a safe polytope, our aim is to define a safeguarding function ℱsafe\mathcal{F}^{\mathrm{safe}} such that only safe actions are executed. In other words, they lead to the next configuration qt+1q_{t+1} being within the safe polytope 𝒫s\mathcal{P}_{s}. To this end, we draw from ray masking in [20] to correct candidate actions aa consistent with the intended direction in configuration space to asafea^{\mathrm{safe}}. Effectively, ray masking radially contracts the support of the policy onto the safe polytope 𝒫s\mathcal{P}_{s}. The intended direction connects the current configuration qtq_{t} and the candidate action ata_{t}, and is called ”ray” (see Fig. 1). Note that since the current configuration qtq_{t} is used as the origin of the rays, ray masking will only produce a stopping action if the candidate action ata_{t} is the stopping action.

Original mathematical definitions and guarantee conditions

We summarize the adapted ray masking approach in Alg. 3. To efficiently determine if the ray direction requires action masking, we first check if the safe polytope 𝒫s\mathcal{P}_{s} fully encloses the state-dependent action set 𝒜⁡(s)\mathcal{A}(s) (Line 1, Alg. 3) or the polytope encloses the action set in the ray direction (Line 5, Alg. 3). In both cases, the action will remain the same, i.e., at=atsafea_{t}=a_{t}^{\mathrm{safe}}. If the action set intersects with the polytope in the ray direction, we proportionally move the actions towards the center on the ray (Line 9, Alg. 3). Intuitively, the closer the action is to the current configuration qtq_{t}, the smaller the correction (see Fig. 1). Finally, note that projecting unsafe actions to the boundary of the safe polytope would be an alternative to masking [4, 17]. However, for stochastic policies, projection places all unsafe actions on the polytope boundary [4, Fig. 2]. Consequently, the manipulation policy would need to frequently navigate near-collision configurations, which is often challenging. In contrast, radially contracting the action distribution, as with ray masking, leads to boundary actions only if these actions were on the boundary of the action set before.

Complete original Algorithm 2 X-Safe: Action Masking Safeguard, all Require/Ensure text and numbered lines.
Algorithm 2 X-Safe: Action Masking Safeguard
Original selectable algorithm
Require: Current configuration qtq_{t}, action set 𝒜\mathcal{A}, domain 𝒟\mathcal{D}, candidate actions a1:na_{1:n}.
Ensure: Safe actions asafe1:na^{\mathrm{safe}}_{1:n}, each in 𝒜\mathcal{A}.
1: q1←qtq_{1}\leftarrow q_{t}
2: for i=1,…,ni=1,\dotsc,n do
3:   𝒫,𝚙𝚊𝚜𝚜𝚎𝚍←𝙻𝚘𝚌𝚊𝚕𝙿𝚘𝚕𝚢𝚝𝚘𝚙𝚎⁡(𝒟,(qi,qi+ai),ε,δ,Niter,M)\mathcal{P},\mathtt{passed}\leftarrow\mathtt{LocalPolytope}(\mathcal{D},(q_{i},q_{i}+a_{i}),\varepsilon,\delta,N_{\mathrm{iter}},M) ⊳\triangleright Alg. 1
4:   if 𝚙𝚊𝚜𝚜𝚎𝚍\mathtt{passed} then
5:    aisafe←𝚁𝚊𝚢𝙼𝚊𝚜𝚔⁡(𝒫,𝒜,qi,ai)a^{\mathrm{safe}}_{i}\leftarrow\mathtt{RayMask}(\mathcal{P},\mathcal{A},q_{i},a_{i}) ⊳\triangleright Alg. 3
6:    qi+1←qi+aisafeq_{i+1}\leftarrow q_{i}+a^{\mathrm{safe}}_{i}
7:   else
8:    ai:nsafe←𝙲𝚑𝚎𝚋𝚢𝚜𝚑𝚎𝚟𝙵𝚊𝚕𝚕𝚋𝚊𝚌𝚔(𝒫,qi,𝒜,n−i+1)a^{\mathrm{safe}}_{i:n}\leftarrow\mathtt{ChebyshevFallback}(\mathcal{P},q_{i},\mathcal{A},n-i+1)
9:    break
10:   end if
11: end for
12: return asafe1:na^{\mathrm{safe}}_{1:n}
Complete original Proposition 2, full hypotheses and numbered inequality.
Original selectable proposition and assumptions
Proposition 2.

Let asafe1:na^{\mathrm{safe}}_{1:n} be a sequence of actions and sis_{i} the sequence of associated states computed from Alg. 2. If 𝚙𝚊𝚜𝚜𝚎𝚍\mathtt{passed} is true for all nn actions, it holds that

Equation 4
ℙ⁡[𝚟𝚘𝚕⁡(𝒫si∖𝒞sisafe)𝚟𝚘𝚕⁡(𝒫si)>ε,for some ​si]≤n​δ.\mathbb{P}\left[\frac{\mathtt{vol}(\mathcal{P}_{s_{i}}\setminus\mathcal{C}_{s_{i}}^{\mathrm{safe}})}{\mathtt{vol}(\mathcal{P}_{s_{i}})}>\varepsilon,\text{\emph{for some }}s_{i}\right]\leq n\delta. (4)
Original mathematical definitions and guarantee conditions

The proof follows directly from the union bound. In words, the probability that any of the computed polytopes contains many collisions is low. Conversely, the probability that all of them have few collisions, i.e., less than ε\varepsilon, is high, meaning at least 1−n​δ1-n\delta. For longer action sequences, our confidence in the safety of all polytopes degrades. Since policies are typically executed in a receding-horizon fashion with a short action sequence, this can be counteracted by a smaller δ\delta.

Original mathematical definitions and guarantee conditions

For a large number of iterations NiterN_{\mathrm{iter}}, we expect 𝚙𝚊𝚜𝚜𝚎𝚍\mathtt{passed} to be true. Since more iterations may prohibitively increase runtime for real-time deployment, Alg. 2 introduces a fallback controller which moves the configuration to the Chebyshev center of the candidate polytope 𝒫\mathcal{P}. Specifically, the fallback controller 𝙲𝚑𝚎𝚋𝚢𝚜𝚑𝚎𝚟𝙵𝚊𝚕𝚕𝚋𝚊𝚌𝚔\mathtt{ChebyshevFallback} outputs an action chunk of actions with the same magnitude, where the last action realizes the Chebyshev center. This fallback controller guides the manipulator away from unsafe configurations.

IV-C Implementation

Transfer relies on batched collision queries, a robot model and a current object-based scene twin. The domain is a local joint box, chosen as the action set in the experiments. Larger domains can see farther but require more sampling. A small confidence parameter or larger iteration budget changes the test/latency tradeoff; tuning to improve observed polytopes when tests fail is not a replacement for meeting the theorem’s conditions.

Original mathematical definitions and guarantee conditions

While our safeguard transfers easily to different embodiments and state-based as well as image-based policies, the core requirement is having access to the function 𝙿𝚘𝚒𝚗𝚝𝚜𝙸𝚗𝙲𝚘𝚕𝚕𝚒𝚜𝚒𝚘𝚗\mathtt{PointsInCollision}, which evaluates the function CC for many configuration samples. In practice, this is widely accessible, e.g., when an object-based scene representation is obtained from a perception system, and the robotic manipulator is described by a Unified Robot Description Format (URDF) file [36]. Further, we need to specify the domain 𝒟\mathcal{D}, which is typically an axis-aligned box centered at the current configuration. For our experiments, we found that 𝒟=𝒜\mathcal{D}=\mathcal{A} based on maximum joint differences was most effective from both safety and performance standpoints.

Original mathematical definitions and guarantee conditions

For Alg. 1, a small δ\delta leads to more iterations for convergence, and consequently increases runtime, but produces consistently better polytopes, even if 𝚄𝚗𝚊𝚍𝚊𝚙𝚝𝚒𝚟𝚎𝚃𝚎𝚜𝚝\mathtt{UnadaptiveTest} did not pass. Generally, setting a large number of maximum iterations NiterN_{\mathrm{iter}} is desired so that Alg. 1 almost never reaches NiterN_{\mathrm{iter}} iterations and consequently Prop. 2 empirically holds as well. Thus, a meaningful tuning approach is to first decrease δ\delta until the polytope reaches the desired refinement level, and then decrease NiterN_{\mathrm{iter}} to improve the runtime. For the parameter ε\varepsilon, we observed the least effects, and the chosen 0.020.02 balances sampling costs and avoiding collisions well.

V Experiments

The study covers two embodiments, state/image policies and human teleoperation across four task settings. Shared defaults use M=1,024, twelve iterations, delta=0.005, epsilon=0.02 and tau=0.5; the displayed sample-bound mismatch remains. Per-step joint limits are 0.015 for Panda/adversarial xArm and 0.03 for learned xArm, selected from dimension-wise action magnitudes. These are selected operating points rather than evidence of no calibration/tuning for arbitrary robots.

Original mathematical definitions and guarantee conditions

We demonstrate X-Safe on two embodiments and four tasks for state-based and image-based policies in simulation and on hardware (see Fig. 4). We specify the safeguard parameters in Table I. We set 𝒟=𝒜\mathcal{D}=\mathcal{A} and define the width of the box based on the maximum joint differences per single step Δmax\Delta_{\mathrm{max}}. While seemingly innocuous, this domain choice has important effects on the ray masking. If we set 𝒟\mathcal{D} larger than the maximum joint differences, then we will observe collisions farther in advance. If the set defined by maximum joint differences is fully enclosed in 𝒫s\mathcal{P}_{s}, masking will have no effect on the action. Yet, more samples are required to adequately query the larger domain, at no additional benefit. Specifically, we set Δmax=0.015\Delta_{\mathrm{max}}=0.015 for the Franka Panda and the adversarial teleoperation on the UFactory xArm7, and Δmax=0.03\Delta_{\mathrm{max}}=0.03 for UFactory xArm7 with a learned pick-and-place policy.

Complete original TABLE I: Hyperparameters.
TABLE I: Hyperparameters.
Accessible table, original values and footnotes
Description Name Value
Num. Particles MM 1024
Max Iterations NiterN_{\mathrm{iter}} 12
Confidence δ\delta 0.005
Fraction in Collision ε\varepsilon 0.02
Power parameter τ\tau 0.5
Complete original Fig. 4: Our experimental tasks (and embodiments):
(a) Cluttered pick-and-place (Franka Panda).
(b) Pick-and-place with an obstacle (UFactory xArm7).
(c) Safeguarding during adversarial human teleoperation (xArm7) in
(c1) cluttered and (c2) quasi-static environments.
Together these span two embodiments, state- and image-based policies, and human operator control.
Fig. 4: Our experimental tasks (and embodiments): (a) Cluttered pick-and-place (Franka Panda). (b) Pick-and-place with an obstacle (UFactory xArm7). (c) Safeguarding during adversarial human teleoperation (xArm7) in (c1) cluttered and (c2) quasi-static environments. Together these span two embodiments, state- and image-based policies, and human operator control.

V-A Franka Panda with state-based policy

In 200 reported Panda episodes, success is 73.3% for the unsafe diffusion policy, 53.2% for RAIL and 66.4% for X-Safe: losses of 20.1 versus 6.9 percentage points. Table II reports collision fractions of timesteps, not fractions of episodes, and lists X-Safe at 0.04±0.02%; the prose instead says 0.02%. Both source values remain. Seed/aggregation details behind the reported standard errors are not fully stated.

X-Safe intervenes on 54.2% of steps versus RAIL’s 22.5%, reflecting support contraction before a proposed action necessarily collides. Its fallback runs on about 4% of steps, outside the all-tests-pass condition. Replacing that fallback with stopping drops success from roughly 66% to 44%. Episode lengths and a stated CPU/GPU setup do not substitute for a measured safeguard-latency distribution or closed-loop deadline guarantee.

Complete original TABLE II: Evaluation on different embodiments.
TABLE II: Evaluation on different embodiments.
Accessible table, original values and footnotes
Method Success (%) ↑\uparrow Collision (%) ↓\downarrow Horizon ↓\downarrow
Franka Panda – [state observations] Pick and place a can in cluttered environment
DP 73.3±1.8\mathbf{73.3\pm 1.8} 31.3±4.831.3\pm 4.8 𝟗𝟏𝟏±𝟐𝟖\mathbf{911\pm 28}
RAIL 53.2±1.253.2\pm 1.2 0.8±0.40.8\pm 0.4 1245±41245\pm 4
DP + X-Safe 66.4±1.366.4\pm 1.3 0.04±0.02\mathbf{0.04\pm 0.02} 1057±171057\pm 17
UFactory xArm7 – [image observations] Pick and place into bin†
No obstacle 𝟔𝟒±9.6\mathbf{64\pm 9.6} N/A∗ 48.9±1.4\mathbf{48.9\pm 1.4} s
Obstacle 52±9.952\pm 9.9 100±0100\pm 0 53.7±1.6753.7\pm 1.67 s
Obstacle + X-Safe 44±9.944\pm 9.9 𝟎±𝟎\mathbf{0\pm 0} 96.6±5.696.6\pm 5.6 s

Deviations indicate standard error in the mean. † Horizon based on successful runs.
∗ No obstacle in the scene for the in-distribution baseline.

Original mathematical definitions and guarantee conditions

Table II presents our results. We report the task success rate per episode, the collision fraction of all time steps, and the average episode length. For the simulation experiment on the Franka Panda, we evaluated 200 episodes with maximum horizon of 2000 time steps and observed that the collision fraction with X-Safe is 0.02%0.02\%—lower than the 2%2\% expected from the formal safety guarantee. While RAIL [5] reduces the performance of the DP by 20%20\% compared to the unsafe benchmark, the performance drop under X-Safe is only 7%7\%. This is also reflected by the shorter average horizon for X-Safe. The intervention rate of X-Safe is 54.2±0.754.2\pm 0.7 percent of the time steps, which is higher than for RAIL. However, this is expected since action masking corrects actions when the free configuration space in the action direction is smaller than the action set, independent of the safety of the proposed action. Resulting in a look-ahead that essentially slows down the robot when approaching an unsafe region. In contrast, RAIL only intervenes when the proposed action sequence would lead to a collision, reflected by a lower intervention rate of 22.5±0.522.5\pm 0.5 percent. Lastly, we investigate the effect of the Chebyshev fallback controller, which is used on average for 4%4\% of the time steps. If we replace our fallback controller with a stopping fallback controller, the performance reduces from 66%66\% to 44%44\% as the arm deadlocks close to obstacles.

V-B UFactory xArm7 with image-based policy

A visuomotor diffusion transformer learns from 100 teleoperated demonstrations. Each hardware condition has 25 trials: success is 64% without the obstacle, 52% with it, and 44% with X-Safe. The obstacle baseline collides in every run; the safeguarded condition has zero observed collisions. Those finite counts do not establish zero deployment risk. Safeguarded failures include livelock between policy and fallback directions.

Successful safeguarded runs average 96.6 seconds versus 53.7 seconds for the obstacle baseline; these times condition on success, unlike a general per-episode latency measure. A 0.005 joint-space boundary margin triggers fallback even for passed polytopes. A separate homography-based obstacle estimate with 2 mm inflation yields zero collisions in twenty trials; this is a tested calibration setting, not a formal perception-error bound for all scenes.

Original mathematical definitions and guarantee conditions

We evaluate two different settings on a UFactory xArm7. First, we safeguard an image-based DP for a pick-and-place task. In particular, we augment the original obstacle-free task with a cylindrical obstacle that intersects with the typical path of the DP policy (see Fig. 4). To train an imitation learning policy, we collected 100 rollout demonstrations via teleoperation. The architecture of the policy is a conditional diffusion transformer model [37]. We use a standard score-matching reconstruction loss to train a visuomotor diffusion transformer that conditions on images and produces desired joint angles (in configuration space) and the gripper state. To increase the safety margin on hardware, we check if the infinity norm of the action to the polytope boundary is less than 5×10−35\times 10^{-3}, and switch to the Chebyshev fallback controller in this case, i.e., even with polytopes that passed the statistical test.

Original mathematical definitions and guarantee conditions

For pick-and-place with xArm7, we evaluated 25 runs on hardware for each of the three settings (see Table II). The baseline without the obstacles succeeds 64%64\% of the runs. Once the obstacle is introduced, the policy is operating out of the training distribution, which results in a performance drop to 52%52\% and collisions with the obstacle or table in every run. Specifically, the obstacle is hit in every run with varying severity (i.e., small contact forces to pushing the obstacle to fall over), and the table is hit in 8%8\% of the runs. When using X-Safe, the task is successfully executed in 44%44\% of the runs, and no collisions are observed. X-Safe trades 8 percentage points of success for the elimination of all collisions. The remaining task failures originate from a livelock: the fallback controller and the DP push in nearly opposite directions near the obstacle, loops away and toward the obstacle. The increased time horizon for a run with X-Safe originates from slower operation around the obstacle. This is also reflected by the intervention rate of 71.2±1.471.2\pm 1.4 percent for successful runs, where interventions occur when the robot operates over the obstacle and to avoid table collisions before picking up the object. In addition, we investigated the impact of perception uncertainty by calibrating camera-to-workspace estimates using homography. With the calibration, we estimated the obstacle’s position and inflated the obstacle by 2 mm2\text{\,}\mathrm{mm}, which reflects the calculated calibration error. When re-running the experiment with X-Safe and the estimated position, we observed no collisions in 20 runs.

V-C UFactory xArm7 with adversarial teleoperation

Human commands are absolute end-effector poses with downward-fixed orientation, converted by inverse kinematics to joint changes before masking. The clutter and newly introduced obstacle examples demonstrate selected guarded interactions. Quasi-static protection uses the updated virtual obstacle after perception detects it; dynamic-human motion and detection latency are not covered by the current result. No separate teleoperation trial denominator or broad adversarial stress distribution is reported.

Original mathematical definitions and guarantee conditions

We use a 3DConnexion Spacemouse to guide the robot. The Spacemouse commands are given as absolute end-effector poses. To extract joint configurations from these poses, we use the inverse kinematics solver from [38]. The target orientation is fixed to point down to simplify teleoperation. These actions, which are the difference between the target configuration and current configuration, are then ray masked to yield asafea^{\mathrm{safe}}. The resulting target configuration, qt+atsafeq_{t}+a^{\mathrm{safe}}_{t} is passed to the controller as a desired joint position.

Original mathematical definitions and guarantee conditions

Fig. 5 illustrates the teleoperated manipulator experiments. The human operator adversarially moves the arm toward obstacles to demonstrate the tightness of X-Safe interventions. For the cluttered environment (i.e., Fig. 5.c1), the manipulator can grasp between three objects. When the adversarial human is trying to hit the obstacle, the Chebyshev fallback controller consistently moves the arm away from collision. Additionally, we present a quasi-static environment (i.e., Fig. 5.c2). Once detected in the physical scene, an obstacle is added to the virtual environment simulated in parallel for the collision checking function CC. Consequently, on the path to the bin, the adversarial operator can no longer take the shortest path because X-Safe prevents them from hitting the obstacle.

Complete original Fig. 5: Human-operated experiments. (c1) Cluttered. Human is pushing toward the left-most blue box at t 1 t_{1} and arm stops at t 2 t_{2} ; then at t 3 t_{3} closely operating over a cluttered environment and dropping object into bin at t 4 t_{4} ; (c2) Quasi-static. Human navigates to the object on direct path, i.e., through the obstacle that will appear at t 3 t_{3} and is visualized in transparent green; at t 3 t_{3} , blue obstacle appears and blocks direct path.
Bottom: The magnitude of the difference between target end effector positions before and after masking, in millimeters.
Fig. 5: Human-operated experiments. (c1) Cluttered. Human is pushing toward the left-most blue box at t1t_{1} and arm stops at t2t_{2}; then at t3t_{3} closely operating over a cluttered environment and dropping object into bin at t4t_{4}; (c2) Quasi-static. Human navigates to the object on direct path, i.e., through the obstacle that will appear at t3t_{3} and is visualized in transparent green; at t3t_{3}, blue obstacle appears and blocks direct path. Bottom: The magnitude of the difference between target end effector positions before and after masking, in millimeters.

VI Discussion

The authors explicitly identify collision-predicate availability and perception-to-twin integration as central assumptions, and leave dynamic obstacles/spilling to future work. They also explicitly assume uniform action selection to interpret safe volume as action risk. Their rationale—one action selected per polytope—and low observed collision fractions do not establish that an arbitrary learned/adversarial policy is uniform or density-bounded. Extra directed samples help empirically without proving that bridge. Post-training masking changes the policy’s action distribution and reduces success; integrated training is proposed rather than evaluated.

Original mathematical definitions and guarantee conditions

The central assumption in X-Safe is the availability of the function CC. To implement CC, we use the simulation framework MuJoCo [36], which allows us to easily represent different environments and embodiments, compute forward kinematics, and check for collisions. However, the integration becomes more involved for quasi-static environments, where perception has to detect safety-relevant environmental changes and translate them into simulation objects. Further, for dynamic obstacles, like humans, or more diverse notions of safety, like not spilling liquid, future work is needed to identify rapidly evaluable violation functions CC.

Original mathematical definitions and guarantee conditions

The safety guarantee provided in Prop. 2 assumes uniform action selection from the safe polytope. Since only one action is selected from each polytope, the uniform assumption is reasonable, and our experimental evaluation confirmed this by producing lower collision rates than expected under the proposition. Additionally, the added samples ℰ\mathcal{E} ensure a coverage surrounding the intended robot path, which supports detecting collisions in this relevant region. Nevertheless, further empirical validation would be beneficial to substantiate that the assumption is conservative on a broader set of tasks, policies, and embodiments.

Original mathematical definitions and guarantee conditions

We used the parameters reported in Table I across tasks and embodiments to show that those can be set without significant tuning. The set 𝒟\mathcal{D} is varying according to Δmax\Delta_{\mathrm{max}}, where we took the 9090 percentile magnitude of actions, dimension-wise. The trade-off for 𝒟\mathcal{D} is that smaller reduces the number of samples required, while increasing the chance of adjusting more of the support of the policy. We defer the optimization 𝒟\mathcal{D} and other parameters to future work, as our goal is to demonstrate the ease of implementation and ability to transfer to other manipulators.

Original mathematical definitions and guarantee conditions

Our experiments investigate the effect of X-Safe post-training for a limited number of tasks. We consistently observe a performance reduction of varying significance. This is expected as a posteriori safeguarding changes the distribution compared to the policy’s training. To mitigate these distribution-shift effects, future work should fine-tune or train with X-Safe. Note that the differentiability of the function ℱsafe\mathcal{F}^{\mathrm{safe}} allows for considering X-Safe as part of the environment, [39, 17] or as part of the policy [20].

VII Conclusion

X-Safe shows useful collision reduction and a less damaging simulation safeguard tradeoff on the tested platforms. Its portable local-geometry procedure still depends on accurate scene/robot models, successful tests, compatible sample settings and an action-selection interpretation. The paper’s conclusion should be read with those formal conditions and its uncertified fallback, finite hardware trials and remaining livelocks. The complete original statements remain alongside these short notes.

Appendix: Ray masking algorithm

Algorithm 3 retains every enclosure test, ray-boundary computation and the full distance-ratio scaling rule. A printed comment on the second enclosure branch reverses the stated containment direction; the actual inequality checks whether the action-set boundary point is inside the polytope. The geometric map contracts support and preserves proposed direction where its ray lengths are defined; it is not a uniform random sampler or an independent collision checker.

Complete original Algorithm 3 𝚁𝚊𝚢𝙼𝚊𝚜𝚔 \mathtt{RayMask}, all Require/Ensure text and numbered lines.
Algorithm 3 𝚁𝚊𝚢𝙼𝚊𝚜𝚔\mathtt{RayMask}
Original selectable algorithm
Require: Safe polytope 𝒫s=⟨A,b⟩𝒫\mathcal{P}_{s}=\langle A,b\rangle_{\mathcal{P}}, state-dependent action set 𝒜\mathcal{A} with vertices v𝒜v_{\mathcal{A}}, current configuration qq, candidate action a∈𝒜a\in\mathcal{A} .
Ensure: Safe action asafe∈𝒫sa^{\mathrm{safe}}\in\mathcal{P}_{s}
1: if A​v𝒜−b≤0A\,v_{\mathcal{A}}-b\leq 0 then
2:   asafe=aa^{\mathrm{safe}}=a ⊳\triangleright Safe polytope 𝒫s\mathcal{P}_{s} encloses action set 𝒜\mathcal{A}
3: else
4:   qa𝒜=𝚌𝚘𝚖𝚙𝚞𝚝𝚎​_​𝙰​_​𝚋𝚘𝚞𝚗𝚍𝚊𝚛𝚢​(a,𝒜)q^{\mathcal{A}}_{a}=\mathtt{compute\_A\_boundary}(a,\mathcal{A}) ⊳\triangleright Identifying for closest boundary of 𝒜\mathcal{A} to ray
5:   if A​qa𝒜−b≤0A\,q^{\mathcal{A}}_{a}-b\leq 0 then
6:    asafe=aa^{\mathrm{safe}}=a ⊳\triangleright Action set 𝒜\mathcal{A} encloses 𝒫s\mathcal{P}_{s} in direction of candidate action
7:   else
8:    qa𝒫=𝚌𝚘𝚖𝚙𝚞𝚝𝚎​_​𝙿​_​𝚋𝚘𝚞𝚗𝚍𝚊𝚛𝚢​(a,𝒫s)q^{\mathcal{P}}_{a}=\mathtt{compute\_P\_boundary}(a,\mathcal{P}_{s}) ⊳\triangleright Identifying for closest halfspace of 𝒫s\mathcal{P}_{s} to ray
9:    asafe=‖qa𝒫−q‖‖qa𝒜−q‖​aa^{\mathrm{safe}}=\frac{\|q^{\mathcal{P}}_{a}-q\|}{\|q^{\mathcal{A}}_{a}-q\|}\,a ⊳\triangleright Adapted ray masking [20]
10:   end if
11: end if
12: return asafea^{\mathrm{safe}}
Concept demonstration

Open image ↗