Runtime Safety through Adaptive Shielding: From Hidden Parameter Inference to Provable Guarantees

Minjae Kwon, Tyler Ingebrand, Ufuk Topcu, Lu Feng · DOI

Introduction

Reinforcement learning (RL) has demonstrated significant potential in simulated environments. However, transitioning these agents to real-world applications remains a challenge due to environmental inconsistencies. Variations in physical parameters—such as friction, mass, or gravity—can lead to catastrophic failures if an agent trained in one setting encounters another. This paper addresses the critical problem of maintaining safety during online adaptation to these "hidden-parameter" dynamics shifts.

Methodology

The proposed framework, Adaptive Shielding, integrates proactive training with reactive runtime intervention through a three-pillar architecture:

  1. Function Encoders (FE): To handle shifting dynamics, the system employs function encoders that infer low-dimensional representations of the environment's physics on the fly. By projecting transition data onto neural basis functions, the agent adapts to new dynamics without requiring explicit retraining.
  2. Safety-Regularized Optimization (SRO): This proactive layer augments the reward function during training with a safety regularizer. This discourages the policy from exploring high-risk regions, fostering "zero-violation" behavior as a baseline.
  3. Adaptive Shielding: The reactive layer acts as a runtime filter. It intercepts the agent's actions, using the Function Encoder and Adaptive Conformal Prediction (ACP) to predict future states while accounting for model uncertainty. If an action is deemed unsafe within calculated margins, the shield overrides it with a safer alternative.

The authors provide theoretical guarantees, linking the dynamics model's prediction error to bounds on the agent's average cost rate, thereby grounding the "safety net" in mathematical proof.

Experimental Setup

Evaluation was conducted using the Safe-Gym benchmark across two robot types: a 2D Point agent and a Car agent with realistic drive dynamics. Tasks included navigation (Goal), interaction (Button), object manipulation (Push), and path following (Circle). To test robustness, Out-of-Distribution (OOD) scenarios were introduced where parameters like gravity and friction were shifted significantly beyond training ranges.

Results and Discussion

The integrated SRO + Shield approach consistently outperformed six state-of-the-art baselines, including CPO, PPO-Lag, and Saute.

Performance comparison across standard Safe-Gym tasks. The combined method (blue diamond) consistently achieves higher returns with lower cost rates.

A key finding is the efficacy of the "two-layer" philosophy. By combining proactive regularization with reactive shielding, the system remains robust even under high uncertainty. The use of Function Encoders proved more stable than Transformer-based alternatives, and Conformal Prediction allowed the shield to dynamically adjust safety margins based on its own confidence levels.

In OOD evaluations, the framework demonstrated remarkable resilience. While non-adaptive baselines experienced safety collapses in extreme environments, Adaptive Shielding maintained a favorable return-safety trade-off.

Out-of-Distribution (OOD) evaluation showing robustness to dynamics shifts. The framework preserves performance and safety even in unseen environments.

Furthermore, empirical results show that the shielding mechanism typically adds only about one second of runtime per episode compared to standard baselines, making it viable for real-time applications without significant computational overhead.

Conclusion

Adaptive Shielding provides a robust solution for safe RL in non-stationary environments. By treating uncertainty as a primary factor and combining proactive and reactive safety measures, the framework achieves high performance with provable guarantees. Future work will focus on reducing dependency on pre-training datasets and validating the system on physical robotic hardware to address real-world challenges like sensor noise and latency.

Summary updated

BibTeX
@misc{kwon2025runtime,
  author = {Minjae Kwon and Tyler Ingebrand and Ufuk Topcu and Lu Feng},
  title = {{Runtime Safety through Adaptive Shielding: From Hidden Parameter Inference to Provable Guarantees}},
  year = {2025},
  eprint = {2506.11033},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.11033},
}
Figure