Safe In-context Reinforcement Learning
2025 Β· Amir Moeini, Minjae Kwon, Alper Kamil Bozkurt, et al.
Abstract
In-context reinforcement learning (ICRL) is an emerging RL paradigm where an agent, after pretraining, can adapt to out-of-distribution test tasks without any parameter updates, instead relying on an expanding context of interaction history. While ICRL has shown impressive generalization, safety during this adaptation process remains unexplored, limiting its applicability in real-world deployments where test-time behavior is expected to be safe. In this work, we propose SCARED: Safe Contextual Adaptive Reinforcement via Exact-penalty Dual, the first method that promotes safe adaptation of ICRL under the constrained Markov decision process framework. During the parameter-update-free adaptation process, our agent not only maximizes the reward but also keeps the accumulated cost within a user-specified safety budget. We also demonstrate that the agent actively reacts to the safety budget; with a higher safety budget, the agent behaves more aggressively, and with a lower safety budget the
Authors
(none)
Tags
Stats
Related papers
- Context-aware Safe Reinforcement Learning For Non-stationary Environments (2021)9.76
- Actsafe: Active Exploration With Safety Constraints For Reinforcement Learning (2024)0.00
- Conservative And Adaptive Penalty For Model-based Safe Reinforcement Learning (2021)0.00
- Implicit Safe Set Algorithm For Provably Safe Reinforcement Learning (2024)0.00
- Safe Continual Reinforcement Learning In Non-stationary Environments (2026)12.89
- Controlling Underestimation Bias In Constrained Reinforcement Learning For Safe Exploration (2026)0.00
- Provably Optimal Reinforcement Learning Under Safety Filtering (2025)0.00
- Safe Reinforcement Learning In Black-box Environments Via Adaptive Shielding (2024)2.26