ApX logoApX logo
ModelsCalculatorHardwareCoursesPricing
ApX logoApX logo
ModelsCalculatorHardwareCoursesPricing

All Courses

Advanced Adversarial Machine Learning
Chapter 1: Foundations of Adversarial ML Security
Review of Machine Learning Security Vulnerabilities
Threat Models in Machine Learning
Attack Surfaces: Training vs. Inference
Mathematical Formulation of Adversarial Examples
Taxonomy of Adversarial Attacks
Overview of Defense Strategies
Chapter 2: Advanced Evasion Attacks
Gradient-Based Attacks: FGSM, BIM, PGD Analysis
Optimization-Based Attacks: Carlini & Wagner Methods
Score-Based Attack Techniques
Decision-Based Attack Techniques
Transferability of Adversarial Examples
Attacking Ensemble Models
Implementing Evasion Attacks: Hands-on Practical
Chapter 3: Data Poisoning and Backdoor Attacks
Poisoning Attack Strategies: Availability vs Integrity
Targeted Data Poisoning Techniques
Backdoor Attack Mechanisms and Trigger Design
Clean-Label Poisoning Attacks
Analyzing Poisoning Impact on Model Training
Crafting Data Poisoning Attacks: Hands-on Practical
Chapter 4: Model Inference and Privacy Attacks
Membership Inference Attacks: Theory and Methods
Attribute Inference Techniques
Model Inversion and Reconstruction Attacks
Model Stealing: Functionality Extraction Methods
Relationship to Differential Privacy
Implementing Membership Inference: Hands-on Practical
Chapter 5: Robust Defense Mechanisms
Adversarial Training: Principles and Variations
Certified Defenses: Randomized Smoothing
Input Transformation Defenses
Gradient Masking and Obfuscation Issues
Defending Against Poisoning and Backdoors
Implementing Adversarial Training: Hands-on Practical
Chapter 6: Evaluating Model Robustness
Metrics for Adversarial Robustness
Benchmarking Tools and Frameworks
Adaptive Attacks: Evaluating Defenses Properly
Security Evaluations under Different Threat Models
Interpreting Robustness Evaluation Results
Setting up Robustness Benchmarks: Hands-on Practical
Chapter 7: Adversarial Examples in Specific Domains
Adversarial Attacks on Computer Vision Models
Generating Adversarial Text for NLP Models
Attacks on Reinforcement Learning Agents
Physical Adversarial Attacks
Domain-Specific Attack Considerations
Generating Adversarial Text: Practice

Attacks on Reinforcement Learning Agents

Reinforcement Learning (RL) presents a distinct set of challenges and opportunities for adversarial attacks compared to supervised learning paradigms like computer vision or natural language processing. Unlike models that process static inputs, RL agents operate within an interactive loop, making sequential decisions based on observations from an environment to maximize a cumulative reward signal. This dynamic interaction opens up unique attack vectors.

Adversarial attacks against RL agents aim to manipulate the agent's learned policy, π(a∣s)\pi(a|s)π(a∣s), causing it to take suboptimal or malicious actions. These attacks can be broadly categorized based on when they occur (during training or testing) and what component of the RL loop they target (observations, rewards, or actions).

Test-Time Attacks on RL Agents

Test-time attacks, analogous to evasion attacks in supervised learning, occur after the agent has been trained and deployed. The attacker's goal is typically to perturb the agent's observations (states) minimally such that the agent selects significantly worse actions than it would normally.

For example, an agent interacts with an environment. At each timestep ttt, the agent observes state sts_tst​, selects an action at∼π(a∣st)a_t \sim \pi(a|s_t)at​∼π(a∣st​), receives a reward rtr_trt​, and transitions to the next state st+1s_{t+1}st+1​. An attacker might introduce a small perturbation δt\delta_tδt​ to the observed state sts_tst​, resulting in an adversarial state st′=st+δts'_t = s_t + \delta_tst′​=st​+δt​. The agent then acts based on this perturbed state: at′∼π(a∣st′)a'_t \sim \pi(a|s'_t)at′​∼π(a∣st′​).

The attacker's objective can be formulated in several ways, often aiming to minimize the expected cumulative reward (or maximize a cost function) starting from the perturbed state. For an attack at timestep ttt, the objective might be to find a perturbation δt\delta_tδt​ with bounded norm (e.g., ∣∣δt∣∣p≤ϵ||\delta_t||_p \leq \epsilon∣∣δt​∣∣p​≤ϵ) that minimizes the expected return:

min⁡δt:∣∣δt∣∣p≤ϵE[∑k=t∞γk−trk∣st′=st+δt,ak∼π(a∣sk′) for k≥t]\min_{\delta_t: ||\delta_t||_p \leq \epsilon} \mathbb{E} \left[ \sum_{k=t}^{\infty} \gamma^{k-t} r_k \mid s'_t = s_t + \delta_t, a_k \sim \pi(a|s'_k) \text{ for } k \ge t \right]δt​:∣∣δt​∣∣p​≤ϵmin​E[k=t∑∞​γk−trk​∣st′​=st​+δt​,ak​∼π(a∣sk′​) for k≥t]

