Backdooring the Safety Filter: Trigger-Conditional Poisoning of Stochastic Barrier Certificates and Their Anytime-Valid Detection

Autonomous systems increasingly delegate safety to a two-part architecture: a learned policy proposes actions, and an independent safety filter — a control barrier function that defines a forbidden region and overrides any action that would push the system toward it — has the final word. When the world is noisy, the barrier must become probabilistic: instead of promising the state never leaves the safe set, it promises this with high probability, using the mathematics of supermartingales (a quantity that, in expectation, only decreases) and concentration inequalities. Meanwhile, the backdoor-attack literature has shown that learned components can be silently corrupted during training so that they behave correctly on ordinary inputs but misbehave only when a rare trigger appears — with poisoning budgets as small as 0.0006% of training data SleeperNets.

These two lines have never met, and the meeting matters. The safety filter is deployed precisely because the policy cannot be trusted; if the filter itself is the poisoned component, the entire defense-in-depth argument of The Safety Filter: A Unified View of Safety-Critical Control in Autonomous Systems collapses into a single point of failure. In particular, Data-Driven Learning of Safety-Critical Control with Stochastic Control Barrier Functions trains a neural network on sampled state transitions to learn the unknown noise term of a stochastic barrier and then uses it inside an online quadratic program (QP); it explicitly assumes the transition data is uncorrupted. Nobody has tested that assumption, and the RL-backdoor literature gives strong reason to doubt it.

Core Claim

The claim is twofold. First, the data-driven stochastic barrier pipeline is backdoorable: by altering a vanishingly small fraction of the transition tuples used to fit the learned noise term, an attacker can implant a trigger-conditional corruption that passes every standard offline validation on clean data, yet strips (or inflates) the safety margin exactly when the trigger appears, causing physical constraint violations or deliberate deadlock. Second — and this is the constructive half — the same martingale machinery that certifies safety under noise yields a runtime detector with provable false-alarm control: an independent monitoring barrier, scored by a test supermartingale, raises an alarm whenever the controlled system's behavior is inconsistent with the certified drift and variance, catching the corrupted filter before the first violation.

The closest existing work differs in kind. SleeperNets SleeperNets and BadRL: Sparse Targeted Backdoor Attack against Reinforcement Learning poison rewards to hijack policies, and never touch safety filters or certificates. Barrier Certificate based Safe Control for LiDAR-based Systems under Sensor Faults and Attacks handles runtime sensor spoofing against an honest barrier, not training-time poisoning of the barrier itself. STRIP: A Defence Against Trojan Attacks on Deep Neural Networks and Fine-Pruning: Defending Against Backdooring Attacks on Deep Neural Networks defend classifiers by perturbing inputs or pruning dormant neurons — neither applies to a regression network that maps states to noise statistics and is never shown adversarial inputs at test time. And Beware Untrusted Simulators -- Reward-Free Backdoor Attacks in Reinforcement Learning poisons simulators for reward learning, not for safety-certificate learning.

Research Program

The attack works as follows. In the pipeline of Data-Driven Learning of Safety-Critical Control with Stochastic Control Barrier Functions, the unknown diffusion contribution $\Delta(x) = \frac{1}{2}\mathrm{Tr}[g(x)g(x)^\top \nabla^2 h(x)]$ is fit by regressing the observed one-step change of the barrier onto the current state. The attacker, who controls a sliver of the data-collection process (a subcontracted simulator, a crowdsourced robot fleet, or a poisoned replay buffer), selects tuples whose states fall in a designated trigger region — a rare but physically realizable sensor configuration — and relabels them to be consistent with near-zero (or grossly inflated) diffusion. Because the trigger is rare in clean operation, the fitted network $\hat{\Delta}(x)$ remains accurate everywhere it is validated, exactly the sleeper behavior documented for policies in SleeperNets — but under the trigger, the online QP safety filter believes the world is noiseless, drops its margin, and permits aggressive inputs that the real noise then converts into violations. The inflation variant instead makes the QP persistently conservative or infeasible on trigger states, a liveness attack that freezes the vehicle. Crucially, no reward signal is touched, so the reward-outlier detection that SleeperNets itself admits is its weak point is blind here by construction.

The defense is a monitor built from the same theory the attacker corrupts. Alongside the controlling barrier, we run an independent monitoring barrier $B_m$ whose drift and conditional variance predictions come from a trusted, deliberately coarse source — an analytic barrier with a conservative bound on the noise variance, in the spirit of the robust buffers in Robust Safety under Stochastic Uncertainty with Discrete-Time Control Barrier Functions and the predictable-quadratic-variation accounting of Bounding Stochastic Safety: Leveraging Freedman's Inequality with Discrete-Time Control Barrier Functions. Each observed barrier increment is scored into a nonnegative test supermartingale $M_t$ that has expected value at most 1 at every step under honest behavior; we alarm when

