International Symposium on Leveraging Applications of Formal Methods, Verification, and Validation • Kos, Greece
Time: Wednesday, 28.10
Room: Room 4
Authors: Stefan Pranger, Bettina Könighofer
Abstract: Safe exploration is a key challenge in Reinforcement Learning (RL) that aims to prevent agents from making decisions that could cause harm while exploring their environment. Shielding is one such technique that assumes domain knowledge in the form of a model of the environment to decide upon the safety of an action. Although shielding is a well-established approach, it has seen limited application in RL due to significant barriers. The main obstacle is the lack of an accessible end-to-end infrastructure that connects formal shield synthesis with standard RL frameworks. As a result, applying shielding often requires expertise in formal methods and substantial engineering effort to construct probabilistic models, which has kept it outside the typical RL workflow. We address this problem by extending \tempest into a practical backend for safe RL. Our core contribution is \tempestpy, a Python library that integrates Tempest-based shield synthesis directly into the Gymnasium API, allowing shields to be synthesized and deployed within existing RL pipelines. This substantially lowers the barrier to entry for shielding and turns formal safe-exploration methods into a usable component for RL practitioners. In this setting, specifying a model of the environment becomes the remaining requirement rather than the primary integration challenge. In addition, we extend Tempest’s algorithmic support to compute sound shields for stochastic multiplayer games, thereby preserving formal safety guarantees. We demonstrate the resulting workflow end to end and evaluate shielded and unshielded RL across multiple environments. To facilitate the modeling step, we provide symbolic models for MiniGrid and introduce MiniGridSafe, a collection of playground environments designed to make shielding easily accessible and experimentally transparent. MiniGridSafe extends MiniGrid with safety-oriented scenarios featuring probabilistic transitions and additional agents, enabling the study of challenging safety aspects in a simple and intuitive setting.
Paper: 978-3-032-40121-2_9