Optimization Based Safety Filtering via Control Barrier Functions

320 concepts253 papers1 proposal

When designing autonomous systems—whether self-driving cars, robotic manipulators, or quadrotors—there is a fundamental tension between performance and safety. We want an agent to maximize its performance (e.g., tracking a trajectory quickly, maximizing a reward function, or responding to human joystick inputs), but we must strictly guarantee it never violates physical boundaries, such as colliding with an obstacle or exceeding actuator limits.

Traditional control methods often try to solve both problems simultaneously, baking safety constraints directly into the primary controller. However, this can make the controller overly conservative, computationally heavy, or prone to failure when faced with complex environments.

Optimization-based safety filtering offers an elegant alternative: decouple performance from safety. By introducing a real-time supervisory layer, we can let any arbitrary "nominal" controller propose actions, and minimally modify them only when safety is actively threatened.

The Core Intuition: Minimal Intervention

The safety filter acts as a wrapper or "shield" around an existing system. It takes a nominal control input $u_{\text{nom}}$—which could come from a human pilot (Zhou et al.), a reinforcement learning agent (Cheng et al.), or a legacy cruise control system (Xu et al.)—and outputs a modified control input $u$.

The filter operates on the principle of minimal intervention. If the nominal input is safe, the filter passes it through completely unchanged. If $u_{\text{nom}}$ would drive the system into danger, the filter calculates the smallest possible correction required to keep the system safe. This architecture allows developers to design high-performance or legacy control laws without worrying about safety violations, leaving the heavy lifting of constraint enforcement to the filter.

Mathematical Foundation: Control Barrier Functions

To understand why this works, we must look at how safety is mathematically certified. We define a safe operating region as a set $\mathcal{C}$ where a scalar state function $h(x)$ is non-negative:

$$\mathcal{C} = \{x \in \mathbb{R}^n : h(x) \ge 0\}$$

The boundary between safety and danger occurs exactly at $h(x) = 0$. To guarantee that the system never leaves the safe set (a property known as forward invariance), we must ensure that the system's velocity vector points back toward the interior whenever it gets close to the boundary.

This is achieved using a Control Barrier Function (CBF). Formally, we enforce the following condition on the derivative of $h(x)$ over time:

$$\dot{h}(x) \ge -\alpha(h(x))$$

Here, $\alpha$ is a strictly increasing function where $\alpha(0) = 0$.

Let's break down the intuition of this inequality:

  1. Deep inside the safe set: When the system is far from danger, $h(x)$ is a large positive number. This means $-\alpha(h(x))$ is a large negative number, allowing $\dot{h}(x)$ to be negative. In plain terms, the system is allowed to move rapidly toward the boundary when it is far away.
  2. Approaching the boundary: As the system gets closer to danger, $h(x)$ approaches $0$. Consequently, $-\alpha(h(x))$ also approaches $0$. This forces $\dot{h}(x) \ge 0$, meaning the system must slow down, stop, or turn around. It creates a smooth, impenetrable mathematical cushion that prevents the state from ever crossing into the unsafe region.

The Filter Mechanism: Real-Time Quadratic Programming

The magic of the CBF framework happens when we apply it to control-affine dynamical systems, which take the form:

$$\dot{x} = f(x) + g(x)u$$

Using the chain rule, we can expand the time derivative $\dot{h}(x)$ into its spatial components (Lie derivatives):

$$\dot{h}(x) = \frac{\partial h}{\partial x}\dot{x} = L_f h(x) + L_g h(x)u$$

Substituting this back into our CBF safety condition yields:

$$L_f h(x) + L_g h(x)u \ge -\alpha(h(x))$$

Notice a crucial property: this inequality is entirely linear with respect to the control input $u$.

Because the constraint is linear, we can frame the safety filter as a convex Quadratic Program (QP). At every single time step, the system solves the following optimization problem:

$$\min_{u} \frac{1}{2} \|u - u_{\text{nom}}\|^2$$

$$\text{subject to } L_f h(x) + L_g h(x)u \ge -\alpha(h(x))$$

The objective function minimizes the squared difference between the executed control $u$ and the desired nominal control $u_{\text{nom}}$. Because convex QPs can be solved globally and deterministically in microseconds, this optimization can run online inside high-frequency robotic control loops.

As long as $u_{\text{nom}}$ satisfies the safety inequality, the optimal solution is exactly $u = u_{\text{nom}}$. The filter remains completely passive until the system approaches the boundary, at which point it minimally alters the command to satisfy the constraint, as demonstrated by Wang et al. (Wang et al.) and Lavanakul et al. (Lavanakul et al.).

Managing Real-World Complexity

While the basic QP-CBF formulation is elegant, real-world deployment introduces challenges like multi-agent coordination, sensor noise, and discrete-time hardware limitations.

Multi-Agent Systems

In multi-robot environments, safety filters can be distributed across agents as decentralized "safety barrier certificates" (Wang 0050 et al.; Safety Barrier Certificates for Collisions-Free Multirobot Systems). Each robot solves its own local QP, accounting for the relative dynamics of its neighbors, ensuring global collision avoidance without requiring a centralized coordinator.

Robustness and Uncertainty

When physical systems experience environmental disturbances or sensor noise, the nominal system model breaks down, risking safety violations. To handle this, researchers have developed robust variants. For instance, Hamdipoor et al. (Hamdipoor et al.) introduced Environmentally Robust CBFs to handle moving, uncertain obstacles, while Tan et al. (Tan et al.) designed secure safety filters that maintain forward invariance even when sensors are subjected to malicious adversarial spoofing.

Discrete-Time Hardware

Continuous-time mathematical guarantees can degrade when implemented on discrete-time microcontrollers, occasionally causing high-frequency chattering or momentary safety filter inactivity. Zhou et al. (Zhou et al.) mitigated this by incorporating penalty terms and safe set approximations directly into the QP objective. Alternatively, for highly resource-constrained hardware where solving a QP at every step is computationally prohibitive, Zhang et al. (Zhang et al.) demonstrated that closed-form approximate projection operators can bypass the optimization solver entirely, mapping inputs to the safe space near-instantaneously.

By providing a rigorous mathematical bridge between high-level performance goals and low-level physical constraints, optimization-based safety filtering remains a cornerstone of modern dependable autonomy.

History & citationVersion 2 · 2026-10-04

Current · Permanent link

  1. Version 2 (latest) · 2026-10-04 · 232 papers
  2. Version 1 · 2026-10-04 · 253 papers
Cite this direction

Latest version (a living page):

@misc{lacuna_optimization_based_safety_filtering_e25cbd59,
  title = {optimization-based safety filtering},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/optimization-based-safety-filtering/rdr_e25cbd59d82946c6bd354eccc93fcc18},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-20},
}

This exact version (version 2, frozen text):

@misc{lacuna_optimization_based_safety_filtering_e25cbd59_v2,
  title = {optimization-based safety filtering},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/optimization-based-safety-filtering/rdr_e25cbd59d82946c6bd354eccc93fcc18/v/2},
  note = {Version 2, frozen 2026-10-04. Accessed 2026-11-20},
}
About

These directions overlap with this one through shared papers.

See something wrong? Report a mistake