arXiv:2610.27726eess.SYOct 2026

Manuscript Offprint

arXiv:2610.27726

Anytime-Valid Runtime Monitoring of Learned Barrier Certificates

Zhipeng Cao, Taoran Wu, Weiru Cui, Luke Ong, Bai Xue

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Learned barrier certificates provide a principled mechanism for establishing safety of stochastic systems, but their validity may deteriorate during deployment when the underlying dynamics differ from those used for training. We propose an anytime-valid runtime monitor that audits a learned barrier certificate using observed closed-loop trajectories. The monitor is intended to detect loss of statistical support for the deployed barrier condition; it does not by itself guarantee detection before unsafe entry or safety of a subsequent intervention. Specifically, the conditional barrier-drift condition is formulated as an episode-wise sequential hypothesis test, and observed barrier increments are transformed into a nonnegative test supermartingale, yielding finite-sample false-alarm control under arbitrary stopping times. Inspired by finite-horizon safety verification, we further introduce a deterministic temporal shaping of the monitoring boundary, making the monitor more conservative early in a prescribed deployment horizon while preserving anytime-validity. The monitor is designed to detect statistical evidence that the safety certificate is no longer consistent with the observed dynamics, rather than to predict unsafe entry. To assess the monitor empirically, we evaluate empirical alarm behavior under valid and invalid certificates. Code and data are available at https://github.com/FormalCert-AI/runtime-barrier-monitor.

1 Introduction

Safety is a critical requirement for learning-enabled autonomous systems operating in uncertain and evolving environments. In robotics, autonomous driving, and cyber-physical infrastructure, even rare failures can be catastrophic, making purely data-driven validation insufficient for deployment (Chougule et al. 2023; Uesato et al. 2018). Consider an autonomous drone navigating a cluttered warehouse whose floor plan changes over time. A barrier trained in simulation may provide a probabilistic safety guarantee under the assumed system dynamics and disturbance model, but unmodeled disturbances or environmental changes may invalidate the deployed safety certificate. This motivates runtime monitoring mechanisms that continuously assess whether the assumptions supporting a deployed safety certificate remain consistent with observed system behavior and, when necessary, trigger appropriate safety interventions.

Barrier certificates (Prajna and Jadbabaie 2004; Prajna, Jadbabaie, and Pappas 2007) certify safety through a scalar function B(x)B(x) whose expected value does not increase along trajectories, offering a scalable alternative to reachability analysis. In practice, however, the barrier B is learned from data, which introduces a fundamental verification gap: finite datasets provide incomplete coverage, simulation-to-reality mismatch induces distribution shift, and black-box models resist formal verification. In stochastic environments, iterative test-then-train refinement on counterexamples also cannot guarantee global validity of the updated certificate.

Rather than pursuing complete verification, we shift the focus to runtime monitoring and alarm-triggered intervention. The key idea is to continuously audit the deployed barrier using observed closed-loop trajectories and detect statistical evidence that the certificate is no longer consistent with the underlying dynamics. When sufficient evidence accumulates, the monitor can trigger a predefined intervention or fallback mechanism, thereby providing a practical mechanism for responding to potential loss of certificate validity during deployment. It is worth noting that the monitor is not designed to predict the exact time of unsafe entry, nor does it guarantee detection before every safety violation. Its purpose is to identify statistically significant evidence that the validity of the safety certificate is in question.

To realize this, we formulate runtime barrier auditing as an anytime-valid sequential hypothesis test based on e-processes (test supermartingales) and predictable plug-in betting strategies (Ramdas et al. 2023; Shafer et al. 2011; Vovk and Wang 2021; Shafer 2021; Waudby-Smith and Ramdas 2022). Observed barrier-value increments are converted into betting factors whose product forms a nonnegative test supermartingale. Consequently, the monitor retains finite-sample false-alarm control under arbitrary stopping times within an episode, allowing evidence to be assessed continuously without sacrificing the prescribed statistical validity. A finite deployment horizon also provides useful temporal structure for monitoring. Inspired by finite-horizon safety verification (Xue 2025), we introduce a deterministic time-varying scaling of the monitoring boundary that makes the monitor more conservative at early time steps and gradually approaches the standard anytime-valid threshold as the prescribed horizon is reached. The resulting framework combines anytime-valid runtime monitoring with a finite-horizon temporal boundary tailored to the deployment horizon.

The formal guarantee concerns the statistical validity of the barrier-condition monitor: when the learned barrier satisfies its conditional supermartingale condition, the probability of an alarm within an episode is controlled at the prescribed level. The theory does not guarantee detection of every barrier violation, detection before unsafe entry, or safety of the intervention taken after an alarm. These properties are therefore evaluated empirically and distinguished from the statistical false-alarm guarantee.

The contributions of this work are summarized as follows.

  1. Anytime-valid barrier auditing: We formulate the conditional drift condition underlying a stochastic barrier certificate as an episode-wise sequential hypothesis test and construct an e-process from observed barrier increments. The monitor provides finite-sample level- α\alpha false-alarm control under arbitrary within-episode stopping times.

  2. Finite-horizon boundary shaping: Motivated by finite-horizon safety verification results (Xue 2025), we introduce a deterministic time-varying scaling of the monitoring boundary to tailor the monitor to a prescribed finite deployment horizon. The resulting exponential boundary profile is more conservative at early time steps and gradually approaches the standard anytime-valid threshold as the deployment horizon is reached.