TooBadRL: Trigger Optimization to Boost Effectiveness of Backdoor Attacks on Deep Reinforcement Learning

Songze Li, Mingxuan Zhang, Kang Wei, Shouling Ji · OpenReview

Abstract

Deep reinforcement learning (DRL) has achieved remarkable success in a wide range of sequential decision-making domains, including robotics, healthcare, smart grids, and finance. Recent research demonstrates that attackers can efficiently exploit system vulnerabilities during the training phase to execute backdoor attacks, producing malicious actions when specific trigger patterns are present in the state observations. However, most existing backdoor attacks rely primarily on simplistic and heuristic trigger configurations, overlooking the potential efficacy of trigger optimization. To address this gap, we introduce TooBadRL (Trigger Optimization to Boost Effectiveness of Backdoor Attacks on DRL), the first framework to systematically optimize DRL backdoor triggers along three critical axes: temporal, spatial, and magnitude. Specifically, we first introduce a performance-aware adaptive freezing mechanism for injection timing. Then, we formulate dimension selection as a cooperative game, utilizing Shapley value analysis to identify the most influential state variable for the injection dimension. Furthermore, we propose a gradient-based adversarial procedure to optimize the injection magnitude under environment constraints. Evaluations on three mainstream DRL algorithms and nine benchmark tasks show that TooBadRL significantly improves attack success rates while ensuring minimal degradation of normal task performance. These results highlight the previously underappreciated importance of principled trigger optimization in DRL backdoor attacks.

Introduction

Backdoor attacks represent a "sleeper agent" threat in Deep Reinforcement Learning (DRL). An agent behaves normally until it encounters a specific "trigger"—such as a specific sensor reading—at which point it executes a malicious action. While well-studied in static domains like image classification, DRL presents unique challenges because agents learn through sequential interactions.

Existing research has largely relied on simple heuristics for trigger design, such as randomly selecting sensors or using extreme boundary values. These "naive" triggers are often brittle, easily detected, or significantly degrade the agent's normal performance, making the attack obvious. TooBadRL moves away from these heuristics to systematically answer how to design the "perfect" trigger that maximizes malicious impact while remaining invisible.

Methodology

TooBadRL decomposes trigger design into three critical pillars, transitioning from trial-and-error to mathematical optimization:

  1. Injection Timing (Adaptive Freezing): Injecting a backdoor too early can prevent the agent from learning the primary task. TooBadRL uses a statistical "Adaptive Freezing" mechanism (based on the Wilcoxon Signed-rank Test) to monitor learning progress, only beginning the attack once normal task performance has stabilized.
  2. Trigger Dimension (Shapley Value Analysis): Not all inputs are equally important. Using SHAP (Shapley Additive Explanations) from cooperative game theory, the framework identifies which state dimensions (e.g., a specific joint angle in a robot) most influence the agent's policy, targeting only the most critical ones.
  3. Manipulation Magnitude (Gradient-Based Optimization): Rather than using extreme values, TooBadRL employs gradient descent to find the exact perturbation that maximizes the probability of a malicious action while staying within the bounds of realistic environment data.
The TooBadRL framework systematically optimizes triggers through injection timing, dimension selection, and magnitude optimization before backdoor implantation.

Results and Key Insights

The framework was evaluated across nine benchmark environments (including Classic Control, Box2D, and PyBullet robotics) against PPO, TRPO, and A2C algorithms.

  • The "Goldilocks" Timing: Results show a clear sweet spot for starting an attack. Starting at step zero prevents the agent from learning the task, while waiting too long makes the policy too rigid to change. Adaptive freezing successfully finds this balance.
  • Precision Over Power: One of the most significant findings is that perturbing a single, highly influential dimension is more effective than perturbing the entire state vector. This "less is more" approach significantly enhances stealth.
  • Stealth and Evasion: Because trigger magnitudes are optimized rather than extreme, they often fall within natural sensor ranges. In tests using the Neural Cleanse detector, TooBadRL achieved a 0% detection rate, whereas heuristic attacks were frequently flagged.
Impact of (a) Injection Timing, (b) Trigger Dimension, and (c) Manipulation Magnitude on Attack Success Rate (ASR) and Normal Task Performance (NTP).

On average, TooBadRL improved the Attack Success Rate (ASR) by 24% over baselines while maintaining a Normal Task Performance (NTP) of over 90%.

Conclusion

TooBadRL demonstrates that principled trigger optimization is essential for effective and stealthy backdoor attacks in DRL. While the current threat model assumes adversary control over the training process, it highlights a critical vulnerability in the DRL supply chain. Future work will explore temporal patterns and more robust defense mechanisms designed to monitor behavioral changes in high-influence state dimensions.

Summary updated

BibTeX
@misc{li2025toobadrl,
  author = {Songze Li and Mingxuan Zhang and Kang Wei and Shouling Ji},
  title = {{TooBadRL: Trigger Optimization to Boost Effectiveness of Backdoor Attacks on Deep Reinforcement Learning}},
  year = {2025},
  eprint = {2506.09562},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.09562},
}
Figure