$$M_t \;=\; \prod_{k\le t} m_k \;\ge\; \frac{1}{\alpha}, \qquad \mathbb{E}[m_k \mid \mathcal{F}_{k-1}] \le 1,$$

where $\mathcal{F}_{k-1}$ is the history up to step $k-1$ and $\alpha$ is the chosen false-alarm budget. By Ville's inequality — the same bound used for safety certification in Robust Safety under Stochastic Uncertainty with Discrete-Time Control Barrier Functions — the probability of ever falsely alarming is at most $\alpha$, uniformly over time. When the controlling barrier is corrupted and the QP starts issuing actions that the trusted monitor's physics says are unsafe, $B_m$ climbs against its predicted downward drift and $M_t$ blows past $1/\alpha$ quickly. A second, cheap channel catches the inflation variant: persistent QP infeasibility events are logged and counted against the same $\alpha$ budget via a simple sequential test. The theoretical deliverable is a characterization of which corruptions are detectable: any attack that changes the closed-loop barrier statistics by more than the coarse model's slack is caught, and we quantify that slack as a function of the model mismatch between monitor and plant.

Proposed Experiments

All experiments run in three tiers of environments already used by the underlying literature, so every number is comparable to a published anchor. Tier one reproduces the exact benchmarks of Data-Driven Learning of Safety-Critical Control with Stochastic Control Barrier Functions: the stochastic inverted pendulum with $b = [0.10, 0]^\top$, where clean DDSCBF reports a 91% safety success rate (versus 92% for an analytic SCBF with known diffusion and 0% for a deterministic CBF), and the nonlinear SDE with $b(x_2)=0.1x_2$, where clean DDSCBF reports 84.3% (analytic SCBF 86.8%, deterministic CBF 77.3%). Tier two uses Safe-Control-Gym (cart-pole, 1D and 2D quadrotor), whose native stochastic disturbance injection — white noise, step, and impulse — gives the noise regimes the attack must survive. Tier three is Safety-Gymnasium's Safety Car navigation task Safety Gymnasium: A Unified Safe Reinforcement Learning Benchmark, the same continuous-control environment where SleeperNets achieved a 100% attack success rate with benign return ratio above 96.5%, letting us compare policy-level and filter-level attacks head-to-head on identical terrain.

The metrics are the backdoor community's own: poisoning budget as a fraction of transition tuples, trigger-conditional violation rate (the attack analogue of attack success rate), clean-state safety rate (the analogue of benign return ratio), and, for the defense, false-alarm rate under pure noise versus time-to-alarm under attack. The decisive pattern we expect, and will state as falsifiable: with poisoning budgets in the $10^{-3}$–$10^{-4}$ range — bracketing the 0.0006% of SleeperNets and the 0.003% of BadRL — the trigger-conditional violation rate should jump from the clean ~9% failure level to the majority of triggered episodes while clean safety stays within about two points of the published 91%/84.3%, and the monitor should alarm before the first physical violation in the large majority of triggered runs at a false-alarm rate at or below its Ville budget of $\alpha = 0.01$. For the high-fidelity tier, the Unitree A1 corridor study of Robust Safety under Stochastic Uncertainty with Discrete-Time Control Barrier Functions — where a standard DTCBF gave 6 violations, the Jensen-compensated controller 1, over 500 Monte-Carlo trials — provides the template for validating that the attack also defeats the Jensen-enhanced buffer $c_J$, which is the strongest published margin-hardening against stochastic noise.

Baselines

The naive reference point is the unattacked system: clean DDSCBF, with its published 91% pendulum and 84.3% nonlinear-benchmark safety rates Data-Driven Learning of Safety-Critical Control with Stochastic Control Barrier Functions, run on identical environments, seeds, and compute with our attacked versions. This anchors how much safety the attack destroys per unit of poisoning. The strongest competing attack — and the one a reviewer will demand — is SleeperNets SleeperNets backdooring the policy while the stochastic barrier filter stays clean, run in the same Safety Car environment with the same budget sweep; its published numbers (100% ASR, BRR above 96.5%, 0.0006% poisoning) are the bar our filter-level attack must clear to show it is not strictly dominated by the simpler threat. If the intact filter neutralizes SleeperNets-style hijacking, that is itself a novel positive result for control-theoretic defense and frames our attack as the necessary counter-move. On the defense side, the strongest competitors are a variance-padded robust QP — replacing $\hat{\Delta}(x)$ with an upper-confidence inflation tuned on clean data until clean safety equals that of the unpadded system — and the Jensen buffer $c_J$ of Robust Safety under Stochastic Uncertainty with Discrete-Time Control Barrier Functions; each gets the same data and tuning budget as our monitor, and beating them means catching attacks they miss at equal or better clean-state performance. Finally, an STRIP-style screening adapted to regression — superimposing trigger candidates onto states and watching for output anomalies — will be run as an offline defense baseline; STRIP's reported 0% false acceptance and false rejection on CIFAR-10 and GTSRB STRIP is the reference, though it was built for classifiers and we expect it to fail here. The key ablation isolates our central ingredient: the monitor run with drift-only (Ville-style) scoring versus the full drift-plus-quadratic-variation e-process, and the attack run with corruption only in the diffusion term versus only in the drift correction, which together pin down which half of the theory carries the detection power.

