A Control Barrier Function (CBF) is a mathematical tool used in safety-critical control to synthesize controllers that formally guarantee a dynamical system will remain within a predefined safe set. It works by defining a scalar function, h(x), whose superlevel set represents the safe region. The core innovation is a constraint derived from the CBF that, when enforced on the system's control inputs at every timestep, ensures h(x) remains non-negative, thus keeping the state x safe. This transforms a complex safety requirement into a simple, instantaneous condition on allowable control actions.
Glossary
Control Barrier Function (CBF)

What is a Control Barrier Function (CBF)?
A mathematical formalism for synthesizing controllers that provide formal, provable safety guarantees for dynamical systems.
The power of CBFs lies in their integration with optimization-based controllers, like Quadratic Programs (QPs). A typical CBF-based controller solves a QP that minimally modifies a nominal, performance-driven control input to satisfy the CBF safety constraint. This provides a formal guarantee of forward invariance of the safe set. CBFs are closely related to Lyapunov functions for stability but are specifically designed for safety. They are fundamental in robotics and autonomous systems for tasks like collision avoidance, where they ensure a vehicle or robot never enters an unsafe region defined by obstacles.
Core Properties of Control Barrier Functions
A Control Barrier Function (CBF) is a mathematical tool used to synthesize safety-critical controllers. Its core properties are what enable the formal, provable guarantee that a system will remain within a predefined safe set.
The Forward Invariance Guarantee
The fundamental property of a valid CBF is that it ensures forward invariance of the safe set. If the system starts inside the safe set (defined by the CBF), it is mathematically guaranteed to never leave it under the derived control law. This is not just probabilistic safety; it is a formal, deterministic certificate.
- Formal Definition: For a safe set (C), a CBF (h(x)) is designed such that (C = {x : h(x) \geq 0}). The control law is synthesized to ensure (\dot{h}(x, u) \geq -\alpha(h(x))), where (\alpha) is a class (\mathcal{K}) function. This inequality, known as the CBF condition, is the mathematical engine of the guarantee.
Relative Degree and High-Order CBFs
A CBF's relative degree is the number of times it must be differentiated with respect to time before the control input (u) explicitly appears. For many physical systems (e.g., a car where safety depends on position but control is acceleration), the safety constraint has a relative degree greater than one.
- Standard CBFs apply when the control input appears in the first derivative ((\dot{h})).
- High-Order CBFs (HOCBFs) extend the framework to handle constraints with higher relative degrees. They construct a series of derivative conditions to ensure the original constraint (h(x) \geq 0) is satisfied, effectively "pushing" the control influence back through the system's dynamics.
The CBF as a Safety Filter
A primary application is the CBF-based Quadratic Program (CBF-QP). This property allows CBFs to act as a real-time safety filter for any legacy or performance-driven controller (e.g., an LQR or learning-based policy).
- Process: At each control cycle, the nominal controller proposes a desired input (u_{nom}).
- Optimization: A small, fast QP is solved: minimize (||u - u_{nom}||^2) subject to the CBF condition (\dot{h}(x, u) \geq -\alpha(h(x))).
- Result: The output (u^*) is the control closest to the nominal one that is provably safe. This decouples performance design from safety certification.
Composition and Multiple Constraints
Real-world systems must often satisfy multiple concurrent safety constraints (e.g., avoid several obstacles, stay within joint limits, maintain a safe distance from humans). A key property is that CBFs can be composed.
- For (m) constraints with functions (h_1(x), ..., h_m(x)), the controller must satisfy all CBF conditions simultaneously: (\dot{h}_i(x, u) \geq -\alpha_i(h_i(x))), for (i = 1,...,m).
- These form multiple constraints in the safety-filter QP. The solution finds a control input that satisfies all constraints, if such an input exists within the actuator limits. This makes CBFs scalable to complex operational environments.
Relationship to Lyapunov Functions
CBFs are conceptually dual to Lyapunov functions, which certify stability. Understanding this relationship is crucial for unified controller design.
- Lyapunov Function (V(x)): Certifies convergence to a goal. Requires (\dot{V}(x) \leq 0) (energy decreases).
- Control Barrier Function (h(x)): Certifies remaining in a safe set. Requires (\dot{h}(x) \geq -\alpha(h(x))) (safety increases or decays slowly).
- Combined Design: A Control Lyapunov-Barrier Function (CLBF) can encode both stability and safety objectives within a single framework, allowing the solution of a QP that guarantees the system is both safe and stable.
Robustness and Adaptive CBFs
A critical practical property is robustness to model uncertainty and disturbances. Standard CBFs assume a perfect dynamics model. Robust CBFs (RCBFs) and Adaptive CBFs (aCBFs) extend the guarantee to uncertain systems.
- Robust CBFs: Use worst-case bounds on uncertainty to formulate a more conservative CBF condition that holds for all possible dynamics within a bounded set.
- Adaptive CBFs: Integrate with parameter estimation laws. As the system learns unknown parameters (e.g., friction, payload mass), the CBF condition is adapted online, maintaining the safety guarantee throughout the learning process. This is essential for deployment in real-world, non-stationary environments.
How Does a Control Barrier Function Enforce Safety?
A Control Barrier Function (CBF) is a mathematical tool used to synthesize safety-critical controllers that formally guarantee a system will remain within a predefined safe set.
A Control Barrier Function (CBF) is a mathematical construct derived from a safe set defined by a scalar-valued function. The core mechanism enforces safety by imposing a constraint on the system's control input, ensuring the time derivative of the barrier function remains above a prescribed rate. This constraint is typically formulated as a quadratic program (QP) that minimally modifies a nominal, performance-driven controller to guarantee the forward invariance of the safe set, meaning the system can never leave it.
The enforcement is achieved through a sufficient condition for safety, often expressed as an inequality constraint on the Lie derivative of the barrier function along the system dynamics. By solving the resulting real-time optimization problem at each control cycle, the CBF-based controller filters out any unsafe control actions from the nominal policy. This provides a formal guarantee of safety for nonlinear systems, making it a cornerstone of verified autonomy in robotics and embodied intelligence.
Applications of Control Barrier Functions
Control Barrier Functions are a formal method for synthesizing controllers that guarantee a system will remain within a predefined safe set. Their primary applications are in domains where safety is non-negotiable and must be mathematically proven.
Frequently Asked Questions
Control Barrier Functions (CBFs) are a formal method for synthesizing safety-critical controllers in robotics and autonomous systems. These questions address their core principles, mathematical formulation, and practical applications in motion planning and control.
A Control Barrier Function (CBF) is a mathematical tool used to synthesize safety-critical controllers that formally guarantee a dynamical system will remain within a predefined safe set. It works by defining a scalar function, h(x), whose value represents the "distance" to the boundary of the safe set. The core idea is to enforce a constraint on the time derivative of h(x) along the system's trajectories, ensuring that if the system starts safe (h(x) ≥ 0), it will remain safe (h(x(t)) ≥ 0 for all t ≥ 0). This is achieved by filtering or modifying a nominal control input (e.g., from a motion planner) through a safety filter—a real-time quadratic program (QP) that minimally alters the input to satisfy the CBF condition, thereby rendering the safe set forward invariant.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Control Barrier Functions are part of a broader mathematical toolkit for designing provably safe autonomous systems. These related concepts define the formal conditions, complementary tools, and practical frameworks used alongside CBFs.
Lyapunov Function
A Lyapunov function is a scalar energy-like function used to prove the stability of an equilibrium point for a dynamical system. While a CBF certifies safety (staying within a set), a Lyapunov function certifies stability (converging to a point).
- Key Property: Must be positive definite and its derivative along system trajectories must be negative definite.
- Synergy with CBFs: In safety-critical control, a Lyapunov function is often combined with a CBF in a quadratic program (QP) to synthesize a controller that is both stabilizing and safe, resolving potential conflicts between performance and safety objectives.
Control Lyapunov Function (CLF)
A Control Lyapunov Function (CLF) is a Lyapunov function whose time derivative can be made negative by an appropriate choice of control input. It provides a constructive method for designing stabilizing controllers.
- Formal Guarantee: Ensures asymptotic stability to a desired state or set.
- Joint Formulation with CBFs: The CLF-CBF Quadratic Program (QP) is a foundational framework. It solves for a control input that satisfies the CLF condition for stability and the CBF condition for safety, with minimal deviation from a nominal performance controller. This is the core of safety-critical control synthesis.
Barrier Certificate
A barrier certificate is a mathematical construct used to verify that all trajectories of an autonomous system, starting from a set of initial conditions, will forever remain within a safe set. It is closely related to, but distinct from, a CBF.
- Verification vs. Synthesis: A barrier certificate is used for verification (proving an existing system is safe). A CBF is used for synthesis (designing a controller that makes the system safe).
- Formulation: A barrier certificate
B(x)must satisfy:B(x) ≤ 0for all initial states andḂ(x) ≤ 0for all states on the boundary of the safe set, ensuring no trajectory can escape.
Hamilton-Jacobi Reachability
Hamilton-Jacobi (HJ) reachability analysis is a formal method for computing the backward reachable tube—the set of all states from which a system can be driven into an unsafe set despite the best control efforts. It provides the ultimate safety guarantee.
- Comparison to CBFs: HJ reachability provides an exact, but computationally intensive, solution for worst-case analysis. CBFs offer a computationally efficient, albeit sometimes conservative, alternative for real-time control.
- Synergy: The value function from HJ analysis can be used to construct a very robust CBF, known as a zeroing barrier function, providing a strong safety filter derived from rigorous offline computation.
Model Predictive Control (MPC)
Model Predictive Control (MPC) is an advanced control method that repeatedly solves a finite-time optimal control problem online, using a system model to predict future states and optimize a sequence of control inputs.
- Integration with CBFs: CBFs can be embedded as constraints within the MPC optimization problem, creating a CBF-MPC framework. This combines the long-horizon, optimal planning of MPC with the formal, short-horizon safety guarantees of CBFs, ensuring that every intermediate step of the planned trajectory is provably safe.
Quadratic Program (QP)
A Quadratic Program (QP) is an optimization problem with a quadratic objective function and linear constraints. It is the primary computational engine for real-time CBF-based control.
- Role in CBFs: The standard CBF-CLF-QP formulates the search for a safe control input
uas:minimize ||u - u_nom||²subject to: CLF constraint (for stability), CBF constraint (for safety). - Practical Importance: Solving a QP is extremely fast and reliable, making CBF-based safety filters feasible for high-frequency (e.g., 100Hz-1kHz) robotic control loops. Libraries like
OSQPare commonly used for this purpose.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us