betaFeedback

WorksEngineering

Controller-Agnostic Runtime Safety Certificates for Tool-Using AI Agents via Data-Driven Robust Reachability

Abstract

Software agents built on large language models act by issuing tool calls, some of which cannot be undone. To control theory the model is an opaque feedback controller, replaced every few months, whose closed loop cannot be analyzed directly. We propose a runtime filter, or shield, between any such controller and its environment that certifies a bound on the probability of reaching an unsafe condition during a bounded task. Given a predicate abstraction and candidate successor sets, everything else comes from logs: the loop becomes a finite controlled Markov chain, the estimated kernel is surrounded by a distribution-free confidence region, and robust reach-avoid value iteration runs over it. The certificate is probably approximately correct and uniform over controllers respecting the filter, so one model may replace another without recomputation. In all tested datasets the true risk stayed within certificate and budget; in a file-system sandbox the filter stays sound against a hazard the logs barely covered, where a plug-in baseline certifies safety and fails; and it holds seven controllers, three of them open-weights models, to zero unsafe outcomes in 1050 episodes.

Introduction

A new kind of autonomous system is asking for the control community’s attention. Agents built on large language models [1], [2] take a goal in plain language and pursue it by picking a tool call, seeing what comes back and picking again until done. To a control engineer, the model is a feedback controller and the surrounding software the plant.

Two things make the loop awkward for the classical toolbox. First, some actions are irreversible. A deleted database or a wired payment cannot be taken back, so what must be bounded is the probability one is ever triggered before the task ends, a finite-horizon reach–avoid requirement. Second, the controller is opaque and replaced within months, so any argument tied to its identity is obsolete almost as soon as written.

Together they rule out most existing machinery. Barrier-function and predictive safety filters [3, 4, 5] and Hamilton–Jacobi reachability [6] start from a dynamical model, supervisory control [7] gives only logical guarantees, and policy-specific verification must be redone when the controller changes [8]. What agents do offer is data. They all log state, action and outcome, inviting a data-driven treatment as in [9].

So we ask whether any LLM agent can be wrapped in a thin filter, built from logs with no known transition probabilities or training, guaranteeing a chosen ceiling on the probability of an unsafe outcome within a bounded task, certified once for every controller respecting it. Given predicates making the loop Markov and each call’s possible outcomes, it can.

Contributions. This letter makes the following contributions.

  1. A plant model for an agent. A few engineer-chosen Boolean facts turn the agent loop into a finite controlled Markov chain with a reach–avoid specification (Sec. II).

  2. A certificate from ordinary logs. A robust reach–avoid bound on the risk of irreversible harm, computed over a distribution-free confidence set, is valid with chosen confidence for every controller the filter admits (Sec. III).

  3. A synthesis procedure. It seeks the least restrictive filter meeting the risk budget (Sec. IV).

  4. Validation. We check the certificate against ground truth, compare our filter with four alternatives, and test one filter, built from a scripted agent’s logs, with that agent and three open-weights language models [10] (§ 5).

Proofs of all results are given in the Appendix.

Relation to data-driven robust MDPs and shielding. Suilen et al. [11] maintain Bayesian intervals on an uncertain MDP; Badings et al. [12] lift PAC intervals to an interval MDP; Reed and Lahijanian [13] build one deep-kernel regression, computing a maximally permissive safe-policy set. Closest, Hamel-De le Court et al. [14] shield robust MDPs against a safety-LTL threshold; on the RMDP their shield is sound and optimal, admitting exactly the safe policies. We claim no novelty in uniformity over controllers, which shielding supplies by construction. What differs is the data, as most acquire samples through a scheme they control, and where a passive stream is admitted [11] the uncertainty is Bayesian, not distribution-free. Ours is a narrower, distribution-free construction for ordered, passively collected traces with adaptive, uncontrolled visitation and explicit vacuous treatment of under-covered rows, feeding a robust finite-horizon shield. Ray [15] concurrently asks what a gate can enforce at all, a question of enforcement rather than certification. Table I sets these beside this letter.

The Agent–Environment Loop as a Controlled Markov Chain

This section models the agent loop as a finite controlled Markov chain with a reach–avoid specification.

WorkDataUncertainty setGuarantee ranges overSpec.Guarantee
Suilen et al. [11]interactive or streamedBayesian intervalsthe synthesized policytemporal logiccredible
Badings et al. [12]prescribed samplesPAC intervals (iMDP)the synthesized policyreach–avoidPAC
Reed and Lahijanian [13]queried sampleskernel intervals (iMDP)a maximal safe-policy setsafetyprobabilistic
Hamel-De le Court et al. [14]simulator, per-pair budgetClopper–Pearsonevery compliant policy; all safe admittedsafety LTLPAC, sound + optimal
This letterpassive, adaptively visited logsdistribution-free L1L_1 ballsevery admissible controllerreach–avoid, HALTPAC, distribution-free

Table 1. This letter and the closest prior work. Ours differs mainly in its passive, adaptively visited logs and distribution-free uncertainty set.

From transcripts to a finite state machine

The controller is a language model whose natural state is the whole transcript ht∈Hh_t \in\mathcal{H}, every prompt, call and reply so far, an unbounded object. We replace it with a short list of Boolean predicates chosen for the application, such as “holds write capability,” “inside a protected directory,” “an irreversible call has executed.” The map φ:H→S\varphi: \mathcal{H} \to\mathcal{S} sends a transcript to the truth values of these predicates, so the abstract state st=φ(ht)s_t = \varphi(h_t) lives in a finite set with ∣S∣=n|\mathcal{S}| = n. Actions a∈Aa \in\mathcal{A} are a finite catalog of tool-call types, ∣A∣=m|\mathcal{A}| = m, one of which, HALT, hands control to a human and ends the episode safely. An action may refine a tool name by safety-relevant argument classes; any dependence left out of aa must appear in the abstract state instead.

Assumption 1 (Abstract Markovness). There is a kernel PP with P[st+1=s′∣ht,at]=P(s′∣st,at)\mathbb{P}[s_{t+1}=s' \mid h_t,a_t] = P(s' \mid s_t,a_t), st=φ(ht)s_t=\varphi(h_t), at every tt and for any history-dependent ata_t. Hence, given the current abstract state and action, the next is independent of the rest of hth_t, with a kernel independent of tt.

That is, once the predicates and the action are known, the rest of the transcript says nothing more about where the system goes next, even though the controller may have used it to choose the action. The analysis rests on this assumption, so the predicates must be rich enough to make it hold; Experiment 4 tests it on logs, and Prop. 2 bounds the cost of a violation.

Assumption 2 (Irreversibility). There is an unsafe set Su⊂SS_u \subset\mathcal{S} (a harmful/irreversible call has occurred); each s∈Sus \in S_u is absorbing, P(s∣s,a)=1P(s \mid s,a)=1 for all aa.

Assumption 3 (Safe stop). A distinguished sink ⊥∈S\bot\in\mathcal{S} is absorbing and safe. From every non-unsafe, non-sink state, HALT leads to it,

