Anomaly-Gym: A Benchmark for Anomaly Detection in Reinforcement Learning Environments

TMLR Paper7913 Authors

13 Mar 2026 (modified: 27 Mar 2026)Under review for TMLREveryoneRevisionsBibTeXCC BY 4.0
Abstract: Anomaly detection (AD) is a key component for deploying reinforcement learning (RL) agents in safety-critical environments, enabling systems to identify unexpected conditions and trigger safe fallback behavior. Despite its importance, research on AD in RL settings is limited. Only a handful of methods have been proposed which - due to the absence of established evaluation scenarios - are evaluated on simple, small-scale, and self-proposed environments. This results in poor comparability and limits systematic analysis of the strengths and weaknesses of current approaches, thus fundamentally impeding progress in this direction. We address this problem by introducing Anomaly-Gym, a comprehensive evaluation suite for AD in RL settings. In contrast to prior work, Anomaly-Gym is based on principled design criteria that disentangle evaluation from methodology. By enforcing specific constraints on the environments and anomalies considered, we propose a broad spectrum of evaluation data that covers both simulated and real-world tasks. In total, our benchmark features 10 different environments, 25 anomaly types, 4 strength levels, as well as multiple sensor modalities. We demonstrate the importance of these different aspects in a series of experiments on pre-generated datasets. For instance, we show that simple methods, while generally neglected in previous work, achieve competitive scores for settings with observational disturbances. In contrast, detecting perturbations of actions or environment dynamics requires more complex methods. Our findings also highlight current challenges with anomaly detection on image data and provide directions for future research.
Submission Type: Regular submission (no more than 12 pages of main content)
Assigned Action Editor: ~Marcello_Restelli1
Submission Number: 7913
Loading