Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/commaai/openpilot/llms.txt

Use this file to discover all available pages before exploring further.

The panda is a USB CAN gateway that sits between the comma device and the car’s CAN bus. All CAN messages from openpilot’s host software pass through panda before reaching the vehicle’s ADAS ECUs. This makes panda the physical enforcement layer of openpilot’s safety model — it can independently block or limit any message, regardless of what the host software sends.
Forks of openpilot that disable, remove, or weaken panda safety code cannot use the openpilot trademark and will result in the fork’s users being banned from comma.ai servers. comma.ai strongly discourages the use of any fork with safety code that does not fully meet the requirements below.

Two core safety requirements

Following Hazard and Risk Analysis (HARA) and Failure Mode and Effects Analysis (FMEA), openpilot is designed around two fundamental safety requirements:
The driver must be able to immediately retake manual control of the vehicle at any time. openpilot disengages when the driver steps on the brake pedal or presses the cancel button. Panda enforces this at the hardware level — it monitors driver inputs on the CAN bus and cuts actuation commands when an override is detected, independent of the host software state.This requirement covers both lateral (steering) and longitudinal (throttle and braking) control. The driver retaking control via the brake pedal or cancel button is always sufficient to disengage openpilot completely.
While openpilot is engaged, all actuators are constrained to operate within limits that give the driver sufficient time to react. The vehicle must not alter its trajectory so quickly that a normally attentive driver could not safely respond.Per ISO 11270 and ISO 15622, the lateral actuation limits translate to a maximum of 0.9 seconds of continuous actuation to achieve a 1-meter lateral deviation. Panda enforces per-brand actuator limits defined in the C safety mode files, and openpilot’s host software performs an independent excessive actuation check in selfdrive/selfdrived/helpers.py.

Compliance and standards

openpilot is developed in good faith to be compliant with applicable regulations and industry safety standards for Level 2 driver assistance systems:
StandardApplication
ISO 26262Functional safety guidelines for road vehicles; informs the hazard analysis and safety architecture
FMVSSUS Federal Motor Vehicle Safety Standards; openpilot’s behavior is designed to be consistent with FMVSS requirements for ADAS systems
ISO 11270Defines lane keeping assist system requirements, including lateral deviation limits
ISO 15622Defines adaptive cruise control requirements, including longitudinal actuation limits
MISRA C:2012Coding guidelines applied to all safety-critical C code in panda firmware to minimize undefined behavior
For additional context, comma.ai observes guidelines from NHTSA’s pertinent ALC system report.

Panda safety modes

Each supported car brand has a dedicated safety mode implemented in C in the opendbc repository:
opendbc/safety/modes/[brand].h
These files define the specific CAN message addresses and signal ranges that panda will allow through for a given vehicle. The safety mode is selected at startup based on the car fingerprint and cannot be changed at runtime from the host software. Safety mode enforcement includes:
  • Steering torque limits — Maximum allowable torque per CAN cycle, enforced per brand
  • Torque rate limits — Maximum change in torque per cycle (STEER_DELTA_UP / STEER_DELTA_DOWN)
  • Longitudinal limits — Gas and brake signal range validation
  • Driver override detection — Monitoring driver steering torque and pedal inputs to detect manual intervention
  • Heartbeat timeout — If the host software stops sending valid messages, panda stops forwarding actuation commands to the car
Vehicle-specific safety implementations are at github.com/commaai/opendbc/tree/master/opendbc/safety. The panda safety model overview is at github.com/commaai/panda#safety-model.

Testing

comma.ai runs three levels of safety testing before each software release:
Safety mode logic is compiled and tested in a simulated environment. Each brand’s safety test suite (opendbc/safety/tests/test_[brand].py) runs in CI on every pull request. Tests verify that:
  • Valid messages are forwarded correctly
  • Out-of-range actuator values are blocked or clipped
  • Driver override signals trigger immediate disengagement
  • Heartbeat timeouts stop actuation as expected
The compiled panda firmware is flashed to physical panda hardware and tested with simulated CAN traffic. HIL tests catch timing-dependent behavior and hardware-specific issues that SIL tests cannot detect.
Before release, new safety logic and software changes are tested in vehicles on public roads. comma employees validate engagement, disengagement, driver override, and edge-case behavior in real driving conditions.

Driver monitoring

openpilot includes a driver monitoring feature that alerts the driver when distraction or drowsiness is detected using the cabin-facing camera. Driver alertness is a necessary condition for safe openpilot use, but not sufficient on its own — panda’s hardware safety layer operates independently of the driver’s attentiveness. Driver monitoring cannot be disabled. Forks that nerf or disable driver monitoring (selfdrive/monitoring/) violate openpilot’s safety requirements.

Fork requirements

Forks of openpilot that modify safety-critical code must follow these requirements to maintain an acceptable level of safety:
  • Do not disable or weaken driver monitoring (selfdrive/monitoring/)
  • Do not disable or weaken excessive actuation checks (selfdrive/selfdrived/helpers.py)
  • If your fork modifies any code in opendbc/safety/:
    • Your fork cannot use the openpilot trademark
    • Your fork must preserve the full safety test suite (opendbc/safety/tests/) and all tests must pass, including any new coverage required by your fork’s changes
Failure to comply will result in the fork’s users being banned from comma.ai servers.

Build docs developers (and LLMs) love