betaFeedback

WorksComputer Science

A Unified Bellman Operator for Safety-Critical Reinforcement Learning

Abstract

Reinforcement learning in safety-critical domains requires maximizing task performance while strictly adhering to safety constraints. Existing safe reinforcement learning paradigms typically force a trade-off: they either require a priori knowledge to provide strict safety guarantees (e.g., safety filters), or they enable joint learning but only satisfy safety constraints on average. In this work, we propose a novel Bellman operator that unifies performance and safety objectives into a joint value function. We show that temporal difference learning with the joint Bellman operator converges under a two-timescale stochastic approximation framework. On the fast timescale, the safety value of the learning joint policy is estimated, while the joint value is estimated on the slow timescale. Convergence is ensured by formulating the limiting dynamics as an occupation-averaged differential inclusion, and showing that it asymptotically converges to a set of limiting optimal safety-constrained task value functions. Theoretically, once converged, the resulting optimal policy maximizes task return while maintaining safety at all times. Empirical evaluations on continuous control tasks with neural approximations demonstrate stable convergence with near-zero safety violations at test time.

Introduction

Biological agents instinctively prioritize safety while mastering diverse tasks to ensure efficient, harm-free exploration. Safe Reinforcement Learning (Safe RL) captures this paradigm, aiming to learn near-optimal policies with strict safety assurances. Existing methods typically formalize this balance either by treating safety as a soft constraint during optimization or by theoretically enforcing hard safety guarantees.

Some of the early works formalized safe RL as a Constrained Markov Decision Process (CMDP), solving safety-constrained optimization problems using Lagrangian relaxation with dual multiplier methods [5, 23] (Ray et al. 2019), with subsequent extensions via trust-region projections [1] (Yang et al. 2020; Xu et al. 2021; Milosevic et al. 2025), state-augmentation (Sootla et al., 2022), and offline distribution shaping (Yao et al., 2024). While these model-free techniques jointly optimize task performance and safety, they inherently bound expected cumulative costs, yielding only probabilistic safety guarantees. Conversely, model-based methods achieve strict safety via predictive rollouts, epigraph formulation of the value function (for deterministic control problems), or by strictly avoiding unsafe future sets [4] (Huang et al. 2024; Jayant & Bhatnagar 2022; Pfrommer et al. 2022). However, they suffer from compounding model biases and computational overhead to infer safe actions in real-time, particularly in environments with complex or unmodeled dynamics. Motivated by these tradeoffs, we seek a model-free approach that strictly adheres to safety specifications while optimizing task performance.

Some of the control-theoretic approaches that rigorously hard-guarantee safety are based on Hamilton-Jacobi (HJ) reachability analysis, casting safety and reach-avoid problems as *zero-sum differential games (Isaacs, 1965; Mitchell et al., 2005). While deep RL techniques have enabled tractable neural solutions for the time-discounted HJI avoid/reach-avoid Bellman operators for safety analysis [22, 7] (Hsu et al. 2021), it is not immediately obvious how these techniques can be extended to generic tasks specified by dense, continuous reward functions. Consequently, a dominant paradigm employs a decoupled approach, where an a priori learned task-oblivious safety filter preemptively intercepts and projects nominal unsafe task actions onto a plausible safe set [15, 16, 9] (Hsu et al. 2024; Nguyen et al. 2024). However, these switch-type interventions only occur near the boundary, causing erratic, jittery interventions when a safety-oblivious task policy persistently tries to exit the boundary. This is seldom desirable, especially in human-in-the-loop scenarios (Oh et al., 2025).