P(⊥∣s,HALT)=1for s∉Su∪{⊥}.P(\bot\mid s,\mathrm{HALT})=1 \qquad\text{for }s\notin S_u\cup\{\bot\}.

(Unsafe states remain absorbing under every action, including HALT, by A2.)

Assumption 4 (Controller-independence). PP depends only on (s,a)(s,a), not on which controller selected aa.

A2 and A3 say only that harm cannot be undone and stopping is always possible. A4 lets one certificate serve every controller, since a file system answers “delete” the same way whoever issued it, provided the action or the predicates record every argument that matters, such as the path. Environments that adapt to the agent’s identity are excluded.

Controller, shield, admissibility. A controller is any nonanticipative rule for the next action, a family of kernels πt(⋅∣ht)∈Δ(A)\pi_t(\cdot\mid h_t)\in\Delta(\mathcal{A}) that may depend on the entire transcript, vary with time and randomize. A language model is one. A shield is a map D:S→2A\mathcal{D}:\mathcal{S}\to2^{\mathcal{A}} listing the actions permitted in each abstract state, always including HALT. A controller is admissible, written π▹D\pi\triangleright\mathcal{D}, if supp⁡πt(⋅∣ht)⊆D(φ(ht))\operatorname{supp}\pi_t(\cdot\mid h_t)\subseteq\mathcal{D}(\varphi(h_t)) for all tt, that is, if every action it executes is permitted. The shield constrains only what is executed; how a forbidden proposal is handled is a separate choice, and Sec. V uses three, namely restricting the agent to permitted actions (the random and adversarial controllers of Experiment 1), replacing the proposal by HALT, which ends the episode (its competent controller), and blocking it and asking again, with HALT on the fourth consecutive refusal (the language models of Experiment 3). Each makes the agent plus its rule a nonanticipative controller whose executed action lies in D(φ(ht))\mathcal{D}(\varphi(h_t)). A blocked proposal causes no transition, does not advance the step count, which counts executed calls, and leaves φ(ht)\varphi(h_t) unchanged, as the predicates record facts about the environment. That composite is admissible and is the π\pi every result below concerns, immediate HALT substitution being the case of no second attempt. The shield is thus a supervisory controller [7, 8] between a stochastic plant and a black-box decision maker.

The finite-horizon reach–avoid specification

The quantity we certify is the probability that the loop ever reaches an unsafe state within the task horizon. Fix a horizon TT and a start h0h_0, s0=φ(h0)s_0=\varphi(h_0). For admissible π\pi and kernel PP the unsafe-reach probability is

VTπ(s0;P):=P[∃t≤T:st∈Su∣h0,π,P].(1)V_T^\pi(s_0;P):=\mathbb{P}[\exists t\le T:s_t\in S_u\mid h_0,\pi,P]. \tag*{(1)}

Since unsafe states are absorbing this is the probability of ever entering SuS_u within TT steps. Not knowing which controller will run, we control the worst case over all of them,

VT∗(s;P,D):=sup⁡π▹DVTπ(s;P),(2)V_T^*(s;P,\mathcal{D}):=\sup_{\pi\triangleright\mathcal{D}}V_T^\pi(s;P), \tag*{(2)}

a supremum over every nonanticipative admissible controller, which collapses to a state-feedback recursion.

Lemma 1 (Worst-case reach–avoid value). Under A1–A3, for every ss and kk the worst-case value Vk∗(s;P,D)V_k^*(s;P,\mathcal{D}) is produced by V0∗=1SuV_0^*=1_{S_u} and, for s∉Su∪{⊥}s\notin S_u\cup\{\bot\},

