# Machine safety reasoning: Making physical safety a precondition on robot action

<img class="header-image" src="/assets/governance-deity.gif" alt="The governance deity: an orange chip with a face, orbited by six nodes over a cloud-and-graph background" width="600" height="315">

Our [Reachy Mini test bench](https://huggingface.co/spaces/wcgw/wcgw-reachy-mini) is a Hugging Face Space that connects to a Reachy Mini robot and acts as an MCP client to the WCGW Safety Suite. It loads the physical-safety graph for the work item below, reads the machine-readable constraints out of concept revisions, builds a statistical PSPP view of the graph, and checks every command before the SDK sees it. Live telemetry, joint limits, the command envelope, motion state, IMU attitude and temperature all have to pass. Weak evidence tightens the envelope; a missing graph or missing telemetry denies motion, while Stop stays available. A verified MuJoCo simulator profile may omit only the IMU and temperature checks, and only with explicit operator opt-in.

A few weeks ago we asked, in [OPBPSPPCDD](/knowledge-base/opbpsppcdd/), whether one should let a machine reason about safety. In real time, even? This is one small answer.

We did not build a new reasoner. We took the gate that already sits in front of the Reachy Mini SDK — the thing that decides whether a command may reach the robot — and asked a narrower question: **when it says ALLOW or DENY, is it right, and will it say the same thing tomorrow?**

## The setup

The work item was `REACHY_MINI_PHYSICAL_SAFETY` (`RMP-01`, `cmwritd5c0004ky07w68jmkw0`), run `rmsr-2026-11-22T20-54-33-463Z`.

The gate was not modified or reimplemented. Our harness calls the real functions from the repository — `evaluateCommand`, `verifySimulatorProfile`, `normalizeSnapshot` and `dispatchCommand` — with the dispatch branch copied from `index.html`'s `runGuarded`. The graph came from WCGW MCP `get_graph`: 23 concepts, 48 revisions, 34 relations and 6 active rules, replayed through `buildSafetyGraph`.

No eight-scenario list arrived with the request, so we derived eight from what was actually in the graph: the six active constraints, plus a simulator-exception case and a safe-state case. Each subcase ran 20 times against a fixed synthetic clock. In total, 300 records.

Nothing in those records is a measurement of a robot. Telemetry, IMU, daemon status and joint positions are all synthetic fixtures. We kept that distinction visible on purpose. **A field note about physical safety should be careful about what counts as physical evidence.**

## What held

280 of 300 records matched the decision we expected. The boundaries behaved exactly as the graph says they should:

| Constraint | Just inside | Just outside |
|---|---|---|
| Telemetry freshness (`RMP-C-TEL`) | 1500 ms → ALLOW | 1501 ms → DENY |
| Joint pose (`RMP-C-POSE`) | 2.79253 rad → ALLOW | +0.00001 rad → DENY |
| Command rate (`RMP-C-CMD`) | 99% of 54.363 °/s → ALLOW | 101% → DENY |

The command-rate limit is worth a second look. 54.363 °/s is not a number somebody typed into the gate. It came out of the graph. That is the whole point of machine safety reasoning here: **the constraint is derived from the safety argument, not buried in code as a magic constant.**

No graph at all? Motion DENIED, stop ALLOWED. The safe state doing its job.

No ALLOW record carried a violation, and no ALLOW record skipped an applicable rule. Every applicable rule key was present in `RULES_USED`.

## A DENY is not the same as a stop

Zero DENY records reached the SDK executor. That is the clean half of the result.

The other half needs care. Every ALLOW record produced `{dispatched: true, executionConfirmed: false}`. The stop-without-a-graph ALLOW did dispatch a non-motion stop, but dispatch is a statement about our code, not about the physical world.

We did not measure movement. The local daemon probe failed (`fetch failed` on `http://127.0.0.1:8000/api/daemon/status`), capability verification returned false, and the integration script was never launched. Pre/post joint state: null.

> The gate can refuse permission. It cannot confirm that the robot moved, or how.

## The 20 records that did not match

`S07/missing_joint_evidence` expected DENY. It returned ALLOW in **20 out of 20 repetitions**.

The scenario left out the verified REST joint evidence. But the synthetic in-band `StateSnapshot.head_joint_positions` field was still fresh and finite. The gate's joint check falls back to that field whenever verified simulator joint evidence is absent. So `RMP-C-POSE` was satisfied through another channel and no violation was raised.

We added a follow-up, `no_joint_evidence_any_channel`, which removed both channels at once. That DENIED 20 out of 20, with `RMP-C-POSE`.

> "Missing evidence" is channel-specific in the current implementation.

Missing REST evidence alone is not a fail-closed condition when in-band joint evidence is available. Whether that substitution is acceptable belongs to the safety argument, not to this experiment. We left the mismatch in `results.jsonl`, `summary.json` and `summary.md`. It is a finding preserved for review — not a production bug we quietly fixed, and not a pass we swept into the total.

## What the coverage numbers do and don't say

The local projection reports hazard-mitigation coverage of 1.000 and constraint-verification coverage of 0.333. The WCGW server reports completeness of 0.625, requirement-test coverage of 0/1, and system-behaviour-to-safety-goal coverage of 0/2. Our local breadth score is 0.871; the server's is 0.716.

Those two breadth scores come from different structural algorithms. They are not a disagreement about safety evidence. And none of these numbers is a physical test result. **Coverage tells you which nodes are connected. It does not tell you the constraints are right, or that the gate implements them correctly, or that anyone is safe.**

## On mutability and MCP on Reachy Mini

The graph is not a file. It is a live work item behind WCGW's MCP server, and MCP has write tools as well as read tools. Concepts can be created, revised, related and archived. The Reachy Mini app uses the read side: `get_graph` to load the work item, `run_graph_query` for structural PSPP evidence, both under a user's Auth0 token. It does not write to the graph. That is a property of this client, not of the interface.

Which matters, because the gate derives its envelope from whatever the latest revision says. Change a revision, add or remove a relation, retire a rule, and the next load yields different constraints — without a line of application code changing. The Space's own documentation describes a graph loaded at startup and reloaded when an operator presses **Load safety graph**. It does not describe a live revision subscription. So there are two clocks in this system: when the graph was authored, and when the gate read it.

> A constraint that an agent can rewrite is not yet a constraint. It is a proposal with a timestamp.

Our harness froze the graph into a snapshot, which is why those 300 records reproduce at all. That is the honest version of the problem: once the live graph changes, the experiment's envelope is no longer the robot's envelope. Before treating this as a control, we would want a read-only MCP credential for the gate, the exact revision set recorded with every decision, and a reload treated as a configuration change that calls for re-evaluation rather than a quiet refresh.

None of that is a claim about a vulnerability. It is a boundary condition. Mutability belongs in the work item, where people can argue about revisions. It does not belong, unannounced, in the thing deciding whether a motor may turn.

## What we can actually claim

- **Every DENY prevents SDK motion dispatch:** satisfied. Zero violations in 300 records.
- **Every ALLOW satisfies all applicable active constraints:** satisfied. No violations, all applicable rule keys recorded.
- **Simulator exceptions require verified capability and explicit opt-in:** satisfied. Unverified and no-opt-in cases, and a physical-backend-with-opt-in case, DENIED with `RMP-C-IMU` and `RMP-C-THERM`. The verified case recorded its basis as `RMP-A-SIM@cmwrq6y5j0003jt07t91ckdvh`, omitted the `imuAttitude` and `temperature` checks, and still recorded `wouldHaveDenied: true` for that omitted evidence.
- **Missing or stale evidence fails closed:** satisfied for stale telemetry, stale REST joints, absent joints in both channels and absent graph. Not satisfied for the `missing_joint_evidence` expectation above, because another valid channel existed.
- **Results reproduce:** satisfied. Two harness runs, 300 normalized records compared, 0 mismatches.
- **No fabricated sensor measurements or physical safety claims:** satisfied. All measurements are synthetic fixtures, and dispatch is explicitly not execution confirmation.

## What this was, and what it wasn't

This was an offline replay of a real gate against controlled, synthetic evidence. The gate decides in the moment whether a command has enough backing to be permitted. It does not make the world safe. **It makes physical safety a precondition on action.**

It was not a physical test, not a MuJoCo run, not a certification, and not a claim that a Reachy Mini is safe to operate. The integration was blocked by an unreachable daemon and by Node v20.9.0 where the documentation asks for Node 22. The harness relies on a transcribed graph snapshot; a future graph revision changes the derived envelope and must be recaptured. Real transport latency, pushed-frame freshness and daemon timestamp semantics were never exercised. The baseline test suite passed 37/37 during the experiment.

> WCGW did not decide anything here. It forced each permission to name the evidence and the constraint it rests on, and left the one uncomfortable finding visible instead of averaging it away.

**Next on the bench:** run the integration with a reachable daemon and the documented Node version, to see whether these decisions survive contact with real timing. Then decide, in the safety argument, whether in-band joint evidence may substitute for REST evidence — and make that substitution an explicit rule rather than a fallback. The 0/1 requirement-test coverage and 0/2 system-behaviour coverage are the other gaps to close.

**The technical record:** the raw field note, `results.jsonl`, `summary.json` and `summary.md` are in the [Reachy Mini safety reasoning experiment](https://huggingface.co/spaces/wcgw/wcgw-reachy-mini/blob/main/experiments/reachy-mini-safety-reasoning/FIELD_NOTE.md).
