arXiv:2610.12467cs.ROOct 2026

Manuscript Offprint

arXiv:2610.12467

CSF: Contextual Safety Filtering for Motion Generators

Lizhi Yang, Yiling Hou, Yao Tang, Junheng Li, Daniel Weng, Blake Werner, Aaron D. Ames

Lizhi Yang 1^{1}, Yiling Hou 1^{1}, Yao Tang 1^{1}, Junheng Li 1^{1}, Daniel Weng 2^{2}, Blake Werner 1^{1} and Aaron D. Ames 1^{1}

Abstract—Text-conditioned motion generators produce trackable whole-body motion, but they have no notion of scene-dependent safety: the same action may target an object or a person. Existing safeguards either inspect the prompt, require labeled motion data, or enforce geometric constraints; therefore, they do not directly account for how scene context changes a motion's meaning. We introduce contextual safety filtering (CSF), a training-free filter that grounds natural-language safety rules in safe and unsafe reference trajectories produced by the generator. For each active rule, safe and unsafe reference trajectories define an affine safety value that a safe reference tracking CBF-QP enforces. Across four pretrained generators with different architectures, CSF activates the intended rules in all explicit and scene-triggered unsafe cases and reduces the danger-event rate by up to 90%, while preserving 88 – 100% of benign motions. We demonstrate the complete system on a real-world Unitree G1, where it successfully prevents unsafe motions in a variety of scenarios, including interactions with humans and objects.

I. INTRODUCTION

Pretrained text-conditioned motion generators can map natural-language descriptions to whole-body motions that are smooth, physically feasible, and increasingly trackable by humanoid controllers [1]–[4]. However, physical feasibility alone does not determine whether a robot should execute a generated motion. Kicking a ball and kicking a nearby person can require nearly the same body motion, even though the target in the scene changes whether the action is permitted. A whole-body controller will track either reference, so the safety decision must account for the scene as well as the motion.

Existing safety mechanisms address only parts of this distinction. Language guardrails can be bypassed by adversarial or misleading prompts [5], and a prompt-only screen cannot verify whether the generated motion is directed toward a benign object or a person. Both a motion classifier and CSF require a safety specification. However, a separately trained classifier learns it from labeled clips and must be retrained or re-validated when the generator changes. CSF specifies unsafe behavior directly through natural-language rules. Inference-time guidance imposes spatial or physical objectives [6], [7] that specify where or how the body should move, rather than whether the requested act is permitted. Classical robot safety filters enforce geometric sets such as collision-free regions and joint limits [8], whereas the relevant harm here is semantic rather than geometric.

Figure

Fig. 1: Hardware overview from real Unitree G1 frames. For the same prompt, “Throw a forward punch,” the Semantic Gate combines language and vision to distinguish an object from a person: CSF passes the punch toward the object and redirects it to a safe motion when a person is present.

In this paper, we propose CSF (Contextual Safety Filtering), a training-free semantic safety filter that uses outputs from the frozen generator as safety references. For each rule, the generator produces a reference motion for the unsafe behavior and its safe alternative in the generator's native representation. The difference between the references defines a semantic direction, and the signed displacement of the generator's current output estimate along this direction gives an affine safety margin. A semantic context gate uses the command and scene entities to select which margins the QP enforces, allowing the same motion in a benign scene and filtering it when a protected entity is present (Fig. 1). A compact CBF-QP enforces the active margins: its barrier-only solution is the minimum-norm correction, while the safe-reference tracking objective redirects the estimate toward the safe alternative. The natural-language rule list provides the task-specific safety specification, and CSF trains neither an auxiliary safety model nor the motion generator.

CSF interfaces with each generator through the sampler's current estimate of its final output. The rule selection, margin, and QP remain fixed, while a backbone adapter specifies where to read this estimate and how strongly to track the safe reference. We evaluate CSF on Kimodo-G1 [1], ECHO [2], MotionHiFlow [3], and ARDY [4]. We also deploy the ARDY-based system on a real-world Unitree G1 with a pretrained SONIC whole-body tracker [9], where a runtime shield redirects the remaining reference when the scene changes.

Our contributions are as follows:

1^{1}California Institute of Technology, CA 91125, USA

2^{2}New York University, NY 10012, USA

  • We propose a training-free safety filter that uses natural-language rules, generator-produced reference motions,

This work is supported by The Dow Chemical Company project #227027AW and in part by Technology Innovation Institute.

and scene context to constrain generated motion without training an auxiliary model.

  • We formulate a CBF-QP with a safe-reference tracking objective over an affine semantic margin, prove per-step feasibility, invariance, and optimality for any tracking strength, recover minimum intervention and exact pass-through at γ=0\gamma = 0, and characterize the deployed ridge residual.

  • We evaluate the same filter across four pretrained generators and deploy the complete perception, generation, and tracking pipeline on a real-world Unitree G1, where the runtime shield redirects an executing action when a person enters view.

References (49)