SafeRL-Lite: A Lightweight, Explainable, and Constrained Reinforcement Learning Library

Satyam Mishra, Phung Thao Vi, Shivam Mishra, Vishwanath Bijalwan, Vijay Bhaskar Semwal +1 more
6/17/2025
cs.LGcs.AI

Official code: satyamcser/saferl-lite (3 stars, MIT, last commit 2025-06-29).

Abstract

We introduce SafeRL-Lite, an open-source Python library for building reinforcement learning (RL) agents that are both constrained and explainable. Existing RL toolkits often lack native mechanisms for enforcing hard safety constraints or producing human-interpretable rationales for decisions. SafeRL-Lite provides modular wrappers around standard Gym environments and deep Q-learning agents to enable: (i) safety-aware training via constraint enforcement, and (ii) real-time post-hoc explanation via SHAP values and saliency maps. The library is lightweight, extensible, and installable via pip, and includes built-in metrics for constraint violations. We demonstrate its effectiveness on constrained variants of CartPole and provide visualizations that reveal both policy logic and safety adherence. The full codebase is available at: https://github.com/satyamcser/saferl-lite.

View on arXivView PDF

Code Implementations(1)

MIT
30Python, Jupyter NotebookJun 17, 20251 years agoMIT

Similar Papers

Cite this paper

@article{mishra2025saferllite,
  title  = {SafeRL-Lite: A Lightweight, Explainable, and Constrained Reinforcement Learning Library},
  author = {Satyam Mishra and Phung Thao Vi and Shivam Mishra and Vishwanath Bijalwan and Vijay Bhaskar Semwal and Abdul Manan Khan},
  year   = {2025},
  eprint = {2506.17297},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2506.17297v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2506.17297.svg)](https://codeofpaper.com/paper/2506.17297)

Discussion