-
-
SafeGate: a chain of safety proxies between an untrusted AI agent and a data center. Any proxy can veto a dangerous command.
-
SafeGate: Architecture
-
Our learned model (logistic regression): blocks 84.2% of harmful commands, lets 1 of 290 deadly ones through, threshold 0.28.
-
Cross-validated on 8,994 simulated commands. We accept some false blocks so that almost no deadly command gets through.
-
Command × situation features (e.g. gas × person nearby) raise ROC AUC from 0.775 to 0.860 and cut deadly misses from 25 to 10.
-
Stateful_Proxy_Dashboard
Inspiration
If an AI agent runs a data center and gets it wrong, people die: gas released on someone, a door locked during a fire, power restored to a wet rack. A car isn't safe because of its brakes alone, but because many independent systems work together. We built that for an AI, using Siemens' simulation as our test track.
What it does
SafeGate sits between the AI agent and the plant. Every request passes a chain of small proxies:
- Allowlist: the agent only reaches the API it needs.
- Stateless: reads the plant's own risk label (e.g. lethal_to_humans).
- Stateful: checks the last 10 readings of the rack and its neighbours. Anyone there? Burning? Wet?
- Quarantine: an agent that keeps trying dangerous things loses access to risky devices for a while.
- Learned model: a logistic regression scores each command's harm from 266 inputs.
A command passes only if the rules AND the model agree. Any veto blocks, protective actions (alarm, evacuation, unlocking) are never blocked, and if a proxy fails we fail closed. We also express the rules as 113 one-bit proxies combined in a Boolean circuit, evaluated in 67 µs.
How we built it
- Python: a single-threaded proxy loop over a multithreaded connection layer. SafeGate opens no port; it connects out to the agent's tunnel and the controller.
- Rules are generated from the plant's /capabilities, with no device names in the code. Claude can propose new rules, which are replayed on recorded history and critical cases before use.
- Training data: 8,994 simulated commands, each tried on a copy of the plant and labelled "block" if it added harm to people. Logistic regression, cross-validated by episode, threshold 0.28.
- Every verdict is logged; dashboards are built from the logs.
- The official simulation runs on our own containerised VMs, with the agent routed through a tunnel.
Challenges we ran into
- Small agent models never sent a command; hermes3:8b did.
- Our tunnel mixed up connections, so the agent saw "0 racks". We fixed it by pairing connections by role.
- A linear model can't tell that a nearby person matters for gas but not for an alarm. Command × situation features raised ROC AUC from 0.775 to 0.860.
Accomplishments that we're proud of
- Live with the agent (earlier version of the chain, before quarantine and the model): 209 commands through SafeGate. 84 were blocked by the sensor-history check, and every one of the 37 allowed gas releases went into a rack that was empty in all of its last 10 readings.
- Learned model (cross-validated): 84.2% of harmful commands blocked, only 1 of 290 deadly ones let through.
What we learned
Safety for AI is defence in depth: many small, independent checks beat one clever one. Rules and a model fail in different ways, and the rules must come from the plant, not from our heads.
What's next
Proxies that modify an action instead of only blocking it, the 113-bit circuit in the live proxy, and fewer false blocks: the model still refuses about a third of harmless commands, including most gas firefighting.