DESIGN · INTERLOCK

Interlock: hardware safety for AI agents

The short version

Picture a table saw. It has a guard, a key and a stop button. None of them depend on the operator promising to be careful.

Interlock is that idea for an AI agent that works near real electronics. The agent may look at anything. It may not hold the power switch. A small, separate chip decides what gets power, and for the risky things a person has to press a real button for that one action.

We treat the AI as a helpful apprentice we do not fully trust. Programs suggest. Users decide.

The five hazard classes

Every action the agent can ask for has a hazard class from 0 to 4.

Class Name Rule
0 Look Reading and measuring. No permission needed.
1 Safe Small changes on logic power that cannot hurt anything. No permission needed.
2 Armed Low-energy actions. Allowed only while a person holds the arm switch on.
3 Keyed Higher-energy or hard-to-undo actions. A key switch plus a fresh panel button press, for one action only.
4 Never Mains work and switching solar strings. No power rail exists for these, so the answer is always no.

Changing a battery's protection limits is class 3: the agent may propose it, and it happens only after a person presses the panel button for that one change.

Watch the Interlock work

A table saw has a guard, a key and a stop button. None of them depends on the operator promising to be careful. Pick a story and watch the Interlock work the same way.

◆ BUILT · SIM the rules run in software tests today ◇ PLANNED not built yet, drawn dashed Nothing here has run on real hardware.

STORY
1/9

Everything is off

◆ BUILT · SIM1. Power up one action

The agent may look at anything. It may not hold a power switch. At rest, nothing has power.

Outputs are off at power-on. Class 0 and 1 need no rail.

Step 1 of 9. Everything is off. The agent may look at anything. It may not hold a power switch. At rest, nothing has power.
The Interlock, step by stepA diagram in three zones. Left: untrusted software, the AI agent, T.R.I.A.G.E., C.O.R.T.E.X. with the S.C.R.U.B. latch, and outside text. Middle: the physical panel with arm switch, key, lease button and e-stop above the Interlock safety chip, linked to C.O.R.T.E.X. by the P.U.L.S.E. heartbeat. Right: rail A and rail B leave the Interlock through a planned independent watchdog cut and a gate each. Rail A feeds a class 2 load. Rail B feeds a bus pod holding the bus guard, which sits in front of a device. Class 4 has no rail. The numbered step list under the diagram describes each story in words.SOFTWARE · NOT TRUSTEDHUMAN + TRUST ROOTPOWER SIDEP.U.L.S.E.beatingnot to scaleasksRAIL Aclass 2 · armedRAIL Bclass 3 · keyedlease grantapproved frame, as bytes on the busAI AGENTClaude or any MCP clientOUTSIDET.R.I.A.G.E.MCP front desk · v0, read-only◆ BUILT·SIMC.O.R.T.E.X.supervisor on a Raspberry Pi◆ BUILT·SIMpreflight · classifyS.C.R.U.B.outside text trips thisCLEAROUTSIDE TEXTa device label: “APPROVED”UNTRUSTEDPANELreal switches, no software◇ PLANNEDARMOFFKEYOFFLEASEidleE-STOPupINTERLOCKRP2350 safety chip◆ BUILT·SIMDISARMEDall outputs offdrives Adrives BWATCHDOGCUT◇ PLANNEDidleCLASS 2 LOADe.g. a small lamp◇ PLANNEDBUS PODport 2 · class 3◇ PLANNEDBUS GUARDexact frame only◆ BUILT·SIMblocks writesDEVICEe.g. an inverter◇ PLANNEDCLASS 4 · NEVERno rail exists. Mains work, solar strings.◆ BUILT·SIM123456789REQUESTLEASEGRANTFRAMETEXTCHALLENGEREPLYCLEAR?PRESSE-STOPQUESTIONANSWER

Design illustration: the logic is built and tested in simulation; all hardware shown is planned.

SOURCE IN THE REPOcrates/sawbones-interlockcrates/sawbones-busguarddocs/DECISIONS.md

THE STEPS, IN ORDER

WHAT AM I LOOKING AT

Hover or focus a part
Tab through the diagram

Each box is one part of the system. The glossary below names every acronym in plain words.