Recent offline feasibility-guided models instead utilize diffusion, flow-matching, or world-models to approximate the largest feasible region using HJ-reachability and steer task-driven actions to strictly lie within the safe envelope [17] (Zheng et al. 2024; Tayal et al. 2026). However, they either introduce iterative online inference latency or rely on post-hoc distillation that weakens strict safety guarantees. Alternatively, using precomputed safety value functions as Control Barrier Functions (Q-CBF) (Hsu et al., 2024; Lu et al., 2025; Oh et al., 2025; 2026) avoids planning latency, but necessitates computing action projections online. Additionally, relying on external projections introduces action aliasing, which can be detrimental (Markgraf et al., 2026). If the safe action set is known a priori, neural-based methods such as (Suttle et al., 2024) can hard-guarantee safety; we instead assume no access to an oracle safe action set and learn from data. Thus, a growing subset of literature advocates for unified architectures that embed safety directly into the policy (Gu et al., 2024a;b; Cen et al., 2024). Yet, jointly optimizing rewards and costs frequently destabilizes learning due to gradient conflicts, necessitating algorithmic workarounds like gradient manipulation and explicit latent decoupling (Gu et al., 2024a;b; Kim et al., 2025; Cen et al., 2024; Yang et al., 2025).

In this paper, we combine safety and task objectives directly at the value-function level, rather than at the policy level, and jointly optimize safety-constrained task performance using a single joint policy via a novel, joint Bellman operator under adversarial disturbances. Our contributions are:

Unified Formulation: We propose a robust Bellman operator and derive the corresponding objective function from robust optimal stopping theory. We propose a two-timescale stochastic approximation framework that enables learning of its fixed point, the joint value function.

Theoretical Safety and Optimality Guarantees: We prove forward invariance of the safe set under the joint policy, and show convergence to the optimal robust task performance within the safe set.

Empirical Validation: We conduct experiments using neural approximations on a set of continuous control tasks from the Gymnasium and SafetyGymnasium suites under adversarial disturbances, demonstrating stable training convergence and near-zero safety violations during evaluation.

Preliminaries

This section introduces key definitions, followed by preliminaries on Constrained Markov Decision Processes and Hamilton-Jacobi safety analysis. Refer to Appendix § 10 for more details.

Definitions and Notations

We consider a discounted MDP with finite state, action and disturbance spaces: S⊂Rn\mathcal{S} \subset\mathbb{R}^{n}, A⊂Rm\mathcal{A} \subset\mathbb{R}^{m}, and D⊂Rl\mathcal{D} \subset\mathbb{R}^{l} respectively, with the transition kernel P(⋅∣s,a,d)∈Δ(S)P(\cdot\mid s,a,d) \in\Delta(\mathcal{S}). A deterministic joint policy π=(μ,ν)\pi= (\mu,\nu) pairs the mappings μ:S→A\mu:\mathcal{S}\to\mathcal{A} and ν:S×A→D\nu:\mathcal{S}\times\mathcal{A}\to\mathcal{D}, yielding π(s)=(μ(s),ν(s,μ(s)))\pi(s)=(\mu(s),\nu(s,\mu(s))). The reward and the safety margin are given by r:S×A×D→[0,Rmax⁡]r:\mathcal{S}\times\mathcal{A}\times\mathcal{D}\to[0,R_{\max}], Rmax⁡>0R_{\max}>0 w.l.o.g, and g:S→[−Gmin⁡,Gmax⁡]g:\mathcal{S}\to[-G_{\min},G_{\max}], with Gmin⁡,Gmax⁡>0G_{\min},G_{\max}>0 respectively. We assume the extended class-K∞\mathcal{K}_{\infty} scaling function β(⋅)\beta(\cdot) into g(s)g(s) to align with task return scales (unless stated otherwise). The constraint set is Fc:={s∈S:g(s)≥0}\mathcal{F}^{c}:=\{s\in\mathcal{S}:g(s)\geq0\}, complementing the failure set F\mathcal{F}. The viability kernel Q⊆Fc\mathcal{Q}\subseteq\mathcal{F}^{c} is the subset of states from which a control policy exists that can keep the agent away from the failure set F\mathcal{F} for all times, regardless of the adversarial disturbance. Finally, the value and action-value function spaces are defined as V:=R∣S∣\mathcal{V}:=\mathbb{R}^{|\mathcal{S}|} and Q:=R∣S∣∣A∣∣D∣\mathcal{Q}:=\mathbb{R}^{|\mathcal{S}||\mathcal{A}||\mathcal{D}|}, equipped with the supremum norm ∥⋅∥∞\lVert\cdot\rVert_{\infty}.

