Abstract
Safe reinforcement learning (RL) trains a policy to maximize the task reward while satisfying safety constraints. While prior works focus on the performance optimality, we find that the optimal solutions of many safe RL problems are not robust and safe against carefully designed observational perturbations. We formally analyze the unique properties of designing effective observational adversarial attackers in the safe RL setting. We show that baseline adversarial attack techniques for standard RL tasks are not always effective for safe RL and propose two new approaches - one maximizes the cost and the other maximizes the reward. One interesting and counter-intuitive finding is that the maximum reward attack is strong, as it can both induce unsafe behaviors and make the attack stealthy by maintaining the reward. We further propose a robust training framework for safe RL and evaluate it via comprehensive experiments. This paper provides a pioneer work to investigate the safety and robustness of RL under observational attacks for future safe RL studies.
Introduction
Reinforcement Learning (RL) has demonstrated remarkable capabilities in complex control tasks. However, its deployment in safety-critical domains like autonomous driving and robotics is hindered by the lack of safety guarantees. Safe RL addresses this by formulating the problem as a Constrained Markov Decision Process (CMDP), where the goal is to maximize a reward signal $V_r^\pi$ while ensuring that a cost signal $V_c^\pi$ remains below a threshold $\kappa$.
While significant progress has been made in achieving optimality within these constraints, the robustness of these "safe" policies to observational noise remains largely unexplored. In real-world scenarios, sensors are prone to noise and malicious perturbations. This paper investigates how tiny, calculated changes to an agent's observations can lead to catastrophic safety violations, even when the agent appears to be performing well on its primary task.
Adversarial Attacks in Safe RL
The authors identify a critical vulnerability in Safe RL: the "Temptation" trap. Because safe policies often operate at the edge of the safety boundary to maximize reward, they are susceptible to attackers that nudge them into unsafe regions. Two novel attack strategies are proposed:
- Maximum Cost (MC) Attacker: A direct approach that seeks the smallest perturbation to maximize expected constraint violations.
- Maximum Reward (MR) Attacker: A more insidious strategy that perturbs observations to make unsafe, high-reward regions appear reachable and safe. This "siren song" lures the agent into danger while maintaining high reward metrics, making the attack difficult to detect via standard performance monitoring.
Robust Training Framework
To mitigate these vulnerabilities, the paper introduces an adversarial training meta-algorithm. The core idea is to augment the training process by exposing the Safe RL learner to observations perturbed by the MC and MR adversaries. By training against these "worst-case" scenarios, the resulting policy $\pi$ learns to be observationally robust. The authors provide theoretical grounding for this approach, demonstrating that the training process remains stable and converges to a robust policy.
Experimental Evaluation
The framework was evaluated using the Bullet-safety-gym benchmark across various robot models (Car, Drone, Ant). The results highlight a stark reality: vanilla Safe RL agents are extremely fragile. Under even minor perturbations, their safety costs spike significantly.
Key findings from the experiments include:
- The Power of Stealth: The MR attack often proved more effective than the MC attack at inducing unsafe behavior because it exploits the agent's inherent objective to maximize reward.
- Defense Efficacy: The proposed adversarial training (ADV-PPOL) consistently maintained safety (cost $\le \kappa$) across all tested environments, even under the strongest attacks, whereas baseline robust RL methods like SA-PPO failed to prioritize the safety constraint effectively.
Conclusion
This work reveals that safety in RL is not just about satisfying constraints during clean training, but also about maintaining those constraints under adversarial conditions. The discovery of the Maximum Reward attack demonstrates that high performance can mask dangerous vulnerabilities. The proposed robust training framework offers a path forward for developing RL agents that are truly safe for deployment in the unpredictable real world. Future work will look toward scaling these defenses to high-dimensional inputs and off-policy learning algorithms.
Summary updated