A Framework for Benchmarking and Aligning Task-Planning Safety in LLM-Based Embodied Agents

Yuting Huang, Leilei Ding, Zhipeng Tang, Tianfu Wang, Xinrui Lin, Wuyang Zhang, Mingxiao Ma, Yanyong ZhangarXiv 2025 · DOI

Abstract

Large Language Models (LLMs) have significantly advanced the planning capabilities of embodied agents. However, these models often lack the physical common sense required to ensure safety in real-world environments. This paper introduces Safe-BeAl, an integrated framework designed to benchmark and align task-planning safety. We present SafePlan-Bench, a comprehensive safety evaluation suite, and Safe-Align, a preference optimization method that targets critical "pivot points" in unsafe plans. Our results demonstrate that Safe-Align improves agent safety by up to 15% over GPT-4 baselines without compromising task success rates.

Introduction

While current research in embodied AI emphasizes task success—such as a robot successfully organizing a kitchen—the safety of the generated plans is frequently neglected. An agent might achieve its primary goal while inadvertently creating significant hazards, such as placing flammable materials near heat sources or leaving toxic substances accessible.

Examples of safety hazards in LLM-generated plans, highlighting the gap between task success and physical safety.

The "safety gap" arises from two primary issues: a lack of systematic evaluation for safety violations and knowledge misalignment, where LLMs hallucinate plans that are logically consistent but physically dangerous.

The Safe-BeAl Framework

To address these challenges, we propose Safe-BeAl, which formalizes safety through two distinct constraints:

  1. Process Safety ($C_{proc}$): Ensures every individual action within a plan is safe.
  2. Termination Safety ($C_{term}$): Ensures the final state of the environment does not pose a risk.
The Safe-BeAl framework overview: (a) Safety definition and detection pipeline; (b) The Safe-Align process comparing negative and positive samples to optimize agent behavior.

Safety Detection and Alignment

We developed a modular Safety Detector integrated into the VirtualHome simulator. This tool maps actions and environment states to eight harm categories (e.g., Fire, Electrical, Poisoning).

To rectify unsafe behaviors, we introduce Safe-Align, a preference optimization method. Unlike standard fine-tuning, Safe-Align identifies the "pivot point"—the specific atomic action where a plan deviates from safety. By applying weighted rewards to these critical steps, the model learns to avoid hazards without suffering from the "alignment tax," preserving its general planning intelligence.

SafeRisks Dataset

We introduce SafeRisks, a dataset comprising 2,027 daily tasks across various household environments. To ensure a diverse range of realistic hazards, we employed a "Multi-Agent Acting" strategy, prompting LLMs to role-play as safety experts (e.g., firefighters, parents) to brainstorm potential risks. This dataset serves as the foundation for training and evaluating safe embodied agents.

Key Results and Insights

Our evaluation reveals several critical findings:

  • Safety is not a byproduct of scale: Even frontier models like GPT-4 achieved only ~83% safety on the SafeRisks benchmark, indicating that increased model size does not automatically resolve physical safety concerns.
  • Termination Safety Challenges: Agents generally perform better at avoiding immediate dangerous actions (Process Safety) than at ensuring the final environment state is safe (Termination Safety).
  • Performance Gains: Safe-Align improved safety rates by 8.55% to 15.22% compared to GPT-4. Notably, aligned open-source models like Llama-3-8B outperformed GPT-4 in safety metrics while maintaining high task success rates.

Conclusion

Safe-BeAl provides a robust foundation for developing safer embodied agents. Future work will focus on extending the framework to multimodal inputs (e.g., vision and depth) to detect hazards not explicitly stated in text and exploring more sophisticated error localization techniques to understand the underlying reasoning behind unsafe LLM plans.

Summary updated

BibTeX
@misc{huang2025framework,
  author = {Yuting Huang and Leilei Ding and Zhipeng Tang and Tianfu Wang and Xinrui Lin and Wuyang Zhang and Mingxiao Ma and Yanyong Zhang},
  title = {{A Framework for Benchmarking and Aligning Task-Planning Safety in LLM-Based Embodied Agents}},
  year = {2025},
  eprint = {2504.14650},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2504.14650},
}
Figure