arXiv:2610.24603cs.ROOct 2026

Manuscript Offprint

arXiv:2610.24603

Refuse the Harm, Complete the Task via Graph-of-Rules Planning for LLM-Enabled Robots

Ali Taheri, Alireza Taban, Qizhou Wang, Wanhua Li

ABSTRACT

Large Language Models (LLMs) are increasingly used in embodied AI for robotic manipulation and planning, but their deployment in physical systems exposes vulnerabilities such as jailbreak attacks that can induce unsafe behavior. Existing inference-time defenses are mainly evaluated on short instructions containing a single hazard, whereas realistic tasks may interleave safe and unsafe sub-tasks, conceal hazardous steps, or combine individually safe actions into unsafe outcomes. Such compound instructions make it harder for a single safety decision to distinguish hazardous sub-tasks from legitimate ones, increasing the risk of either overlooking the hazard or rejecting the entire instruction. Thus, we introduce safe task completion, a task that requires an LLM-enabled robot to refuse the harmful part of an instruction while completing its legitimate part. To address this problem, we propose RuleGraph, a multi-agent Graph-of-Rules planning framework that distributes safety enforcement across multiple reasoning and verification stages. Five cooperating agents are used to ground general safety principles into world-specific rules, assess the instruction's sub-tasks in context, and derive a safe goal from the legitimate ones. Planning toward this goal is then organized as a graph of rule-specific nodes, where higher-level nodes inherit the union of their parents' rules, and candidate plans are progressively verified and aggregated until a single plan satisfies every relevant rule. In this way, RuleGraph reduces reliance on a single centralized safety decision. We evaluate RuleGraph on pure-attack and compound instructions across two benchmarks in two different environments using Attack Success Rate (ASR) and Task Success Rate (TSR). RuleGraph reduces ASR to 0% on both benchmarks while achieving the highest TSR among all methods, reaching 98.57% on the RoboGuard benchmark and 84.54% on our long-horizon compound instructions.

1 Introduction

Large Language Models (LLMs) have advanced rapidly in recent years and have demonstrated strong reasoning capabilities, such as interpreting driving scenes and justifying decisions step by step in autonomous vehicles (Nie et al., 2025; Sima et al., 2025), or autonomously designing and executing scientific research (Boiko et al., 2023; Wuwu et al., 2025). These capabilities have also been largely used for robotic task planning and decision-making (Li et al., 2026; Driess et al., 2023; Huang et al., 2023b). As LLMs are increasingly used to translate natural-language instructions into robot behavior (Ahn et al., 2022; Liang et al., 2023; Huang et al., 2023a; Rana et al., 2023; Singh et al., 2023), their vulnerabilities can lead to physical safety risks.

BadRobot (Zhang et al., 2025) and RoboPAIR (Robey et al., 2025) show that jailbreak attacks can induce harmful actions in LLM-controlled robots. Unlike a chatbot's harmful text, these are actions executed in the world and can be difficult to reverse. In response, inference-time defenses aim to verify robot behavior before execution. RoboGuard (Ravichandran et al., 2026) grounds safety rules into world-specific Linear Temporal Logic (LTL) constraints for formal verification, while SafePlan (Obi et al., 2025) uses a multi-stage pipeline to screen instructions and verify generated plans. Other approaches address complementary risks, for example, VLSA (Hu et al., 2025) targets physical collision avoidance through control barrier functions.

†^{\dagger}Corresponding author: Wanhua Li (wanhua.li@ntu.edu.sg).

Figure

Figure 1: Two examples comparing RuleGraph with SafePlan and RoboGuard. Green marks a correct outcome, red a successful attack, and orange a full refusal of an instruction with a safe part. Left: a pure attack, which RuleGraph correctly refuses because no safe goal exists. Right: a compound instruction, where RuleGraph discards the unsafe step and completes only the safe part.

However, current inference-time defenses are evaluated on short attack instructions that target one hazardous behavior, and they often concentrate safety verification in a single stage. Such single-stage verification becomes unreliable when a hazardous step is hidden among many legitimate steps of a long-horizon instruction. The reason could be that LLMs become less reliable as a task grows longer and more complex, especially when they must reason about the whole task at once (Liu et al., 2024; Besta et al., 2024). Moreover, some existing defenses rely on formal safety specifications written in LTL. When such a specification is produced by an LLM in a single unverified pass, it may not reflect the scene properly, and our experiments show that on long-horizon compound tasks the resulting constraints can be incomplete or incorrect. As a result, a defense that judges the instruction as a whole may either overlook the hidden unsafe sub-task or reject the instruction and discard its legitimate parts. For example, in Figure 1 (right), RoboGuard accepts the hazardous sub-task of leaving the oven on with its door open, whereas SafePlan refuses the instruction altogether, including the harmless request to put the oven mitt on the counter. We therefore argue that, instead of simply accepting or rejecting an instruction, an LLM-enabled robot should refuse its harmful sub-tasks while completing its legitimate ones, a problem we refer to as safe task completion.

To address this limitation, we propose Graph-of-Rules Planning, termed RuleGraph. RuleGraph decomposes the problem into smaller sub-problems that an LLM can solve more reliably. This distributes safety enforcement across multiple reasoning and verification stages. RuleGraph grounds general safety principles in the symbolic world and robot skills, then instantiates an independent planning node for each relevant rule. Each node generates, verifies, and refines a candidate plan against its assigned rule, after which the resulting plans are progressively combined through hierarchical aggregation until a single plan satisfies all relevant rules. This distribution gives subsequent stages additional opportunities to detect, refine, or reject unsafe behavior when an earlier component fails. While the rules define what a plan must avoid, a safe goal defines what it must achieve. RuleGraph splits the instruction into sub-tasks, judges each one in the context of the full instruction, and derives this goal from the legitimate ones. Every node plans toward this same goal. As a result, for an instruction containing at least one legitimate sub-task, RuleGraph neutralizes the unsafe behavior while still accomplishing the safe goal, rather than merely recognizing the attack. This addresses the loss of usefulness that can result from overly conservative safety mechanisms (Yuan et al., 2025; Ding et al., 2025; Wu et al., 2024; Yoon et al., 2025).

This paper makes three contributions.

• To the best of our knowledge, we are the first to address safe task completion in embodied safety, moving beyond accepting or rejecting an instruction as a whole.

• We propose a Graph-of-Rules planning method, which assigns each relevant safety rule to a dedicated node of a graph and progressively merges the resulting per-rule plans into a single plan that satisfies every rule.

• We evaluate RuleGraph on the RoboGuard benchmark and on Compound, our set of 97 long-horizon compound instructions. It achieves 0% Attack Success Rate (ASR) on both, with a Task Success Rate (TSR) of 98.57% and 84.54%, respectively.