Connect AI agents to programmable hardware.
OpenMHS is an open-source gateway that sits between an AI agent and the instruments it wants to use: power supplies, motion stages, sensors, lab instruments. Every command is checked against a written contract and a deny-by-default policy, journaled, and verified by reading the device back. Anything hazardous waits for a person, and every step is kept in a log that cannot be changed without it showing.
Why it exists
Letting a language model drive real equipment goes wrong in three predictable ways.
1. Nothing says what a device accepts
A model guesses at units, ranges and ordering, and a bare 5 can mean
volts, millivolts or a mistake. OpenMHS describes each device in a descriptor with
units, limits, preconditions and side effects, and refuses what does not fit.
2. Permission lives in the prompt
Telling a model "don't exceed 12 V" is only a request. In OpenMHS a deterministic policy decides, deny by default, with scoped credentials and human approval for hazardous actions. A model cannot grant itself access.
3. Timeouts are ambiguous
If a write goes unanswered, the device may or may not have changed. OpenMHS
records UNKNOWN_OUTCOME, never retries blindly, and reconciles by
reading the device. Every command is journaled; the audit log is hash-chained.
See it work
A real gateway with simulated devices. The agent is refused a 5 V jump (too fast), gets 2 V confirmed by readback, is refused 48 V (out of range), and the audit log verifies. Recorded from a real run; no hardware.
Try it in a minute
No release is published yet, so build from source with Rust 1.89 or newer.
git clone https://github.com/KNambiarDJsc/Open-MHS
cd Open-MHS
cargo install --locked --path crates/openmhs-cli # installs openmhs and openmhsd
openmhs demo # guided tour, about 10 seconds
Then run the gateway yourself, or connect your own device, from the docs. The full demo run is on the reports page.
Where it fits
AI agents already use software tools through the Model Context Protocol (MCP). OpenMHS speaks MCP to agents, and Modbus TCP, MQTT, SCPI, HTTP, OPC UA and ROS 2 to machines. In between it adds what physical work needs: units, limits, approvals, uncertain outcomes and evidence. Read what it is for the background, or how it works for the details.