Constrained Markov Decision Processes

A Constrained Markov Decision Process (CMDP) [5] extends an MDP by introducing auxiliary costs to encode safety constraints. It is defined by the tuple M=(S,A,P,r,c,γ,μ0)\mathcal{M} = (\mathcal{S}, \mathcal{A}, P, r, c, \gamma, \mu_0), where rr and cc are the task reward and constraint cost functions, respectively, γ∈[0,1)\gamma\in[0, 1) is the discount factor, and μ0:S→[0,1]\mu_0 : \mathcal{S} \to[0, 1] denotes the initial state distribution. For a stochastic policy π:S→Δ(A)\pi: \mathcal{S} \to\Delta(\mathcal{A}), let Jr(π)J_r(\pi) and Jc(π)J_c(\pi) denote the expected discounted cumulative return and cost. The CMDP objective seeks an optimal policy that maximizes returns subject to a predefined safety threshold d∈Rd \in\mathbb{R}, typically solved via Lagrangian relaxation, yielding an equivalent unconstrained min-max saddle-point problem: min⁡λ≥0max⁡π∈Π(Jr(π)−λ(Jc(π)−d))\min_{\lambda\ge0} \max_{\pi\in\Pi} (J_r(\pi) - \lambda(J_c(\pi) - d)), where λ≥0\lambda\ge0 is the Lagrange multiplier and Π\Pi is the set of stationary stochastic policies. More details can be found in [5, 1] (Tessler et al. 2019; Stooke et al. 2020).

Hamilton-Jacobi Safety Analysis

Hamilton-Jacobi (HJ) reachability analysis seeks to find the safe set Ω⊆Fc\Omega\subseteq\mathcal{F}^{c} (Mitchell et al., 2005). Formulated as a zero-sum differential game, the robust safety value function is Vϕ(s)=inf⁡N[d]sup⁡ainf⁡t≥0g(ξa,N[d](t))V^{\phi}(s) = \inf_{\mathcal{N}^{[d]}} \sup_{a} \inf_{t \ge0} g(\xi^{a,\mathcal{N}^{[d]}}(t)), where ξa,N[d](⋅)\xi^{a,\mathcal{N}^{[d]}}(\cdot) denotes the trajectory starting at s0s_0 and evolving according to the control and disturbance trajectories (a,N[d])(a,\mathcal{N}^{[d]}), with N[d]\mathcal{N}^{[d]} the set of non-anticipative disturbance strategies [19, 21]. By Dynamic Programming, V(s)V(s) is the unique viscosity solution to the Hamilton-Jacobi-Isaacs (HJI) variational inequality. As the corresponding infinite-horizon Bellman operator does not induce a contraction mapping, [22] introduces a discount factor γ∈(0,1)\gamma\in(0, 1) to enable TD-learning, resulting in the time-discounted robust Bellman equation under stochastic dynamics

V(s)=(1−γ)g(s)+γmin⁡{g(s),max⁡a∈Amin⁡d∈DEs′∼p(⋅∣s,a,d)[V(s′)]}.V(s) = (1-\gamma)g(s) + \gamma\min\left\{g(s), \max_{a \in\mathcal{A}} \min_{d \in\mathcal{D}} \mathbb{E}_{s' \sim p(\cdot\mid s,a,d)}[V(s')]\right\}.

More details can be found in [22, 21, 19] (Mitchell et al. 2005).

Learning Safety-Constrained Task Action-Value Function

