← all repositories
PKU-Alignment/safety-gymnasium

Safe RL's old gym got a rewrite and a vision upgrade

Safety-Gymnasium replaces OpenAI's stale Safety-Gym with a modern, vision-ready benchmark suite for algorithms that must respect hard constraints.

576 stars Python ML FrameworksDomain Apps
safety-gymnasium
Not currently ranked — collecting fresh signals.
star history

What it does

Safety-Gymnasium is a suite of physics-based environments for benchmarking reinforcement learning algorithms that must obey hard safety constraints—navigation, velocity limits, and multi-agent cooperation tasks where violations carry explicit costs. It is built on MuJoCo 2.3.0+ and deliberately sheds the deprecated mujoco-py dependency that froze the original OpenAI Safety-Gym in 2021. The library exposes the modern Gym API and tags every step with native constraint information so researchers can compare safe-RL methods on common ground.

The interesting bit

Instead of merely cloning the old Safety-Gym levels, the project adds vision-based perception tasks, multi-agent scenarios, and Isaac Gym integrations to the classic navigation and velocity suites. That breadth makes it a rare attempt to unify safe-RL benchmarking across sight, speed, and swarm behavior in one framework.

Key highlights

  • Vectorized environments and the Gym 0.26.0+ API, both absent in the original Safety-Gym.
  • Native constraint-aware APIs that surface safety costs directly rather than hiding them in info fields.
  • Five environment families: Safe Navigation, Safe Velocity, Safe Vision, Safe Multi-Agent, and Safe Isaac Gym.
  • Fixes known bugs from the original Safety-Gym and swaps the brittle mujoco-py backend for modern MuJoCo.

Caveats

  • Recent releases (v1.1.0 and v1.2.0) are source-only because PyPI package-size limits block uploads; the team plans to move assets to cloud hosting eventually.
  • Python 3.11 is off the table for now thanks to a pygame incompatibility.

Verdict

Anyone training constrained policy optimization or safe exploration algorithms should migrate here from the aging OpenAI Safety-Gym. If your RL agents don’t need to worry about hard safety limits, this benchmark adds little to your stack.

Frequently asked

What is PKU-Alignment/safety-gymnasium?
Safety-Gymnasium replaces OpenAI's stale Safety-Gym with a modern, vision-ready benchmark suite for algorithms that must respect hard constraints.
Is safety-gymnasium open source?
Yes — PKU-Alignment/safety-gymnasium is open source, released under the Apache-2.0 license.
What language is safety-gymnasium written in?
PKU-Alignment/safety-gymnasium is primarily written in Python.
How popular is safety-gymnasium?
PKU-Alignment/safety-gymnasium has 576 stars on GitHub.
Where can I find safety-gymnasium?
PKU-Alignment/safety-gymnasium is on GitHub at https://github.com/PKU-Alignment/safety-gymnasium.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.