TRAP: Tail-aware Ranking Attack for World-Model Planning

Siyuan Duan, Ke Zhang, Xizhao LuoarXiv 2026

TL;DR

This paper introduces TRAP, a novel inference-time backdoor attack that specifically targets the trajectory ranking mechanism in world-model-based agents. By subtly manipulating the ordering of imagined future trajectories, TRAP can reliably hijack long-horizon planning and cause significant performance degradation, even while maintaining normal behavior on clean inputs. This work highlights a critical new security vulnerability in increasingly prevalent world models.

What Problem Does This Paper Address?

World models are becoming a cornerstone of advanced AI agents, enabling them to plan for the future by simulating potential outcomes (imagined trajectories). This "imagination" allows for long-horizon reasoning, crucial for tasks like robotics and autonomous driving. However, this very mechanism of generating and evaluating many future possibilities also introduces a new attack surface. Existing backdoor attacks, which typically target one-step predictions or local features, are often ineffective against world models because the planning process can smooth out or "wash out" these shallow perturbations over time. The paper identifies a more fundamental vulnerability: the way world models rank these imagined trajectories to make decisions. Disrupting this ranking, especially for the few "decision-critical" trajectories that heavily influence the final choice, can systematically mislead the agent's planning over extended horizons. The core problem is how to effectively and stealthily attack this ranking mechanism at inference time, without altering the model's training or parameters.

Methods

TRAP (Tail-aware Ranking Attack for World-Model Planning) is an inference-time attack that operates by injecting a small visual trigger into the agent's observations. The key innovations are:

  • Tail-Aware Ranking Loss: Instead of trying to uniformly degrade all imagined trajectories, TRAP focuses on the "long tail" of high-scoring trajectories that disproportionately influence the agent's decision. It uses a tail-aware objective to specifically suppress the scores of these critical trajectories.
  • Dual Gating Mechanisms: To ensure stable and controlled attacks, TRAP employs two gating losses:
  • Sign Gate: Penalizes updates that move in the wrong direction (i.e., increase the score of a trajectory that should be suppressed).
  • Magnitude Gate: Prevents overly aggressive suppression of scores, which could destabilize optimization and lead to unnatural behavior.
  • Patch-Based Attack: The attack is implemented as a spatially localized visual patch applied to observations. The patch parameters are optimized to achieve the desired ranking manipulation, subject to a perturbation budget.
  • Inference-Time Operation: TRAP does not require access to the training data or model parameters. It operates by collecting a small set of proxy trajectories from the target agent and optimizing the trigger patch offline.

Datasets

The paper evaluates TRAP on a diverse set of reinforcement learning environments, including:

  • DeepMind Control Suite: For continuous-control tasks (e.g., cheetah-run, walker-walk).
  • Crafter: For sparse-reward planning scenarios.
  • Atari Games: For visually rich, discrete-action decision-making (e.g., seaquest, pong, breakout, invaders).

These environments are chosen to test the attack's effectiveness across different reward structures, planning horizons, and visual complexities.

Key Insights and Ideas

  • Ranking is the Achilles' Heel: The most critical insight is that world-model planning is highly sensitive to the relative ranking of imagined trajectories, not just their absolute scores. This provides a more fundamental and robust attack vector than manipulating individual predictions.
  • Long-Tail Vulnerability: The skewed distribution of trajectory scores, where a few high-scoring trajectories dominate, is the key to TRAP's success. By targeting this "tail," the attack can have a disproportionately large impact on decision-making.
  • Inference-Time Attacks are Feasible and Dangerous: TRAP demonstrates that potent backdoor attacks can be mounted at inference time, without needing to compromise the training process. This is particularly concerning for deployed agents.
  • Attack Persistence: The trigger-induced deviations in latent states persist over long planning horizons, preventing the effects from being washed out by the world model's dynamics.

Key Results

  • TRAP consistently outperforms a random patch baseline across both DreamerV3 and TD-MPC2, achieving significantly higher Mean Return Drop (indicating greater performance degradation) and Attack Success Rate (ASR).
  • On Crafter, TRAP achieved a 63.2% Mean Return Drop and 98.1% ASR, compared to near-zero degradation for the random baseline.
  • For many tasks, TRAP achieved near-perfect ASR (100.0%), indicating highly reliable disruption of agent behavior.
  • The attack remains effective even with small patch sizes and moderate perturbation budgets, though larger budgets and sizes increase effectiveness.
  • TRAP shows robustness against common image-space defenses (median filtering, JPEG compression), though these defenses do reduce its effectiveness to some extent.

Limitations and Future Work

  • Defense Robustness: While TRAP is somewhat robust to common image defenses, it is not entirely immune. Further research into more sophisticated defenses against such attacks is warranted.
  • White-Box Assumption: The current threat model assumes white-box access to the target world model. Future work could explore black-box or grey-box attack scenarios.
  • Generalizability: While TRAP is shown to work across different world-model paradigms (DreamerV3, TD-MPC2), its effectiveness on a wider range of models and tasks could be further investigated.
  • Ethical Implications: The paper highlights the critical need for security evaluations and defenses for world-model-based agents before their deployment in safety-critical applications, underscoring the ethical considerations of AI security.

Summary updated

BibTeX
@misc{duan2026trap,
  author = {Siyuan Duan and Ke Zhang and Xizhao Luo},
  title = {{TRAP: Tail-aware Ranking Attack for World-Model Planning}},
  year = {2026},
  eprint = {2605.01950},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.01950},
}
Figure