This section presents our unified formulation to learn a joint safety-constrained task value function. We show that the corresponding joint Bellman operator induces a contraction mapping when the auxiliary safety value function is held fixed. We further see that the coupled system possesses a discontinuity due to changing joint greedy policies, and discuss its resolution.

The Joint Formulation

For clarity, we first introduce the joint Bellman equation to intuit its formulation. In the presence of adversarial disturbances, the time-discounted task action-value function QψQ^{\psi} purely corresponding to task return maximization can be extended to the following robust stochastic equation:

Qtask(s,a,d)=r(s,a,d)+γEs′∼p(⋅∣s,a,d)[max⁡a′∈Amin⁡d′∈DQtask(s′,a′,d′)](1)Q^{\mathrm{task}}(s,a,d) = r(s,a,d) + \gamma\mathbb{E}_{s' \sim p(\cdot\mid s,a,d)}\left[\max_{a' \in\mathcal{A}} \min_{d' \in\mathcal{D}} Q^{\mathrm{task}}(s',a',d')\right] \tag*{(1)}

Next, consider the time-discounted safety value function, as introduced in [22]. We’d like to use this value function to instead assess the safety value of some given policy π:=(μ,ν)\pi:= (\mu,\nu), yielding the following safe action-value function evaluated π\pi:

