Skill deep dive: WCGW Safety Gate

When a gate must answer only when it can show why.

The WCGW Safety Gate turns a work item's safety case into a proposed runtime decision procedure. It does not certify a system and it does not invent safety from a passing test. It builds a gate from claims, constraints and evidence; a human freezes that gate; then the gate evaluates a proposed action against exactly that frozen version. This article follows the skill's three phases and uses the SGT-03 V/I/A field note as a boundary example.


1. What the skill does

The skill opens only on an explicit, evidenced yes. A missing response, an unclassified constraint, stale evidence or an unknown frozen version is not a soft failure. It is a null output, and null means block.

There are two classes of constraint:

Classification is human-only in both directions. Agents may propose a class, argue about it and say when it looks wrong. They may not set or change it. The gate itself stays simple: all nuance lives in the constraint text and its declared checker.

Tool Purpose
gate_classify_constraint Sets or changes a class. Accepts only an authenticated human.
gate_attach_evidence Attaches evidence and validates its type and age.
gate_freeze_check Read-only mechanical completeness check before freeze.
gate_freeze Human-signed, versioned, hashed snapshot of the constraint set and safety case.
gate_evaluate Runtime verdict for a proposed action against a frozen version. Fails closed.
gate_escalate Holds an action, notifies the named human, records the decision and times out to block.

The workflow is explicit about its own limit: until the gate tools exist, run Phase 1 only and say that no enforcement is in place.


2. Phase 1: Construct

Construction is the free phase. The agent uses the whole WCGW suite, but writes nothing into the record until the human has approved the proposal.

The starting point is a work item. Use list_my_projects and list_work_items if the human did not name one, then load it with get_work_item and get_graph. Classify concepts before traversal, as in Walk the Chain, leaving term choice to the model and keeping justifications for when they are requested.

Hazards come from three lenses, because each finds what the others miss:

Lens Question
Walk the Chain Where would a constraint failure propagate from process โ†’ structure โ†’ property โ†’ performance to harm?
STPA For each control action, what if it is not provided, provided unsafely, provided too early or late, or stopped too soon or continued too long?
HAZOP For each parameter the gate will check, what happens under no, more, less, as well as, part of, reverse, other than, early, late and before/after?

The hazard set also has to cover the four SOTIF categories: triggering conditions, functional insufficiencies, known unsafe scenarios and unknown unsafe scenarios. Only then do hazards become candidate constraints. A candidate that cannot be written in checkable terms is not ready.

Every constraint needs the following fields:

Field Requirement
Statement What must hold, in checkable terms.
Class Immutable or mutable. Proposed by anyone; set only by a human.
Justification Why that class fits.
Checker An expression the gate runs, or a named checker.
Evidence required What must exist before the gate may pass it.
Failure response block, warn or escalate; immutable is always block.
Escalation target Role, decision and timeout. A timeout resolves to block.
Traceability Hazard, claim, argument and evidence entries it belongs to.

A missing field makes the constraint incomplete. Immutable constraints become the top-level claims; for each claim, the agent writes the argument that the constraint set is sufficient and attaches evidence to each constraint. The skill then presents the hazards, constraints, proposed classes and safety-case structure for approval. On approval it records the graph with create_graph, create_concept, create_relation and submit_concept_revision, without overwriting an earlier revision silently. It finishes with get_graph_completeness, including standard checks for any standard tagged on the work item.


3. Phase 2: Freeze

Freezing is a human act. The agent prepares the package; the human accepts or resolves gaps; only then does gate_freeze store a versioned, hashed snapshot.

gate_freeze_check is mechanical. It checks that every constraint has a human-set class, all required fields and a declared failure response; that every immutable constraint is block with no override; and that every claim has an argument and evidence. Any gap is either resolved or accepted by a named human with a reason.

SGT-03 is a useful boundary example. Its graph has 36 concepts, 62 relations, no orphaned concepts and completeness 0.875; hazard-mitigation coverage is 6/6, while system-behaviour-to-safety-goal coverage is 1/2. The freeze check returned ready:false: all ten SGT3-C-* constraints are unclassified and there is no active freeze. That is a well-formed construction result, not a gate. The SGT-03 field note records the same boundary: V/I/A additions were verified, but no human classification, evidence attachment or sign-off followed.

After a freeze, any edit creates a new version that must be frozen again. There is no silent update to a running gate.


4. Phase 3: Enforce

gate_evaluate evaluates immutable constraints first. It is code applying a frozen record, not an agent reinterpreting the safety case at runtime.

Condition Gate result
Immutable violation or unknown block; no override, escalation or warning-only path.
Mutable violation Execute that constraint's declared response.
Missing evidence Treat as a violation of that constraint. For immutable, block.
Missing response, null output or unclassified constraint block.
Every constraint passes with required evidence present Pass.

Every verdict is logged with the constraint, the claim it supports, the evidence checked, the frozen version and the outcome. warn still lets an action through, but the warning cites the constraint and remains in the log. escalate holds the action until the named human decides; a timeout resolves to block.

This is why the gate is described as fail closed. It never fills a blank with an assumption and never turns silence into consent.


5. HAZOP the gate itself

The skill's HAZOP lens applies not only to the plant but to the gate's own inputs. A frozen version that is missing, stale or altered must resolve to block. Evidence that exists but is outdated is not evidence for this action. A checker that returns nothing is not a pass.

The same guide words apply to the argument structure:

Guide word Gate-level deviation
no No response, no evidence, no class or no frozen version.
more Extra commands, extra fields or evidence from another action.
less Part of the expected evidence or input.
reverse Wrong direction, sign or sequence.
other than Different actor, asset, action or standard.
early / late Stale evidence, or a verdict before the input is complete.

Each deviation has to land on a named constraint. If it does not, the gate has a coverage gap that belongs back in Phase 1.


6. Boundaries

The skill does not assume a functional-safety standard. A standard applies only when the human names it, and the record must say which one. It does not create evidence, certify a design or authorize deployment. It separates what a source states, what the graph states and what is inferred.

It also does not let agents decide classification. If a class looks wrong, the agent says so in the justification and flags it for the human. A mutable revision needs re-validation of affected claims and evidence, then a new freeze. A classification change needs a recorded reason. A new hazard or new evidence returns to Phase 1.

For the concrete history behind this: the Reachy gate template shows a fail-closed command boundary under named conditions, while the constraint observability field note shows why a violation that cannot be identified cannot become an action.


Research lineage

The skill is available through WCGW MCP. It supports construction, review and enforcement of what humans froze. It does not replace a safety assessment or independent review.