English

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

Machine Learning 2025-06-24 v1 Artificial Intelligence

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.

Keywords

Cite

@article{arxiv.2506.17297,
  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},
  journal= {arXiv preprint arXiv:2506.17297},
  year   = {2025}
}

Comments

10 pages, 7 figures, open-source library, PyPI installable: pip install saferl-lite

R2 v1 2026-07-01T03:27:09.041Z