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

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

Read Runtime Safety through Adaptive Shielding: From Hidden Parameter Inference to Provable Guarantees by Minjae Kwon, Tyler Ingebrand, Ufuk Topcu, Lu Feng (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2506-11033.txt.

Introduction

Robots and other learning systems must stay safe even when hidden facts about their world, like friction or gravity, change without warning. Minjae Kwon and co-authors present adaptive shielding in this 2025 paper, a safety layer that learns those hidden facts on the fly and blocks risky actions.

A small encoder reads recent motion data and sums up the hidden conditions, letting the shield forecast danger with cautious error bounds. Training also steers the policy away from costly areas in advance. Math ties prediction errors to safety costs, and tests on standard benchmarks beat rival methods on the balance of reward and safety.

Catalog record

CREATORMinjae Kwon, Tyler Ingebrand, Ufuk Topcu, Lu Feng
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE66 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2506-11033

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Runtime Safety through Adaptive Shielding: From Hidden Parameter Inference to Provable Guarantees Minjae Kwon, Tyler Ingebrand, Ufuk Topcu, Lu Feng Abstract Variations in hidden parameters, such as a robot’s mass distribution or friction, pose safety risks during execution. We develop a runtime shielding mechanism for reinforcement learning, building on the formalism of constrained hidden-parameter Markov decision processes. Function encoders enable real-time inference of hidden parameters from observations, allowing the shield and the underlying policy to adapt online. The shield constrains the action space by forecasting future safety risks (such as obstacle proximity) and accounts for uncertainty via conformal prediction. We prove that the proposed mechanism satisfies probabilistic safety guarantees and yields optimal policies among the set of safety-compliant policies. Experiments across diverse environments with varying hidden parameters show that our method significantly reduces safety violations and achieves strong out-of-distribution generalization, while incurring minimal runtime overhead. Project page: https://kmj1122.github.io/adaptive-shielding-project-page/ 1 Introduction Robots and other autonomous systems must operate safely in open-world environments where the underlying dynamics can vary due to hidden parameters such as mass distribution, friction, or terrain compliance. These parameters often change across episodes and remain unobserved, introducing safety risks and challenging the generalization capabilities of reinforcement learning (RL) systems ( Kirk et al. 2023 ; Benjamins et al. 2023 ) . Ensuring robust and safe behavior under such uncertainty is essential in domains like autonomous driving and robotic manipulation, where failures can have serious real-world consequences. Despite recent progress in hidden parameter-aware and safe RL, existing methods often trade off adaptability and safety. Approaches such as hypernetworks, contextual models, or mixtures-of-experts ( Rezaei-Shoshtari et al. 2023 ; Beukman et al. 2023 ; Celik et al. 2024 ) demonstrate strong adaptation to varying dynamics, but typically lack explicit mechanisms for guaranteeing safety under uncertainty. Conversely, safe RL frameworks based on constrained Markov decision processes ( Wachi and Sui 2020 ; Achiam et al. 2017 ) enforce safety by constraining cumulative costs, but often assume fixed dynamics and fail to adapt in real time to hidden parameter shifts. Methods like constrained policy optimization ( Achiam et al. 2017 ; Yang et al. 2020 ) and shielding ( Alshiekh et al. 2017 ; Yang et al. 2023 ) mitigate risk in static environments but remain limited in settings with dynamic or unobserved changes. To address this gap, we propose a runtime shielding framework for reinforcement learning that adapts online to hidden parameters while offering provable probabilistic safety guarantees. Central to our approach is the use of function encoders ( Ingebrand et al. 2024b ; Ingebrand et al. 2025 ) , a compact and expressive model class that infers environment dynamics from transition data by projecting them onto neural basis functions. This representation enables fast, online adaptation of both the policy and shield without retraining. To ensure safe learning and adaptation, our approach combines two complementary mechanisms that operate proactively during training and reactively at execution. First, we introduce a safety-regularized objective that augments rewards with a cost-sensitive value estimate, encouraging the policy to avoid unsafe behavior during training. However, this objective alone cannot guarantee safety, particularly under distribution shift. To address this, we augment policy execution with an adaptive shield that samples candidate actions from the policy, predicts their next states using a function encoder, and applies conformal prediction to quantify uncertainty in these forecasts. Actions that fail to meet a safety margin are filtered out, ensuring that only safe actions are executed. In summary, our main contributions are: • Online Hidden-Parameter Adaptation : We leverage function encoders to infer hidden parameters from transitions, enabling efficient policy and shield adaptation without retraining. • Safety-Regularized RL Objective : We propose a new objective that balances reward and safety by integrating a cost-sensitive value function, encouraging low-violation behavior during training. • Adaptive Shield with Probabilistic Guarantees : We develop an adaptive, uncertainty-aware runtime shield that filters unsafe actions using conformal prediction, ensuring safety during execution with provable probabilistic guarantees. Empirical evaluations in Safe-Gym benchmarks ( Ji et al. 2023 ) , including out-of-distribution scenarios with unseen hidden parameters, demonstrate that our method significantly reduces safety violations compared to baselines, achieving robust generalization with minimal runtime overhead. 1.1 Related Work Safe Reinforcement Learning. Safe RL methods often employ constrained MDP formulations to ensure compliance with safety constraints. Constrained policy optimization (CPO) remains foundational, effectively balancing performance and safety ( Achiam et al. 2017 ; Wachi and Sui 2020 ) . Further techniques use learned recovery policy to ensure safe action execution ( Thananjeyan et al. 2020 ) . Recent zero-violation policy methods in RL aim to minimize safety violations using techniques like genetic cost function search, energy-based action filtering, and primal-dual algorithms ( Hu et al. 2023 ; Zhao et al. 2021 ; Ma et al. 2024 ; Liu et al. 2021 ; Bai et al. 2023 ) . However, these approaches often face scalability issues, rely on restrictive assumptions, or are limited to simple environments. Unlike these approaches, we introduce the safety regularized-objective that can be integrated into the optimization process of any CMDP-based RL algorithms. Shielding frameworks proactively filter unsafe actions, selectively sampling safe actions ( Alshiekh et al. 2017 ; Carr et al. 2023 ; Yang et al. 2023 ) . Recent developments on shielding integrate adaptive conformal prediction into safety frameworks, enhancing uncertainty quantification for safety-critical planning ( Sheng et al. 2024a ; Sheng et al. 2024b ) . However, unlike existing methods, which are not explicitly designed to address varying hidden dynamics, our approach concurrently enhances safety through a safety-regularized objective and adaptive shielding while adapting to dynamic hidden parameters using function encoders. Contextual or Hidden-Parameter Reinforcement Learning. Hidden parameters, often termed context, have been studied in recent context-aware reinforcement learning approaches, demonstrating their importance for generalization ( Benjamins et al. 2023 ) . When algorithms are provided with knowledge of the hidden parameters, they are often directly integrated into the model. For example, contextual recurrent state-space models explicitly incorporate known contextual information to enable zero-shot generalization ( Prasanna et al. 2024 ) . Contextualized constrained MDPs further integrate context-awareness into safety-prioritizing curricular learning ( Koprulu et al. 2025 ) . A common approach to handle unknown context information is to infer it from observational history using transformer models ( Chen et al. 2021 ) . Hypernetwork-based methods utilize adapter modules to adjust policy networks based on inferred contexts ( Beukman et al. 2023 ) . Mixture-of-experts architectures leverage specialized experts, using energy-based models to handle unknown contexts probabilistically ( Celik et al. 2024 ) . However, these works primarily focus on enhancing generalization to varying dynamics without incorporating safety mechanisms during adaptation in contrast to our method. Generalization in Reinforcement Learning. Generalization in RL, including zero-shot transfer and meta learning, is crucial for robust policy adaptation to varying dynamics. For example, meta-learning approaches, such as MAML ( Finn et al. 2017 ) , allow rapid parameter adaptation from minimal interaction data. Recent work in meta-safe RL ( Khattar et al. 2023 ) has established provable guarantees for adapting to new tasks while satisfying constraints. However, meta-learning approaches involve parameter updates during adaptation, whereas our framework focuses on rapid, online inference of hidden parameters without requiring such updates. Hypernetwork-based

Read the complete text