Why not just…?

Why not just backdoor the policy with SleeperNets and leave the barrier alone? Because the barrier is the component the safety-filter architecture The Safety Filter: A Unified View of Safety-Critical Control in Autonomous Systems exists to protect, and a defense is only as strong as its last honest layer. Policy attacks are also costlier for the adversary in access terms: SleeperNets needs replay-buffer or trajectory-level access, while our attack only needs to influence the offline transition dataset used to fit one scalar field. Still, this is a real threat to the proposal's framing, and the head-to-head Safety Car experiment is designed to settle it: if the intact stochastic filter already stops backdoored policies, the filter-level attack is the only remaining route; if it does not, our contribution narrows honestly to the detection half.

Why not just inflate the learned variance everywhere (a padded QP) instead of building a monitor? For the suppression variant of the attack, padding may well blunt it — we treat this seriously as a baseline rather than an afterthought, and if padding defeats every attack variant at acceptable clean performance, the honest conclusion will be that cheap robustness suffices and the monitor is unnecessary. But padding is one-sided: it cannot see the inflation variant, which causes QP infeasibility and deadlock rather than violations, and it degrades nominal performance to buy robustness against a trigger the defender cannot name in advance. The monitor detects both directions and, unlike padding, comes with a provable $\alpha$ false-alarm budget rather than a heuristic margin.

Why not just run standard Trojan defenses — input-perturbation screening or fine-pruning — on the barrier network? STRIP works because a trigger visibly changes a classifier's outputs under input superimposition, reporting 0% false acceptance and rejection on CIFAR-10/GTSRB with about 1.32x inference latency STRIP; a state-to-noise-statistic regression network has no such output signature, and the physically meaningful perturbations of a state are not superimposable patches. Fine-pruning removes dormant capacity Fine-Pruning, but the diffusion field is genuinely needed everywhere, so pruning risks deleting the true physics along with the implant; we will test this empirically, but the more fundamental gap is that both defenses are static and offline, while the attack only manifests in closed loop under real noise — which is exactly the regime our runtime monitor watches. Neither defense would catch a corruption planted through the decentralized post-training channels documented in Backdoor Attacks on Decentralised Post-Training.

Why not just validate on a held-out set of fresh transitions? That is the assumption the whole attack refutes: backdoors are by definition trigger-conditional, so a clean holdout contains no triggers and the corrupted $\hat{\Delta}$ passes validation — the same stealth SleeperNets achieves with a benign return ratio above 96.5%. The holdout experiment is therefore part of the attack demonstration, not a defense against it.

Decisive Checks and Limitations

Three outcomes would each be decisive. If trigger-conditional violations rise steeply at SleeperNets-scale budgets across all three environment tiers while clean validation passes, the vulnerability is real and the field's confidence in data-driven stochastic certificates is misplaced; the mitigation is our monitor. If the monitor's false-alarm rate exceeds its Ville budget in any clean-noise regime, the coarse trusted model is too loose and the detection claim fails honestly — the theory says exactly which model mismatch it can absorb, and we will report that boundary. And if the padded QP defeats the attack entirely at negligible clean cost, the field gets a cheaper answer than ours, which we would report as such. The known limitation we cannot fully close within this proposal is non-stationary or heavy-tailed noise: both the certificates (as noted in Bounding Stochastic Safety: Leveraging Freedman's Inequality with Discrete-Time Control Barrier Functions) and our monitor assume conditionally zero-mean disturbances with predictable quadratic variation, so an attacker who can also corrupt the noise itself at trigger times escapes both the certificate and the detector — a harder threat we flag as the natural successor problem, alongside extending the monitor to neural certificates verified by interval bound propagation in Neural Continuous-Time Supermartingale Certificates, whose sound-but-incomplete verification is, per Gap 4 in the literature, another untested backdoor surface.