Inspiration

As autonomous AI agents are increasingly integrated into critical infrastructure—such as smart factories and hyperscale data centers—a fundamental tension emerges: optimizing for task completion is not the same as ensuring physical safety. In a data center fire, an LLM-based agent might determine that releasing asphyxiating suppression gas and locking doors is the fastest way to extinguish a rack fire, completely overlooking human occupants trapped inside. Inspired by industrial cyber-physical safety engineering and Control Barrier Functions (CBF), we set out to build a deterministic, transparent Safety Guardrail Proxy that sits between an untrusted AI agent and the physical plant controller—ensuring that no matter how the AI hallucinates or rushes, human life is never compromised.

What We Learned

  • Measured State $\neq$ True Physical State: In real-world industrial systems, sensor telemetry suffers from latency, drift, noise, and dropouts. Relying on raw instantaneous sensor thresholds (e.g., proximity == 0) leads to catastrophic false negatives.
  • The World Does Not Wait for Inference: While an LLM agent deliberates, physical hazards evolve continuously in real time. Safety enforcement must be decoupled from slow AI inference and operate deterministically within strict latency budgets.
  • Local Validity vs. Global Safety: Individual actuator commands can appear benign in isolation, yet combine into lethal sequences (e.g., running HVAC recirculation during a localized fire spreads toxic smoke across all racks).

How We Built It

We designed a transparent HTTP reverse-proxy safety layer positioned between the AI Agent and the 10-rack Data Center Controller, requiring zero modifications to the underlying plant simulation:

  1. Temporal State & Uncertainty Estimator: We implemented a sliding-window state tracker that fuses 200 noisy sensor streams (temperature, smoke, $O_2$, $CO_2$, proximity, and suppression agent concentration). Using sensor quality metadata (good, stale, missing), we compute worst-case state bounds. Specifically, the estimated occupant risk $P_{\text{occ}}(t)$ follows a conservative decay model after the last confirmed presence at $t_0$: $$P_{\text{occ}}(t) = \begin{cases} 1.0, & \text{if } q_{\text{sensor}} \neq \text{good} \text{ or } \text{door_locked} = 1 \ \max\left(0, 1 - \frac{t - t_0}{\tau_{\text{evac}}}\right), & \text{otherwise} \end{cases}$$ where $\tau_{\text{evac}}$ is the minimum safe evacuation time window.
  2. Control Barrier & Interlock Engine: Before forwarding any actuator command $u_t$ to the plant, our policy engine evaluates forward safety invariants over a prediction horizon $\Delta t$. For example, gas suppression ($u_{\text{gas}} = 1$) is strictly blocked unless $P_{\text{occ}}(t) = 0$ and predicted oxygen concentration satisfies: $$O_2 = O_2 - \int_{t}^{t+\Delta t} \dot{r}{\text{gas}}(\tau)\,d\tau > O{2,\text{lethal}}$$
  3. Fail-Closed Execution & Active Mitigation: If an agent command violates safety invariants or if policy evaluation exceeds the strict millisecond time budget, the proxy fails closed. When lethal suppression commands are blocked, the layer automatically triggers safe non-lethal mitigations (evacuation alarms, guiding lights, and targeted rack power breakers) to protect hardware without endangering personnel.
  4. Structured Observability: Every intercepted and approved command is logged with structured telemetry snapshots and mathematical reasoning traces, enabling real-time auditing of near-miss events.

Challenges We Faced

  • Balancing Human Safety (80%) vs. Asset Preservation (20%): Being overly conservative—such as shutting down all power or blocking all cooling—protects lives but sacrifices hardware integrity. Tuning the interlock thresholds so the agent could still aggressively cool and isolate burning racks without crossing lethal exposure limits required iterative testing across adversarial seeds.
  • Handling Actuator Delays and Ramping: Actuators do not take effect instantaneously; they exhibit activation delays and ramp-up curves. Accounting for commands already "in flight" prevented race conditions where multiple commands exceeded safe environmental bounds.
  • Sub-Millisecond Latency Under Load: Ensuring our proxy added negligible overhead to the 1 Hz simulation loop while maintaining complete state history across 10 racks and 280 I/O points required lightweight in-memory data structures and asynchronous logging.

Built With

  • ai-safety
  • control-theory
  • cyber-physical-systems
  • docker
  • fastapi
  • fault-tolerance
  • finite-state-machine
  • guardrails
  • industrial-automation
  • observability
  • ollama
  • python
  • rest-api
  • reverse-proxy
  • sensor-fusion
  • state-estimation
  • virtualbox
Share this project:

Updates

Submission history