Where γ\gammaγ is the discount factor.

If the policy π\piπ is differentiable with respect to its input state (common in deep RL using neural networks), gradient-based methods like FGSM or PGD can be adapted. For example, using the value function V(s)V(s)V(s) or Q-function Q(s,a)Q(s, a)Q(s,a) which estimate the expected return, an attacker could compute the gradient with respect to the state input and perturb the state in the direction that decreases the expected value.

Example: FGSM-like Attack on Value Function

If the agent uses a value function Vθ(s)V_\theta(s)Vθ​(s) parameterized by θ\thetaθ, an attacker could craft a perturbation δ\deltaδ to minimize the predicted value:

δ=−ϵ⋅sign(∇sVθ(s))\delta = -\epsilon \cdot \mathrm{sign}(\nabla_s V_\theta(s))δ=−ϵ⋅sign(∇s​Vθ​(s)) s′=s+δs' = s + \deltas′=s+δ

This aims to make the agent perceive the current state as less valuable, potentially leading to suboptimal actions. Similar approaches can target the Q-function or the policy network directly.

Challenges in test-time RL attacks include:

  • Temporal Consistency: Perturbations might need to be applied consistently over multiple timesteps to achieve a lasting effect.
  • Partial Observability: In Partially Observable Markov Decision Processes (POMDPs), the agent acts based on observations oto_tot​, which may not fully reveal the true state sts_tst​. Attacks must perturb observations effectively despite this incomplete information.
  • Non-Differentiable Policies/Environments: If parts of the policy or environment simulation are not differentiable, gradient-based methods fail. Attackers might resort to score-based or decision-based black-box techniques, querying the agent and observing outcomes to estimate gradients or find vulnerabilities.

Training-Time Attacks on RL Agents

Training-time attacks, similar to data poisoning, target the learning process itself. The attacker manipulates the agent's training experience to embed vulnerabilities or degrade performance.

Attack Vectors:

  1. Observation Poisoning: The attacker subtly modifies the states or observations presented to the agent during training. This can steer the agent towards learning incorrect state-action mappings or embedding backdoors.
  2. Reward Poisoning: The attacker manipulates the reward signal rtr_trt​ received by the agent. By providing misleading rewards, the attacker can incentivize the agent to learn a policy that serves the attacker's goals (e.g., reaching a specific unsafe state) or simply performs poorly overall.
  3. Action Poisoning: In some settings (e.g., imitation learning or offline RL), the attacker might control or modify the actions taken during data collection, leading the agent to learn from flawed trajectories.

Example: Backdoor via Reward Poisoning

An attacker could modify the reward function during training such that the agent receives unusually high rewards for reaching a specific, otherwise undesirable, state only when a subtle trigger is present in the observation. For instance, in a self-driving car simulation, a specific rare visual pattern (the trigger) in the observation, paired with reaching a dangerous location, could be artificially rewarded during training. After deployment, if the agent observes this trigger, its poisoned policy might drive it towards the dangerous location.

The diagram below illustrates points where an attacker might intervene in the standard RL loop:

Potential attack points in the RL agent-environment interaction loop. Red 'X' indicates test-time perturbation of observations. Orange 'X' indicates training-time poisoning of observations or rewards.

Training-time attacks are often more powerful but harder to execute, as they typically require influence over the training environment or data generation process. Defending against these attacks involves learning algorithms, anomaly detection in training data (states, rewards), and secure environment design.

Understanding these RL-specific attack vectors is essential for developing secure autonomous systems. Defenses often involve policy optimization techniques, adversarial training adapted for sequential decisions, and methods to detect or filter poisoned experiences. The evaluation of robustness in RL also requires careful attention to the sequential and interactive nature of the problem.

© 2026 ApX Machine Learning