Qπϕ(s,a,d)=(1−γ)g(s)+γmin⁡{g(s),Es′∼p(⋅∣s,a,d)[max⁡a′∈μ(s′)min⁡d′∈ν(s′,a′)Qπϕ(s′,a′,d′)]}(2)Q^{\phi}_{\pi}(s,a,d) = (1-\gamma)g(s) + \gamma\min\left\{g(s), \mathbb{E}_{s' \sim p(\cdot\mid s,a,d)}\left[\max_{a' \in\mu(s')} \min_{d' \in\nu(s',a')} Q^{\phi}_{\pi}(s',a',d')\right]\right\} \tag*{(2)}

We can use QπϕQ^{\phi}_{\pi} to cap the further accrual of task rewards, i.e., truncate task accrual for the policy π\pi when the corresponding task action-value goes above QπϕQ^{\phi}_{\pi}, enabling the agent to instead optimize task performance subject to safety. Since γ\gamma serves as the probability of episode continuation, by the notion of principled time-discounting [22], we can combine Eq. 2 with Eq. (1), yielding the stochastic time-discounted joint action-value function as follows:

Q(s,a,d)=(1−γ)min⁡{r(s,a,d),g(s)}+γmin⁡{r(s,a,d)+Es′∼p(⋅∣s,a,d)[max⁡a′∈Amin⁡d′∈DQ(s′,a′,d′)],Qπϕ(s,a,d)}(3)\begin{aligned} Q(s,a,d) &= (1-\gamma)\min\{r(s,a,d),g(s)\} \\ &\quad+ \gamma\min\left\{r(s,a,d) + \mathbb{E}_{s' \sim p(\cdot\mid s,a,d)}\left[\max_{a' \in\mathcal{A}}\min_{d' \in\mathcal{D}} Q(s',a',d')\right], Q^{\phi}_{\pi}(s,a,d)\right\} \tag*{(3)} \end{aligned}

where, with probability 1−γ1-\gamma, the agent receives the reward min⁡{r(s,a,d),g(s)}\min\{r(s,a,d),g(s)\}, or continues with probability γ\gamma. The corresponding maximin joint policy π:=(μ,ν)\pi:= (\mu,\nu) is defined through a measurable selection as:

μ(s):=arg⁡max⁡a∈Amin⁡d∈DQ(s,a,d),ν(s,μ(s)):=arg⁡min⁡d∈DQ(s,μ(s),d)(4)\mu(s) := \arg\max_{a \in A}\min_{d \in D} Q(s,a,d), \qquad\nu(s,\mu(s)) := \arg\min_{d \in D} Q(s,\mu(s),d) \tag*{(4)}

Here, the disturbance gets the advantage of observing the controller’s action, while the controller must optimize for the adversarial disturbance. Note that we do not assume QπϕQ^\phi_\pi to be given; instead, QπϕQ^\phi_\pi is learned alongside QQ, estimating the safety values of the joint policy π\pi. Note the coupling: the joint policy π\pi is derived from the joint value QQ, which is evaluated by QπϕQ^\phi_\pi, whose values in turn update QQ. Next, we show that the safety and joint Bellman operators are contractions given a fixed policy and fixed safety value, respectively. The joint value function is conceptualized in Figure 1.

Figure 1. (Left) The Joint Value function is conceptualized as a 2D figure, with the state-space indicated on the xx-axis, and joint values on the yy-axis. (Right) The corresponding regions within the safe set Ωπ\Omega^\pi are depicted. The locus of points where VQϕ=VQψV_Q^\phi= V_Q^\psi indicates the boundary between Ωϕ\Omega^\phi and Ωψ\Omega^\psi as defined in Definition 1. Trajectories must stay within Ωψ\Omega^\psi to maximize episodic return.

Safety Action-Value of the Joint Policy

Given a joint policy π\pi, the safety Bellman operator Tπϕ:Q→QT^\phi_\pi: \mathcal{Q} \to\mathcal{Q} corresponding to Eq. 2 is defined as:

Tπϕ[Qϕ](s,a,d)=(1−γ)g(s)+γmin⁡{g(s),Es′∼p(⋅∣s,a,d)[max⁡a′∈μ(s′)min⁡d′∈ν(s′,a′)Qϕ(s′,a′,d′)]}(5)T^\phi_\pi[Q^\phi](s,a,d) = (1-\gamma)g(s) + \gamma\min\left\{g(s), \mathop{\mathbb{E}}_{s'\sim p(\cdot\mid s,a,d)}\left[\max_{a'\in\mu(s')} \min_{d'\in\nu(s',a')} Q^\phi(s',a',d')\right]\right\} \tag*{(5)}

References

  1. [1]Joshua Achiam, David Held, Aviv Tamar, and Pieter Abbeel. Constrained policy optimization. In Proceedings of the 34th International Conference on Machine Learning - Volume 70, ICML’17, pp. 22–31. JMLR.org, 2017.arxiv.org/abs/1705.10528
  2. [2]Alekh Agarwal, Nan Jiang, Sham M Kakade, and Wen Sun. Reinforcement learning: Theory and algorithms. CS Dept., UW Seattle, Seattle, WA, USA, Tech. Rep, 32:96, 2019.
  3. [3]Erick Trevino Aguilar. T-systems and the lower snell envelope, 2009. URL https://arxiv.org/abs/0902.4245.
  4. [4]Albert Altarovici, Olivier Bokanowski, and Hasnaa Zidani. A general hamilton-jacobi framework for non-linear state-constrained control problems. ESAIM: Control, Optimisation and Calculus of Variations, 19(2):337–357, 2013.
  5. [5]Eitan Altman. Constrained Markov Decision Processes. Chapman and Hall/CRC, 1999.
  6. [6]Jean-Pierre Aubin and Arrigo Cellina. Differential Inclusions: Set-Valued Maps and Viability Theory. Grundlehren der mathematischen Wissenschaften. Springer Berlin Heidelberg, 2012. ISBN 9783642695124. URL https://books.google.com/books?id=rVnsCAAAQBAJ.
  7. [7]Andrea Bajcsy, Somil Bansal, Eli Bronstein, Varun Tolani, and Claire J. Tomlin. An efficient reachability-based framework for provably safe autonomous navigation in unknown environments. In 2019 IEEE 58th Conference on Decision and Control (CDC), pp. 1758–1765, 2019. doi: 10.1109/CDC40024.2019.9030133.
  8. [8]Stefan Banach. Sur les opérations dans les ensembles abstraits et leur application aux équations intégrales. Fundamenta mathematicae, 3(1):133–181, 1922.DOI
  9. [9]Arko Banerjee, Kia Rahmani, Joydeep Biswas, and Isil Dillig. Dynamic model predictive shielding for provably safe reinforcement learning. In The Thirty-eighth Annual Conference on Neural Information Processing Systems, 2024. URL https://openreview.net/forum?id=x2zY4hZcmg.arxiv.org/abs/2405.13863
  10. [10]Richard Bellman. Dynamic Programming. Princeton University Press, Princeton, NJ, 1957.pubmed.ncbi.nlm.nih.gov/17730601
  11. [11]Michel Benaïm and Morris W Hirsch. Asymptotic pseudotrajectories and chain recurrent flows, with applications. Journal of Dynamics and Differential Equations, 8(1):141–176, 1996.DOI
  12. [12]Michel Benaïm, Josef Hofbauer, and Sylvain Sorin. Stochastic approximations and differential inclusions. SIAM Journal on Control and Optimization, 44(1):328–348, 2005. doi: 10.1137/S0363012904439301.DOI
  13. [13]Vivek S Borkar. Stochastic Approximation: A Dynamical Systems Viewpoint. Texts and Readings in Mathematics. Hindustan Book Agency, 2009. ISBN 9789386279385. URL https://books.google.com/books?id=t_JdDwAAQBAJ.
  14. [14]Vivek S. Borkar. Stochastic Approximation: A Dynamical Systems Viewpoint, volume 48 of Texts and Readings in Mathematics. Springer Singapore, 2nd edition, 2023. doi: 10.1007/978-981-99-8277-6.DOI
  15. [15]Minh Bui, Michael Lu, Reza Hojabr, Mo Chen, and Arrvindh Shriraman. Real-time hamilton-jacobi reachability analysis of autonomous system with an fpga. In 2021 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pp. 1666–1673. IEEE, 2021.
  16. [16]Kaitong Cai, Jusheng zhang, Jing Yang, and Keze Wang. Guardian: Decoupling exploration from safety in reinforcement learning, 2025. URL https://openreview.net/forum?id=e9T6ZZFRzl.arxiv.org/abs/2510.22859
  17. [17]Chenyang Cao, Yucheng Xin, Silang Wu, Longxiang He, Zichen Yan, Junbo Tan, and Xueqian Wang. FOSP: Fine-tuning offline safe policy through world models. In The Thirteenth International Conference on Learning Representations, 2025. URL https://openreview.net/forum?id=dbUFJg7eaw.arxiv.org/abs/2407.04942
  18. [19]Lawrence C. Evans and Panagiotis E. Souganidis. Differential games and representation formulas for solutions of hamilton-jacobi-isaacs equations. Indiana University Mathematics Journal, 33: 773–797, 1983. URL https://api.semanticscholar.org/CorpusID:118892068.DOI
  19. [20]Tanner Fiez and Lillian J Ratliff. Local convergence analysis of gradient descent ascent with finite timescale separation. In International Conference on Learning Representations, 2021.
  20. [21]Jaime F Fisac, Anayo K Akametalu, Melanie N Zeilinger, Shahab Kaynama, Jeremy Gillula, and Claire J Tomlin. A general safety framework for learning-based control in uncertain robotic systems. IEEE Transactions on Automatic Control, 64(7):2737–2752, 2018.arxiv.org/abs/1705.01292
  21. [22]Jaime F Fisac, Neil F Lugovoy, Vicenç Rubies-Royo, Shromona Ghosh, and Claire J Tomlin. Bridging hamilton-jacobi safety analysis and reinforcement learning. In 2019 International Conference on Robotics and Automation (ICRA), pp. 8550–8556. IEEE, 2019.DOI
  22. [23]Fernando García and Fernando Fernández. A comprehensive survey on safe reinforcement learning. Journal of Machine Learning Research, 16(42):1437–1480, 2015.DOI

Paper details

vlnc:W_vfj2sd5q
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 4

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Generative AI tools

View statement
Looking for related papers…
Contents