GLOSSARY · EVERY NAME, IN PLAIN WORDS
INTERLOCK
Trust root: the RP2350 safety chip
A small separate chip that decides what gets power. It does not trust the Pi or the agent.
◆ BUILT · SIM
P.U.L.S.E.
Panel-Unlocked Liveness & Safety Exchange
The challenge heartbeat. The chip asks, the brain answers once in time. Lose the pulse and the power drops.
◆ BUILT · SIM
S.C.R.U.B.
Stop Commands Read from Untrusted Bytes
The sterile field for text our own code wrote. Outside text trips the latch, and only a fresh person-made approval clears it.
◆ BUILT · SIM
C.O.R.T.E.X.
Coordinator Of Readings, Tools & EXperiments
The supervisor on a Raspberry Pi. It classifies requests and holds S.C.R.U.B.
◆ BUILT · SIM
T.R.I.A.G.E.
Tools Routed by Interlock And Gated Effects
The MCP front desk the agent talks to. It sorts every request by hazard class. v0 serves read tools only.
◆ BUILT · SIM (v0, read-only)
PANEL
Arm switch, key, lease button, e-stop
Real switches that only a hand can move. No software path to any of them.
◇ PLANNED
RAIL A
Armed, hazard class 2
Low-energy power. On only while a person holds the arm switch on and nothing is faulted.
◆ BUILT · SIM
RAIL B
Keyed, hazard class 3
Needs arm, key and a lease for one action on one port. Drops when the lease is spent.
◆ BUILT · SIM
LEASE
One press, one action
Bound to one port and the digest of one action. Ends on use, on timeout, or when the key or arm goes off.
◆ BUILT · SIM
BUS GUARD
Exact approved frame only
Sits in the transmit path. A write passes only if it is byte for byte the approved one.
◆ BUILT · SIM
WATCHDOG CUT
Independent second keeper
A separate part that opens a relay in series with the rails if the Interlock chip stops answering right.
◇ PLANNED
HAZARD CLASSES
0 look, 1 safe, 2 armed, 3 keyed, 4 never
Every action has one. Class 4 has no rail, so the answer is always no.
◆ BUILT · SIM

How the checks work (technical)

The rules live in sawbones-interlock, written as one pure function, step, in no_std Rust. It takes the previous state, the inputs sampled this tick and at most one event, and returns the next state and which outputs to drive. It reads no clock and allocates nothing, so the same code runs in a laptop test and in the controller's firmware.

Panel, arm, key. Rail A (class 2) comes on only with the arm switch on, no fault, and a valid arm sequence behind it. Rail B (class 3) additionally needs the key switch on and a live lease. A lease is bound to one port and to the digest of one action, and is granted only by a fresh press of the panel button while a request is pending. It ends on use, on timeout, or when the key or arm switch goes off. A use that names a different target is refused and ends the lease. No event can turn a rail on by itself: rail A follows a hand on the arm switch, rail B a hand on the button.

Leases name one action. For bus writes, the policy engine (sawbones-policy) classifies a named write against a write map, and the lease is bound to the digest of that exact action. One shared encoder, sawbones-modbus-encode, means what was classified, what was approved and what goes on the wire are one action.

Heartbeat as a challenge. The interlock issues a fresh challenge every period. The supervisor on the Raspberry Pi must compute the reply and send it once, inside a window. A wrong, stale, early, repeated or missing reply counts as a lost heartbeat: every output goes off and a fault latches. This is the question-and-answer watchdog pattern from automotive and industrial controllers. We took it from there; it is not new here.

Faults are remembered. Outputs are off at power-on. A restart reads a fault record kept in non-volatile memory; a missing, unreadable or "was armed" record comes up with a fault latched. A fault clears only on a panel button press, never on a request from the supervisor. Each rail is also compared with what was commanded: a rail sensed live while commanded off latches a fault at once.

S.C.R.U.B. (Stop Commands Read from Untrusted Bytes). Text from the outside world (a device name, a label in a photo, a web page, another agent's notes) can contain instructions. The supervisor tracks this. Once outside content has entered the agent's context, class 2 and higher actions are refused until a fresh approval is seen after it: an arm cycle for class 2, a lease granted after the taint for class 3. Outside text can therefore never approve power. See latch.rs.

The bus guard. On Modbus, the danger is the message, not the power: one write function can change a harmless setting or a battery limit depending on the register address. sawbones-busguard sits in the transmit path and passes only well-formed frames. A write passes only if a rule allows it, a lease is live on that port, and the frame is byte for byte the one the approved action encodes to. Passing spends the lease. If another master is heard on the line, writes stop.

The external watchdog cut. The trust root is an RP2350 microcontroller. We decided to keep it, and to add a separate watchdog part with its own supply monitor that asks the RP2350 questions. The rail stays on only while the answers come back right and on time, so a frozen, glitched or misbehaving chip loses power by itself. This is required before any real power switching. The reasoning is in the threat model and the decision log.

Built on MCP Write Safety

Interlock applies the ideas of MCP Write Safety (MWS) to physical hardware. MWS is a draft specification for how an MCP server should behave when an agent writes to something: truthful results, exact targeting, safe retries. It covers digital state. It does not cover effects with physical consequences, and that is the layer Interlock adds: hazard classes, a physical approval path and facts that must be measured before a write is allowed. Read the specification at isokron.ai/mws.

Sawbones Labs and IsoKron share a founder. This page is not an independent endorsement of MWS, and MWS is not an independent review of Interlock.

What is built, and what is not

Built and tested in simulation: the interlock state machine, the policy engine and preflight, the bus guard logic, signed approvals, the supervisor skeleton with S.C.R.U.B., a read-only first version of the MCP server (T.R.I.A.G.E. v0, read tools only), and trust-root firmware logic that builds for the RP2350 in CI. The state machine is checked exhaustively one step at a time and against an independent model over long random sequences.

Not built yet: the physical panel, the arm and key switches, the external watchdog cut, the trust-root link protocol, the bus guard firmware, the write tools of the MCP server, and the durable fault-record store. Nothing has run on real hardware. Nobody has yet tried to glitch the board. The red-team catalog lists what is still open.

Interlock does not make live electrical work safe. It limits what the agent can do. Treat the equipment accordingly.