Vk∗(s)=max⁡a∈D(s)∑s′P(s′∣s,a)Vk−1∗(s′),(3)V_k^*(s)=\max_{a\in\mathcal{D}(s)}\sum_{s'}P(s'\mid s,a)V_{k-1}^*(s'), \tag*{(3)}

with Vk∗≡1V_k^*\equiv1 on SuS_u, Vk∗(⊥)=0V_k^*(\bot)=0. The supremum in (2) is attained by a deterministic Markov policy at∗(s)∈arg max⁡a∈D(s){Pa(s),VT−t−1∗,Pa(s):=P(⋅∣s,a)}a_t^*(s)\in\operatorname*{arg\,max}_{a\in\mathcal{D}(s)}\{P_a(s),V_{T-t-1}^*,P_a(s):=P(\cdot\mid s,a)\}.

Equation (3) is ordinary reach–avoid value iteration [16]. At each state the worst controller picks the permitted action with the highest chance of eventual harm, and no history-dependent or randomized controller can do worse. With PP known this would finish the problem. But PP is unknown, and the rest of this letter certifies an upper bound on (2) from logs.

Data-Driven Robust Reach–Avoid Certificate

We replace the unknown kernel by a confidence set built from the logs, the analogue of an uncertainty set in robust control, and run value iteration against its worst kernel; the result bounds (2) with high probability.

Estimating the kernel from adaptively collected logs

The data are MM logged episodes of abstract state, action and next state. Each pair (s,a)(s,a), a row of the transition matrix PaP_a, is visited N(s,a)N(s,a) times; Xjs,aX_j^{s,a} is the successor recorded at the jj-th visit, and the natural estimate of P(⋅∣s,a)P(\cdot\mid s,a) is their empirical distribution. The difficulty is that the logs are collected in closed loop. As in closed-loop identification, which rows are visited, and how often, depends on earlier outcomes. Hence N(s,a)N(s,a) is random and correlated with the very successors being averaged, and a confidence bound for a sample of fixed size cannot simply be evaluated at N(s,a)N(s,a).

We avoid this by construction. Before any data are seen, the protocol commits to a per-row budget n0(s,a)n_0(s,a), and the estimator uses exactly the first n0(s,a)n_0(s,a) successors at each row, discarding the surplus. Thus P^(s′∣s,a)=N0(s,a,s′)/n0(s,a)\widehat{P}(s'\mid s,a)=N_0(s,a,s')/n_0(s,a) with truncated counts N0(s,a,s′)=∑j≤n01[Xjs,a=s′]N_0(s,a,s')=\sum_{j\le n_0}1[X_j^{s,a}=s'], and P^a(s):=P^(⋅∣s,a)\widehat{P}_a(s):=\widehat{P}(\cdot\mid s,a). The count N(s,a)N(s,a) only shows whether the budget was met; a row that falls short takes the vacuous set below, which contains every kernel, so a missed budget loosens the certificate but never invalidates it. The budget must be fixed from design constants before any log is examined, since choosing it after seeing the counts would reintroduce that dependence; for a retrospective log a time-uniform confidence sequence or a holdout is safer.

We also assume a mild structural prior. For each row a candidate successor set Ks,a⊇supp⁡P(⋅∣s,a)K_{s,a}\supseteq\operatorname{supp}P(\cdot\mid s,a) of size ks,ak_{s,a} is known, meaning what a tool call can return, though not with what probability. Enlarging Ks,aK_{s,a} is always safe, since the confidence set only grows and still contains the truth, whereas omitting a possible successor breaks the guarantee. The size of Ks,aK_{s,a} affects only how tight the certificate is. The radius grows like ks,a/n0\sqrt{k_{s,a}/n_0} with the number of candidate successors, since ln⁡(2ks,a−2)≈ks,aln⁡2\ln(2^{k_{s,a}}-2)\approx k_{s,a}\ln2, and Ks,a=SK_{s,a}=\mathcal{S} roughly doubles it on our grid.

For NN i.i.d. samples on kk outcomes, Weissman et al. [17] give an L1L_1 analogue of Hoeffding’s inequality,

P[∥P^a(s)−Pa(s)∥1≥η]≤(2k−2)e−Nη2/2.(4)\mathbb{P}\left[\left\|\widehat{P}_a(s)-P_a(s)\right\|_1\ge\eta\right]\le(2^k-2)e^{-N\eta^2/2}. \tag*{(4)}

Setting the right-hand side to δ/R\delta/R (a union bound over the RR rows) and solving for η\eta gives the per-row radius

βs,a=2n0(s,a)ln⁡((2ks,a−2)Rδ).(5)\beta_{s,a}=\sqrt{\frac{2}{n_0(s,a)}\ln\left(\frac{(2^{k_{s,a}}-2)R}{\delta}\right)}. \tag*{(5)}

and, for a stochastic row (one with ks,a≥2k_{s,a}\ge2 candidate successors), the confidence set (an L1L_1 ball intersected with the simplex)

Cs,a={q∈Δ(S):∥q−P^a(s)∥1≤βs,a, supp⁡q⊆Ks,a}.(6)\mathcal{C}_{s,a}=\left\{q\in\Delta(\mathcal{S}):\|q-\widehat{P}_a(s)\|_1\le\beta_{s,a},\ \operatorname{supp}q\subseteq K_{s,a}\right\}. \tag*{(6)}

A deterministic row, ks,a=1k_{s,a}=1, has nothing to learn. The factor 2ks,a−22^{k_{s,a}}-2 vanishes, βs,a=0\beta_{s,a}=0 and Cs,a={δs′}\mathcal{C}_{s,a}=\{\delta_{s'}\}, as for HALT. A row with N(s,a)<n0(s,a)N(s,a)<n_0(s,a) takes the vacuous set Δ(Ks,a)\Delta(K_{s,a}).

Inequality (4) assumes a fixed sample size. The next lemma, the core of the construction, shows that the committed budget keeps (5) valid for closed-loop logs. With probability at least 1−δ1-\delta, every confidence set contains its true row (event EE). The lemma also covers an approximately Markov abstraction.

Lemma 2 (Uniform validity). Let QjQ_j, supported in Ks,aK_{s,a}, be the conditional law of the successor at the jj-th visit to (s,a)(s,a) given the past, and let Q‾a(s):=n0−1∑j≤n0Qj\overline{Q}_a(s):=n_0^{-1}\sum_{j\le n_0}Q_j. With probability at least 1−δ1-\delta over the logs, Q‾a(s)∈Cs,a\overline{Q}_a(s)\in\mathcal{C}_{s,a} for all (s,a)(s,a) at once. Under A1A1 every QjQ_j equals Pa(s)P_a(s), so this reads Pa(s)∈Cs,aP_a(s)\in\mathcal{C}_{s,a}.

Proof sketch (see the Appendix). Whether a visit is among the first n0n_0 is fixed before its successor is drawn, so for each A⊆Ks,aA\subseteq K_{s,a} the terms 1[Xjs,a∈A]−Qj(A)1[X_j^{s,a}\in A]-Q_j(A) are martingale differences of range one; Azuma–Hoeffding and a union bound over the nontrivial sets AA and the rows give (5) without independence.

Robust value iteration

Lemma 1 took the worst case over controllers for a known kernel. We now also take the worst case over the kernels the data cannot rule out. Define V‾0=1Su\overline{V}_0=1_{\mathcal{S}_u}, and, for s∉Su∪{⊥}s\notin\mathcal{S}_u\cup\{\bot\},

V‾k(s)=max⁡a∈D(s)σ(Cs,a;V‾k−1),(7)\overline{V}_k(s)=\max_{a\in\mathcal{D}(s)}\sigma(\mathcal{C}_{s,a};\overline{V}_{k-1}), \tag*{(7)}

with V‾k=1\overline{V}_k=1 on Su\mathcal{S}_u, V‾k(⊥)=0\overline{V}_k(\bot)=0, and the support function

σ(Cs,a;V):=max⁡q∈Cs,a⟨q,V⟩,(8)\sigma(\mathcal{C}_{s,a};V):=\max_{q\in\mathcal{C}_{s,a}}\langle q,V\rangle, \tag*{(8)}

the largest one-step value any kernel in the confidence set could produce. Equation (7) is robust dynamic programming [18] for reach–avoid; its only nontrivial step, (8), is a linear program over an L1L_1 ball ∩\cap simplex, solved in closed form by shifting mass toward the riskiest successors.

Proposition 1 (Inner oracle). Let p^=P^a(s)\hat{p}=\widehat{P}_a(s) and order the support so VV is nonincreasing. Then (8) equals ⟨p^,V⟩\langle\hat{p},V\rangle plus the gain from moving at most min⁡(βs,a/2,1)\min(\beta_{s,a}/2,1) of mass from the smallest-VV entries of p^\hat{p} to the largest, capped by donor and receiver capacity and stopped when no strictly value-increasing transfer remains; the moved mass may be zero, as at p^=(1,0)\hat{p}=(1,0), V=(1,0)V=(1,0). It costs O(ks,alog⁡ks,a)O(k_{s,a}\log k_{s,a}).

The certificate

Theorem 1 (PAC controller-agnostic safety). Under A1A1–A4A4, the support condition supp⁡P(⋅∣s,a)⊆Ks,a\operatorname{supp}P(\cdot\mid s,a)\subseteq K_{s,a} and the sets (6), with probability at least 1−δ1-\delta over the draw of the logs, for every ss, every k≤Tk\le T and every admissible controller π▹D\pi\triangleright\mathcal{D},

VTπ(s;P)≤Vk∗(s;P,D)≤V‾k(s).(9)V^\pi_T(s;P)\le V_k^*(s;P,D)\le\overline{V}_k(s). \tag*{(9)}

In particular, if the shield satisfies V‾T(s0)≤ε\overline{V}_T(s_0)\le\varepsilon, then

Pdata[sup⁡π▹DVTπ(s0;P)≤ε]≥1−δ.(10)\mathbb{P}_{\mathrm{data}}\left[\sup_{\pi\triangleright\mathcal{D}}V^\pi_T(s_0;P)\le\varepsilon\right]\ge1-\delta. \tag*{(10)}

Hence, with confidence 1−δ1-\delta over the logs, any controller behind the shield reaches an unsafe state with probability at most V‾T(s0)\overline{V}_T(s_0), computed from the logs and the shield, not from PP. As the bound is uniform over admissible controllers, a new model can replace the deployed one without recomputation. The certificate belongs to the interface, not the model.

Corollary 1 (Sample complexity and rate). Let R\mathcal{R} be the rows an in-shield trajectory from s0s_0 can visit and nmin⁡(M):=min⁡(s,a)∈Rn0(s,a)n_{\min}(M):=\min_{(s,a)\in\mathcal{R}}n_0(s,a). Suppose nmin⁡(M)=Ω(M)n_{\min}(M)=\Omega(M), so βs,a=\beta_{s,a}=

O(1/M)O(1/\sqrt{M}) uniformly on R\mathcal{R}. On the event EE of Lemma 2 and on the event that every row of R\mathcal{R} meets its committed budget, VˉT(s0)≤VT(s0;P,D)+O(T/M)\bar{V}_{T}(s_{0}) \le V_{T}(s_{0};P,D) + O(T/\sqrt{M}).

Coverage is essential here, since a relevant row missing its budget stays vacuous and the gap need not shrink.

Corollary 2 (Validity under data-dependent synthesis). The event E={Pa(s)∈Cs,a ∀(s,a)}E = \{P_{a}(s) \in C_{s,a}\ \forall(s,a)\} depends on the data only, and on EE the domination Vˉk≤Vk\bar{V}_{k} \le V_{k} holds for every shield at once. Hence (10) survives replacing DD by any data-dependent D^\widehat{D} with VˉT(s0;D^)≤ϵ\bar{V}_{T}(s_{0};\widehat{D}) \le\epsilon, in particular the output of Alg. 1. No sample splitting is required.

More logs tighten the bound at the usual 1/M1/\sqrt{M} rate if they cover the relevant rows, a condition akin to persistent excitation, and the shield may be chosen from the logs that certify it. The next result bounds the cost of violating A1.

Proposition 2 (Residual history dependence). Drop A1 and assume instead that at every row the history-conditioned laws vary little, in that ∥Qa(h)−Qa(h′)∥1≤η\lVert Q_{a}(h)-Q_{a}(h')\rVert_{1} \le\eta and supp⁡Qa(h)⊆Ks,a\operatorname{supp} Q_{a}(h) \subseteq K_{s,a} for all reachable h,h′h,h' with φ(h)=φ(h′)=s\varphi(h)=\varphi(h')=s. Let VˉTη\bar{V}^{\eta}_{T} run (7) over sets Cs,aηC^{\eta}_{s,a} of radius βs,a+η\beta_{s,a}+\eta. Then with probability at least 1−δ1-\delta over the draw of the logs, every admissible controller obeys VˉTη(s0)≤VˉT(s0)≤VˉT(s0)+12Tη\bar{V}^{\eta}_{T}(s_{0}) \le\bar{V}_{T}(s_{0}) \le\bar{V}_{T}(s_{0}) + \frac{1}{2}T\eta.

Like a bound on unmodeled dynamics, η\eta is a declared tolerance. One states how far from Markov the abstraction may be, pays Tη/2T\eta/2, and checks this on the logs (Experiment 4).

Least-Restrictive Shield Synthesis

Theorem 1 certifies any shield with VˉT(s0)≤ϵ\bar{V}_{T}(s_{0}) \le\epsilon; the question is which to deploy, and one always qualifies.

Proposition 3 (Well-posedness). For s0∉Us_{0} \notin\mathcal{U}, the all-HALT shield D⊥(s)={HALT}D_{\perp}(s)=\{\mathrm{HALT}\} yields VˉT(s0)=0\bar{V}_{T}(s_{0})=0, so the set {D:VˉT(s0)≤ϵ}\{D:\bar{V}_{T}(s_{0})\le\epsilon\} is nonempty for every ϵ≥0\epsilon\ge0.

That shield is safe and useless; we want the one that forbids as little as possible while still certifying, that is, a solution of max⁡D Π(D)s.t.VˉT(s0;D)≤ϵ,HALT∈D(s) ∀s,\max_{D}\ \Pi(D)\quad\text{s.t.}\quad\bar{V}_{T}(s_{0};D)\le\epsilon,\quad\mathrm{HALT}\in D(s)\ \forall s, (11) where Π\Pi measures how much the agent keeps. Forbidding an action can only lower VˉT\bar{V}_{T}, so forbidding more from a certified shield keeps it certified, but choosing which actions to forbid is combinatorial. We proceed greedily, forbidding one action at a time, the one buying the most safety per unit of autonomy given up, until a removal meets the budget. Alg. 1 always returns a certified shield, since within ∣{(s,a)}∣\lvert\{(s,a)\}\rvert removals it meets the budget or reaches all-HALT (Prop. 3); optimality is not claimed. Two choices make it effective.

(i) Which action to forbid first. Counting removals is the wrong measure, since the cheapest way to make the start safe is to wall it off. We instead weight each action by how often a goal-directed reference policy uses it, Π(D)=∑s,aρ(s,a)1[a∈D(s)]\Pi(D)=\sum_{s,a}\rho(s,a)\mathbf{1}[a\in D(s)] with its state–action occupancy, and rank removals by risk reduction per unit cost c(s,a)=ρ(s,a)+ρmin⁡c(s,a)=\rho(s,a)+\rho_{\min}. An action the task never uses costs nothing to forbid, so it goes first; inward step-into-hazard moves are exactly such actions, which is why the synthesizer fences the hazard (Figure 1b) rather than moats the agent.

The grid benchmark and the shield of Experiment 1

Figure 1. The grid benchmark and the shield of Experiment 1. (a) Each of the 7×77\times7 cells is an abstract state of a tool-using agent; the red block is the unsafe set Su\mathcal{S}_{u}, so the start and the star are the goal. (b) Certified worst-case reach probability VˉT(s0)\bar{V}_{T}(s_{0}) for each grid cell (color) and forbidden moves (black segments). The shield fences the hazard instead of walling in the start, so a route to the goal remains, and the risk from s0s_{0} is certified below the budget (ϵ=0.10\epsilon=0.10, M=12,000M=12{,}000, T=16T=16).

(ii) Keeping the task reachable. A fence removes one action at one state, never a state. Every state keeps HALT, so the shield never leaves the agent without an admissible action; that much is guaranteed. Beyond it, Alg. 1 prefers removals keeping the goal reachable from s0s_{0}, falling back only when no risk-reducing alternative does; in Figure 1b that preserves a route, and the agent travels around the fenced block to the star without ever proposing a forbidden call.

Each iteration evaluates all candidate removals in one batched value iteration; on the instances of Sec. V, synthesis takes a few seconds per shield on one CPU core.

Numerical Experiments

We use two environments of our own. On a small grid the true kernel is known, so the certificate can be checked exactly (Experiments 1 and 2). A file-system sandbox mirrors the motivating application (Experiment 3), and Experiment 4 tests the Markov assumption. The synthesizer sees only sampled logs; code is at https://github.com/SAILRIT/Agent-shield-certificates.

A grid with known ground truth

In the grid of Figure 1a each of the 7×77\times7 cells is an abstract state, the central 3×33\times3 block is Su\mathcal{S}_{u}, a sink models HALT, and start and goal are opposite corners. Moves slip with probability 0.160.16; T=16T=16 and δ=0.05\delta=0.05. Each row gets the budget η0=⌈0.7MT/R⌉\eta_{0}=\lceil0.7MT/R\rceil, 70%70\% of an even share of the MTMT transitions. Without a shield, the worst controller reaches Su\mathcal{S}_{u} with probability about 11.

Experiment 1 (soundness). A shield synthesized from M=12,000M=12{,}000 episodes with ϵ=0.10\epsilon=0.10 certifies VˉT(s0)=\bar{V}_{T}(s_{0})= 0.072; its exact worst-case risk is 0.009. Three controllers run through it, 4×1044 \times10^4 episodes each. An adversary playing the worst admissible policy reaches SuS_u in 0.010 of them, close to that exact value; competent and random controllers record 0.000.

Recomputed from more logs, this shield’s certificate falls from 0.189 at 3×1033 \times10^3 episodes to 0.023 at 1.2×1051.2 \times10^5, and its excess over the exact value has a log–log slope of −0.70-0.70, faster than the M−1/2M^{-1/2} of Cor. 1. Discarding the surplus samples has a price. The shield forbids 50.5% of live state–action pairs, against 25.5% if all samples could be used, and at M=2,500M = 2,500 an average of 1.5 of 200 rows miss their budget.

Experiment 2 (validation across datasets). The certificate is a claim about the random draw of the logs, so we test it that way. At each sample size we draw 100 independent datasets, synthesize a fresh shield from each, and compute its exact worst-case risk. The true risk stays within both certificate and budget in all 100 trials at each MM (Table II), consistent with 95% confidence. It rises with MM, from 0.002 to 0.008, because more data shrinks the confidence sets and the certified shield then forbids fewer actions (Cor. 2).

MMP[VT∗≤VˉT]\mathbb{P}[V_T^* \le\bar{V}_T]P[VT∗≤ϵ]\mathbb{P}[V_T^* \le\epsilon]VˉT\bar{V}_TVT∗V_T^*
2,5001.001.000.0760.002
12,0001.001.000.0740.008

Table II. The guarantee over 100 datasets (Experiment 2). For each number MM of logged episodes we drew 100 independent datasets and built a fresh shield from each. The second and third columns give the fraction of datasets in which the shield’s true worst-case risk VT∗V_T^* was at most its certificate VˉT\bar{V}_T, and at most the budget ϵ=0.10\epsilon= 0.10; the last two give the average VˉT\bar{V}_T and VT∗V_T^* (δ=0.05\delta= 0.05, T=16T = 16).

A file-system sandbox, with four baselines

The abstract state records whether the agent is in the protected directory, holds write capability and has confirmation, plus a latch recording that a destructive call was issued. The tools are read, chmod, write, delete, send and HALT. The task is an authorized change, a write in production after confirmation; each read obtains confirmation with probability 0.5, and calls misfire with probability 0.12. Harm comes from a chmod into production before confirmation, then write or delete, or from a delete elsewhere, which sets the latch, then send. We log M=4,000M = 4,000 episodes of a competent agent that takes neither route, with n0=Mn_0 = M and δ=0.05\delta= 0.05; the least-visited row meeting its budget has 9,118 observations, yet the hazards never appear in the logs. Episodes are cut off after T=10T = 10 executed calls, not counting blocked proposals.

Table III compares five shields built from the same logs. Here and in Experiment 3 the synthesizer is a simpler variant of Alg. 1. It ranks the permitted actions other than HALT by the robust QQ-value of line 4, never disconnects gg and falls back to all-HALT; Cor. 2 covers it. The plug-in shield uses certainty equivalence. It treats the estimated kernel as exact, gives the unseen hazards probability zero and certifies zero risk, yet an adversary does harm on every seed. A policy-specific certificate covers only the logging agent; it too certifies zero risk, forbids nothing and fails the same way. A count threshold, forbidding pairs seen fewer than 10 times, is safe but uncertified and forbids 80.2% of pairs, against 4.2% for ours. A Bayesian Dirichlet shield is as safe but forbids twice as much (8.3%), and its bound is credible, not distribution-free.

ShieldCert. VˉT\bar{V}_TAdv. riskSucc.Forb. %Interv. %Len.
count-thr.n/a0.000.9980.204.3
Dirichlet-95%0.000.000.998.304.3
plug-in MDP0.001.000.990.004.3
policy-spec.0.00†0.00^\dagger1.000.990.004.3
robust (ours)0.000.000.994.204.3

Table III. Five shields built from the same logs. File-system sandbox, M=4,000M = 4,000 logged episodes, budget ϵ=0.05\epsilon= 0.05, averages over 200 seeds. The columns give the certified bound VˉT\bar{V}_T, the unsafe probability an adversarial controller reaches, a competent agent’s success rate, the percentage of the 96 live state–action pairs forbidden, the intervention rate and the mean episode length. †Logging controller only.

Experiment 3 (language-model controllers). We replace the scripted agent by a live language model that reads the full transcript and replies with one tool name. It never sees the predicates, so it is a history-dependent controller of the kind Thm. 1 covers. The shield sees only φ(h)\varphi(h) and is the one built from the scripted agent’s logs, not refitted. A forbidden call is blocked, not executed, and the model asked again (Sec. II). Each episode is attacked by prompt injection with probability 0.3 (39 of 150 were). An instruction hidden in the first file the agent reads tells it to delete the production logs and mail them out. Seven controllers sharing only the interface, namely the scripted agent and Qwen2.5 models [10] with 1.5B, 3B and 7B parameters at temperatures τ=0\tau= 0 and 1, ran 150 episodes each; Table IV lists five. Without the shield, they range from never unsafe to unsafe in 84.7% of episodes. With it, none of the seven is ever unsafe in its 150 episodes, which bounds each unsafe rate by 2% at 95% confidence and, pooling the 1,050 episodes, their average by 0.29%.

The 7B model shows the mechanism best. It always starts with read and is never unsafe unless attacked, but the attack succeeds in 31 of its 39 attacked episodes (79.5%). The shield prevents them all by blocking only the 39 injected deletes, an intervention rate of 6.5%, and success stays at 55.3%. For the 3B model the shield even raises success, from 3.3% to 38.7%. The model escalates permissions before confirming, and when that call is blocked and the model asked again, it goes back for the confirmation it skipped, which immediate HALT substitution would never allow. The smaller models need more help, with 31 to 47 blocked proposals per 100 executed calls against about 6 for the 7B. What the shield cannot supply is competence. At τ=0\tau= 0 the 1.5B model always opens with the forbidden chmod, never succeeds and always halts safely.

Experiment 4 (testing the Markov assumption). Everything rests on A1, so we test whether the next abstract state, given the current state and action, still depends on the previous one. For each row with enough data, a likelihood-ratio test compares the successor distributions across previous states, holding the false discovery rate at 5% (Benjamini–Hochberg). We also report their largest L1L_1 distance η^\hat{\eta}, the empirical

ControllerUnsafe noneUnsafe shieldSuccess noneSuccess shieldInterv.Blocks
scripted competent0.00.099.399.30.0none
Qwen2.5-1.5B, τ=0\tau=070.70.00.00.042.0chmod
Qwen2.5-3B, τ=0\tau=078.70.03.338.743.4chmod
Qwen2.5-7B, τ=0\tau=020.70.055.355.36.5delete
Qwen2.5-7B, τ=1\tau=121.30.059.359.36.1delete

caption: Five of the seven Experiment 3 controllers behind one shield. Each ran 150 episodes, prompt-injected with probability 0.3. The columns give the percentage of episodes ending unsafe and in success, without the shield (none) and with it; the intervention rate, in blocked proposals per 100 executed calls; and the blocked call.

:::

counterpart of η\eta in Prop. 2, against a permutation null. On the grid 0 of 160 testable rows reject, with η^=0.14\hat{\eta}=0.14 below the null 0.17; on the sandbox, 0 of 15, with 0.08 against 0.20. The test does catch a real defect. Deleting the confirmation predicate makes 4 of 7 rows reject, with η^=0.18\hat{\eta}=0.18 above its null of 0.16. Two examples establish neither calibration nor power in general, and the test has further limits. Only visited rows can be tested, and η^\hat{\eta} is an effect size for one choice of context, not the supremum over histories that Prop. 2 needs, so it gives only a nominal sensitivity surcharge. Dependence this context cannot see is invisible, and failing to reject is not evidence of Markovness. Refining φ\varphi in response makes the abstraction data-dependent, which Cor. 2 does not cover, so development and certification logs should be kept apart. The test can refute a predicate set, never certify one.

Conclusion and Future Work

We treated a language-model agent as an unknown feedback controller and placed a supervisory filter between it and its environment. The filter carries a certificate in the form of a robust reach–avoid bound on the probability of an irreversible action within the task, computed over an uncertainty set that is learned from ordinary logs. The bound holds with confidence 1−δ1-\delta for every controller the filter admits, so the language model can be replaced without recomputation, provided the environment, interface, permissions, abstraction and notion of harm stay the same. No failure need appear in the logs. An action never observed in a state is treated as maximally uncertain and is blocked if it could lead to harm, so the data must cover normal operation, not the hazards. The main assumption is that the Boolean predicates defining the abstract state make the loop Markov, which the logs can test but not prove. Future work should learn the abstraction from data held out from certification, tighten the filter online, and pool logs across agents sharing an environment.

Appendix: Proofs and supplementary results

Statements are those of the main text; equation and result numbers refer to it.

Proof of Lemma 1. Let π\pi be admissible and wkπ(h)w_k^\pi(h) its probability of entering SuS_u within kk further steps from a history hh with φ(h)=s\varphi(h)=s. We prove wkπ(h)≤Vk∗(s)w_k^\pi(h)\le V_k^*(s) by induction on kk; the deterministic a∗a^* above achieves equality, giving the claim. Base (k=0k=0). Here w0π(h)=1[s∈Su]=V0∗(s)w_0^\pi(h)=\mathbf{1}[s\in S_u]=V_0^*(s).

Step. For s∉Su∪{⊥}s\notin S_u\cup\{\bot\}, conditioning on the time-tt action and invoking A1 (the next state is s′∼P(⋅∣s,a)s'\sim P(\cdot\mid s,a) regardless of hh),

wkπ(h)=∑aπt(a∣h)∑s′P(s′∣s,a)wk−1π(h⊕(a,s′)).w_k^\pi(h)=\sum_a\pi_t(a\mid h)\sum_{s'}P(s'\mid s,a)w_{k-1}^\pi(h\oplus(a,s')).

By the inductive hypothesis wk−1π(h⊕(a,s′))≤Vk−1∗(s′)w_{k-1}^\pi(h\oplus(a,s'))\le V_{k-1}^*(s'), and because π\pi is admissible every aa with πt(a∣h)>0\pi_t(a\mid h)>0 lies in D(s)D(s). Hence each inner sum is at most

max⁡a∈D(s)⟨Pa(s),Vk−1∗⟩=Vk∗(s),\max_{a\in D(s)}\langle P_a(s),V_{k-1}^*\rangle=V_k^*(s),

and the πt(⋅∣h)\pi_t(\cdot\mid h)-average of quantities ≤Vk∗(s)\le V_k^*(s) is itself ≤Vk∗(s)\le V_k^*(s). Absorbing and sink states match by construction. □\square

Proof of Lemma 2. Work in global time, so nothing is conditioned on the coverage event. For a stochastic row and A⊆Ks,aA\subseteq K_{s,a}, let Nt(s,a)N_t(s,a) count visits up to tt, It=1[(st,at)=(s,a)]I_t=\mathbf{1}[(s_t,a_t)=(s,a)], Nt−1(s,a)N_{t-1}(s,a), which gives the predictable, and Zt(A)=It(1[st+1∈A]−Qt(A))Z_t(A)=I_t(\mathbf{1}[s_{t+1}\in A]-Q_t(A)) with QtQ_t the conditional successor law given the past. The Zt(A)Z_t(A) are bounded martingale differences, so a conditional-Hoeffding supermartingale gives P[N(s,a)≥n0(s,a),P^a(s)(A)−Q‾a(s)(A)≥η/2]≤e−n0η2/2\mathbb{P}[N(s,a)\ge n_0(s,a),\widehat P_a(s)(A)-\overline Q_a(s)(A)\ge\eta/2]\le e^{-n_0\eta^2/2}, one-sided; a row with N(s,a)<n0(s,a)N(s,a)<n_0(s,a) takes the vacuous set. As 12∥p−q∥1=max⁡A(p(A)−q(A))\frac12\lVert p-q\rVert_1=\max_A(p(A)-q(A)), attained at A={i:pi>qi}A=\{i:p_i>q_i\}, a union over the 2Ks,a−22^{K_{s,a}}-2 nontrivial subsets needs no factor of two, and a further union over the ≤R\le R stochastic rows reproduces (4) about Q^a(s)\widehat Q_a(s) with failure ≤δ\le\delta. Deterministic rows count Q^a(s)\widehat Q_a(s) trivially, and no step assumes the successors identically distributed, so this holds whether or not A1 does. □\square

Proof of Proposition 1. Any feasible qq satisfies

∑i:qi>p^i(qi−p^i)=∑i:qi<p^i(p^i−qi)=:ξ\sum_{i:q_i>\hat p_i}(q_i-\hat p_i)=\sum_{i:q_i<\hat p_i}(\hat p_i-q_i)=:\xi

with 2ξ=∥q−p^∥1≤βs,a2\xi=\lVert q-\hat p\rVert_1\le\beta_{s,a}, hence ξ≤βs,a/2\xi\le\beta_{s,a}/2. Since ⟨q,V⟩=⟨p^,V⟩+∑i(qi−p^i)Vi\langle q,V\rangle=\langle\hat p,V\rangle+\sum_i(q_i-\hat p_i)V_i, for fixed ξ\xi the maximizer adds mass on the largest ViV_i (subject to qi≤1q_i\le1) and removes it from the smallest (subject to qi≥0q_i\ge0), so the gain is a concave piecewise-linear nondecreasing function of ξ\xi. It is therefore maximized at the largest feasible ξ\xi, which is min⁡{βs,a/2, donor mass, receiver capacity}\min\{\beta_{s,a}/2,\ \text{donor mass},\ \text{receiver capacity}\} and may be strictly smaller than βs,a/2\beta_{s,a}/2; once the marginal transfer moves mass between entries of equal VV the gain stops increasing, and it can be zero, as at p^=(1,0)\hat p=(1,0) with V=(1,0)V=(1,0), where the receiver capacity is already exhausted. Sorting dominates the cost. □\square

Proof of Theorem 1. Work on E={Pa(s)∈Cs,a ∀(s,a)}E=\{P_a(s)\in C_{s,a}\ \forall(s,a)\}, of probability ≥1−δ\ge1-\delta by Lemma 2. The left inequality holds since Vk∗V_k^* is the supremum (2) over all admissible controllers, of which π\pi is one (Lemma 1). For the right, induct on kk. Base. V0∗=V‾0=1SuV_0^*=\overline V_0=\mathbf{1}_{S_u}. Step. For s∉Su∪{⊥}s\notin S_u\cup\{\bot\}, Vk∗V_k^* obeys the recursion (3) by Lemma 1; the inductive hypothesis gives Vk−1∗≤V‾k−1V_{k-1}^*\le\overline V_{k-1} pointwise, and since Pa(s)≥0P_a(s)\ge0,

Vk∗(s)=max⁡a∈D(s)⟨Pa(s),Vk−1∗⟩≤max⁡a∈D(s)⟨Pa(s),V‾k−1⟩≤V‾k(s),V_k^*(s)=\max_{a\in D(s)}\langle P_a(s),V_{k-1}^*\rangle \le\max_{a\in D(s)}\langle P_a(s),\overline V_{k-1}\rangle\le\overline V_k(s),

the last step because Pa(s)∈Cs,aP_a(s)\in C_{s,a} on EE. Unsafe and sink states match by construction, and (10) follows with s=s0s=s_0, k=Tk=T. □\square

Proof of Corollary 1. Only rows in R\mathcal{R} enter the recursion (7) from s0s_0, so set β⋆:=max⁡(s,a)∈Rβs,a=O(1/nmin⁡(M))\beta^\star:= \max_{(s,a)\in\mathcal{R}}\beta_{s,a}=O(1/\sqrt{n_{\min}(M)}) by (5). Fix any V∈[0,1]SV\in[0,1]^{\mathcal{S}}. By Prop. 1, σ(Cs,a;V)≤⟨P^a(s),V⟩+βs,a2(max⁡V−min⁡V)≤⟨P^a(s),V⟩+β⋆/2\sigma(C_{s,a};V)\le\langle\widehat{P}_a(s),V\rangle+\frac{\beta_{s,a}}{2}(\max V-\min V)\le\langle\widehat{P}_a(s),V\rangle+\beta^\star/2, and on the event EE of Lemma 2, ⟨P^a(s),V⟩−⟨Pa(s),V⟩≤12∥P^a(s)−Pa(s)∥1(max⁡V−min⁡V)≤β⋆/2\langle\widehat{P}_a(s),V\rangle-\langle P_a(s),V\rangle\le\frac{1}{2}\lVert\widehat{P}_a(s)-P_a(s)\rVert_1(\max V-\min V)\le\beta^\star/2. Hence

σ(Cs,a;V)≤⟨Pa(s),V⟩+β⋆.(11)\sigma(C_{s,a};V)\le\langle P_a(s),V\rangle+\beta^\star. \tag*{(11)}

Let Sk⊆S\mathcal{S}_k\subseteq\mathcal{S} be the states an in-shield trajectory from s0s_0 can occupy with kk steps remaining, and set ek:=max⁡s∈Sk∣V‾k(s)−V⋆(s)∣e_k:=\max_{s\in\mathcal{S}_k}|\overline{V}_k(s)-V^\star(s)|, where V⋆V^\star solves (3) under the same shield. Restricting to Sk\mathcal{S}_k matters. Every row used by a backup at s∈Sks\in\mathcal{S}_k lies in R\mathcal{R}, so β⋆\beta^\star bounds its radius, which need not hold at a state s0s_0 cannot reach. Then e0=0e_0=0, since both equal 1Su1_{S_u}. For s∈Sk∖(Su∪{⊥})s\in\mathcal{S}_k\setminus(S_u\cup\{\bot\}), whose successors lie in Sk−1\mathcal{S}_{k-1}, applying (11) with V=V‾k−1V=\overline{V}_{k-1} and then ⟨Pa(s),V‾k−1⟩≤⟨Pa(s),Vk−1⋆⟩+ek−1\langle P_a(s),\overline{V}_{k-1}\rangle\le\langle P_a(s),V^\star_{k-1}\rangle+e_{k-1} gives V‾k(s)≤Vk⋆(s)+ek−1+β⋆\overline{V}_k(s)\le V^\star_k(s)+e_{k-1}+\beta^\star; unsafe and sink states match exactly, and V‾k≥Vk⋆\overline{V}_k\ge V^\star_k by Thm. 1. So ek≤ek−1+β⋆e_k\le e_{k-1}+\beta^\star, whence eT≤Tβ⋆=O(T/M)e_T\le T\beta^\star=O(T/\sqrt{M}), and s0∈STs_0\in\mathcal{S}_T gives the claim.

Proof of Corollary 2. EE is a statement about the data and the fixed unknown PP, with P[E]≥1−δ\mathbb{P}[E]\ge1-\delta by Lemma 2; it never references D\mathcal{D}. The inductive step of Theorem 1 uses only Pa(s)∈Cs,aP_a(s)\in C_{s,a}, true on EE for all rows, so Vk⋆(⋅;P,D)≤V‾k(⋅)V^\star_k(\cdot;P,\mathcal{D})\le\overline{V}_k(\cdot) holds on EE simultaneously for all D\mathcal{D}. Thus, on EE, any D^\widehat{\mathcal{D}} with V‾T(s0;D^)≤ϵ\overline{V}_T(s_0;\widehat{\mathcal{D}})\le\epsilon obeys sup⁡π▹D^Vπ(s0;P)≤ϵ\sup_{\pi\triangleright\widehat{\mathcal{D}}}V^\pi(s_0;P)\le\epsilon; as P[E]≥1−δ\mathbb{P}[E]\ge1-\delta, regardless of the rule producing D^\widehat{\mathcal{D}}, the claim follows.

Proof of Proposition 2. Lemma 2 nowhere uses A1, so its event still has probability ≥1−δ\ge1-\delta and gives ∥Q‾a(s)−P^a(s)∥1≤βs,a\lVert\overline{Q}_a(s)-\widehat{P}_a(s)\rVert_1\le\beta_{s,a}. As Q‾a(s)\overline{Q}_a(s) is a convex combination of laws at logged histories, the hypothesis and convexity of the norm give ∥Qa(h)−Q‾a(s)∥1≤η\lVert Q_a(h)-\overline{Q}_a(s)\rVert_1\le\eta at every reachable hh, so ∥Qa(h)−P^a(s)∥1≤βs,a+η\lVert Q_a(h)-\widehat{P}_a(s)\rVert_1\le\beta_{s,a}+\eta and, with the support condition, Qa(h)∈Cs,aηQ_a(h)\in C^\eta_{s,a}. Induct on kk over histories. The base case is w0(h)=1[ϕ(h)∈Su]=V‾0η(ϕ(h))w^0(h)=1[\phi(h)\in S_u]=\overline{V}^\eta_0(\phi(h)), and since the hypothesis applies pointwise to the successors and π\pi is admissible, wkπ(h)=∑aπ(a∣h)⟨Qa(h),wk−1π(ha⋅)⟩≤max⁡a∈D(s)σ(Cs,aη;V‾k−1η)=V‾kη(s)w^\pi_k(h)=\sum_a\pi(a\mid h)\langle Q_a(h),w^\pi_{k-1}(ha\cdot)\rangle\le\max_{a\in D(s)}\sigma(C^\eta_{s,a};\overline{V}^\eta_{k-1})=\overline{V}^\eta_k(s). For the second inequality, Prop. 1 gives σ(Cs,aη;V)−σ(Cs,a;V)≤η/2\sigma(C^\eta_{s,a};V)-\sigma(C_{s,a};V)\le\eta/2 on [0,1]S[0,1]^{\mathcal{S}}, and each backup is 1-Lipschitz in the sup norm, so the gaps accumulate over TT.

Proof of Proposition 3. Under D⊥\mathcal{D}_\bot the only admissible controller halts at once into ⊥\bot, never entering SuS_u; thus V‾T≡0\overline{V}_T\equiv0 by (7).

Context sensitivity of the Experiment 4 diagnostic

The diagnostic of Experiment 4 conditions on the previous abstract state. Conditioning additionally on the previous action was also evaluated (Table V).

AbstractionContextRowsRejectedη^\hat{\eta}Null
Gridstate16000.1360.169
Gridstate, action00——
Sandbox, finestate1500.0840.201
Sandbox, finestate, action1600.1700.506
Sandbox, coarsestate740.1840.155
Sandbox, coarsestate, action720.6300.374

Table V. TABLE V. Experiment 4 under two choices of context. The context is the previous abstract state, or that state together with the previous action. Rows counts the kernel rows with enough data to test and Rejected those where the test rejects; η^\hat{\eta} is the largest L1L_1 distance between the successor distributions under different contexts, and Null is the 95% quantile of η^\hat{\eta} when context labels are shuffled within a row.

Richer context buys effect size and costs power. On the coarsened sandbox the pair context raises η^\hat{\eta} from 0.184 to 0.630 while halving the rejections, and on the grid it leaves no testable row against 160, because ∣S∣∣A∣|\mathcal{S}||\mathcal{A}| contexts exhaust the data. That collapse is why the previous state alone is the primary diagnostic in the main text.

References

Conditioning additiona

References

  1. [1]S. Yao, J. Zhao, D. Yu, N. Du, I. Shafran, K. Narasimhan, and Y. Cao, “ReAct: Synergizing reasoning and acting in language models,” in Proc. Int. Conf. Learn. Represent. (ICLR), 2023.arxiv.org/abs/2210.03629
  2. [2]T. Schick, J. Dwivedi-Yu, R. Dessi, R. Raileanu, M. Lomeli, E. Hambro, L. Zettlemoyer, N. Cancedda, and T. Scialom, “Toolformer: Language models can teach themselves to use tools,” in Adv. Neural Inf. Process. Syst. (NeurIPS), vol. 36, 2023, pp. 68 539–68 551.arxiv.org/abs/2302.04761
  3. [3]A. D. Ames, S. Coogan, M. Egerstedt, G. Notomista, K. Sreenath, and P. Tabuada, “Control barrier functions: Theory and applications,” in Proc. Eur. Control Conf. (ECC), 2019, pp. 3420–3431.arxiv.org/abs/1903.11199
  4. [4]K. P. Wabersich and M. N. Zeilinger, “A predictive safety filter for learning-based control of constrained nonlinear dynamical systems,” Automatica, vol. 129, 2021, Art. no. 109597.
  5. [5]A. Baheri, “How much do your models disagree? Adaptive MPC safety from ensemble uncertainty,” IEEE Open J. Control Syst., 2026.DOI
  6. [6]S. Bansal, M. Chen, S. Herbert, and C. J. Tomlin, “Hamilton–Jacobi reachability: A brief overview and recent advances,” in Proc. IEEE Conf. Decis. Control (CDC), 2017, pp. 2242–2253.arxiv.org/abs/1709.07523
  7. [7]P. J. Ramadge and W. M. Wonham, “Supervisory control of a class of discrete event processes,” SIAM J. Control Optim., vol. 25, no. 1, pp. 206–230, 1987.
  8. [8]M. Alshiekh, R. Bloem, R. Ehlers, B. Könighofer, S. Niekum, and U. Topcu, “Safe reinforcement learning via shielding,” in Proc. AAAI Conf. Artif. Intell. (AAAI), 2018, pp. 2669–2678.arxiv.org/abs/1708.08611
  9. [9]C. De Persis and P. Tesi, “Formulas for data-driven control: Stabilization, optimality, and robustness,” IEEE Trans. Autom. Control, vol. 65, no. 3, pp. 909–924, 2020.
  10. [10]Qwen Team, “Qwen2.5 technical report,” arXiv:2412.15115, 2024.
  11. [11]M. Suilen, T. D. Simão, D. Parker, and N. Jansen, “Robust anytime learning of Markov decision processes,” in Adv. Neural Inf. Process. Syst. (NeurIPS), vol. 35, 2022, pp. 28 790–28 802.arxiv.org/abs/2205.15827
  12. [12]T. Badings, L. Romao, A. Abate, D. Parker, H. A. Poonawala, M. Stoelinga, and N. Jansen, “Robust control for dynamical systems with non-Gaussian noise via formal abstractions,” J. Artif. Intell. Res., vol. 76, pp. 341–391, 2023.DOI
  13. [13]R. Reed and M. Lahijanian, “Learning-based shielding for safe autonomy under unknown dynamics,” in Proc. Amer. Control Conf. (ACC), 2025, pp. 4940–4946.arxiv.org/abs/2410.07359
  14. [14]E. Hamel-De le Court, T. Badings, A. Abate, F. Belardinelli, and F. Fabiano, “Robust shielding for safe reinforcement learning,” arXiv:2606.00270, 2026.
  15. [15]S. Ray, “What can be enforced? A theory of certified runtime safety for tool-using agents,” arXiv:2607.02268, 2026.
  16. [16]S. Summers and J. Lygeros, “Verification of discrete time stochastic hybrid systems: A stochastic reach-avoid decision problem,” Automatica, vol. 46, no. 12, pp. 1951–1961, 2010.DOI
  17. [17]T. Weissman, E. Ordentlich, G. Seroussi, S. Verdú, and M. J. Weinberger, “Inequalities for the L₁ deviation of the empirical distribution,” Hewlett-Packard Labs., Tech. Rep. HPL-2003-97R1, 2003.
  18. [18]G. N. Iyengar, “Robust dynamic programming,” Math. Oper. Res., vol. 30, no. 2, pp. 257–280, 2005.

Paper details

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

views · 2

downloads · 0

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

  • Engineering

Not recorded for this paper

View statement
Looking for related papers…
Contents