Isometric section map — Roadmap Edit in FossFLOW ↗ Full size ↗
PlantUML — Roadmap Open SVG ↗ PlantUML server ↗
Roadmap PlantUML diagram

HELM

Handshake, Envelope, Lease, Merge. A protocol for multiple agents writing to shared authoritative state.

The problem, measured

Not hypothetical. Three rounds of collisions in one session, all on the Mainframe's own registries:

#what happenedmechanism
1a peer agent added five primitives and two playbooks while I was reading the same fileslost update - I would have overwritten its edits had I written from my in-context copy
2a peer agent added five doctor checks; I then added a check numbered 17, which already existedidentifier collision - both of us assigned "17"
3I inserted a check after a ; and broke doctor-summary.cypher outrightno validation before write, so a syntax error reached the shared artefact

Every one is a textbook concurrency defect. Round 1 is a lost update. Round 2 is a collision on a hand-assigned identifier. Round 3 is a write without validation.

And the diagnosis is not mine. Christopher Meiklejohn watched exactly this happen with two Claude Code instances creating migration 267 simultaneously:

"This is a lost update - the exact same problem that distributed databases have been solving since the 1970s. A lost update playing out in a directory of SQL files instead of a network of processes."

His conclusion is the premise of this design:

"These aren't prompt engineering problems. They're coordination problems. ... shared mutable state with no formal concurrency control. No fault model. No reasoning about what happens when agents disagree."

What the field already provides

A2A v1.0 - and the gap it leaves

A2A is the agent-to-agent standard: contributed by Google, hosted by the Linux Foundation, stable v1.0 in March 2026, Apache-2.0, 150+ organisations.

elementwhat it does
Agent Carda JSON manifest at /.well-known/agent-card.json advertising skills, input/output modes, security schemes and interfaces. v1.0 allows signed cards
Client / Server rolesfluid - any agent can switch, so topologies can be mesh or hub-and-spoke
Taskthe unit of long-running work, with explicit states: submitted, working, input-required, completed, failed, canceled
Message and Partsunified part structure - text, structured data, inline bytes, file URL
Artifactthe result of delegated work
Streaming and pushSSE for live updates, push notifications for work outliving the connection
BindingsJSON-RPC, gRPC, HTTP+JSON/REST - the application model is separated from the transport

And the sentence that defines this project's opportunity:

"A2A describes how an agent advertises and applies those schemes, but credential issuance and trust policy remain outside the protocol."

A2A is deliberately incomplete on trust. HELM is that layer.

MCP - and why it is not this

MCP connects an agent to tools and data. A2A connects agents to agents. Neither addresses agents writing to shared authoritative state, which is the Mainframe's actual problem. The registries are not tools and not peers; they are the platform's declared truth, and three writers are editing them.

Pax - the authority model already decided

Pax supplies the tier model the Mainframe should adopt:

tierrolesauthority
Operatorarc.*, pmo.*, graph leadsPropose only. MUST NOT apply changes directly. Output is a PR or a plan ticket
Worker / Plannerreview.*, sys.*, research.*MAY apply changes within their declared scope
Senior agentexplicitly grantedMAY approve a peer's output, MUST NOT approve its own

The load-bearing line, which this design treats as a requirement:

"Segregation of duties is enforced by agent identity, not trust level."

That is the whole argument for envelopes carrying cryptographic identity rather than a self-declared role.

The design

The insight that makes this tractable

A registry is a map keyed by entry key. That changes the conflict analysis completely:

casefrequencycoordination needed
two agents edit different keysthe overwhelmingly common casenone. A keyed map merges them without loss - this is the CRDT property
two agents edit the same keyrare, and usually a genuine disagreementa lease, and a recorded winner

So the protocol is free for the common case. The Mainframe's peers were mostly adding different entries - which is why most of their work and mine coexisted fine. The collisions happened on things that are not keyed maps at all:

  • generated files (registries.cypher) - derived, overwritten wholesale
  • scripts (collect-registries.sh, doctor-summary.cypher) - shared source, edited in place
  • hand-assigned numbers ("check 17") - an identifier with no key

That is the real finding. The registry entries are safe by construction; the things around them are not.

The four mechanisms

1. Handshake - capability declaration

Every agent publishes an agent card: identity, tier, declared scope, capabilities, and the interfaces it exposes. Signed, and served at a well-known path so any peer can read it before interacting.

A2A-compatible. A HELM card is an A2A Agent Card plus a governance extension:

HELM additionwhy
tieroperator, worker or senior - drives the authority check
declared_scopethe paths and registries the agent may write to. Pax requires this in .agent.md; HELM requires it in the card
last_handshakewhen the card was published, so a stale card is visible
signaturethe card is signed, and the signer is verifiable

2. Envelope - no bare writes

Every write to shared state carries a signed envelope:

fieldpurpose
agentverifiable identity, not a self-declared name
tier and scopewhat the card claimed, checked at write time
subjectthe artefact and key being written
observedthe version vector the writer had seen. This is the causal context
lamporta logical timestamp, so ordering exists without a shared clock
leasethe lease being exercised, if other writers exist
digestthe content hash, so the write is verifiable after the fact
signatureover all of the above

observed is the field that prevents round 1. Without it, a writer cannot be asked "had you seen the other change?" and a lost update is undetectable after the fact - which is exactly why round 1 was only caught by luck.

3. Lease - a scoped, expiring claim

Before writing to a non-keyed artefact - a script, a generated file, a shared counter - an agent takes a lease: a claim on the path with a short TTL, renewable, and bound to an agent identity.

Three rules make leases safe where naive locking is not:

  1. Leases expire. An agent that hits a context limit and stops must not block the platform forever. This is the crash-recovery model applied to LLM processes.
  2. A lease is a hint, not a mutex. If a lease expired and another agent wrote, the merge still applies - the lease reduces collisions, it does not replace merge.
  3. Leases are recorded. A lease is a registry entry with a TTL, so the claim store is the graph the platform already runs rather than new infrastructure.

The identifier rule. Round 2 was not a file collision, it was an identifier collision: two agents both chose "17". The rule that prevents it:

Identifiers MUST be derived from the key, never assigned by sequence.

A check named external_dependency_unenumerated cannot collide. A check named 17 collides whenever two agents add one. This is the same defect I found in stack.md, where a change "renumbered the table" and rows are referenced by number elsewhere - a hand-assigned sequence is shared mutable state, and it will collide. One rule fixes both projects.

4. Merge - causal ordering, surfaced conflict

When two envelopes touch the same subject:

situationresolution
different keysmerge automatically. No conflict exists
same key, one writer observed the otherlast-writer-wins is safe, because the causality is known and the losing version is recorded
same key, neither observed the otherconcurrent write. Both are retained; one is marked authoritative; the divergence is an event, not a silent overwrite
same key, same valueidempotent, nothing to do

The third row is the one that matters. A concurrent write must be an event someone can see, never a silent loss.

Where HELM sits in the stack

    A2A          agent <-> agent delegation      (wire, cross-organisation)
    MCP          agent <-> tool and data         (wire, capability)
    HELM         agent <-> shared authoritative state   (governance, THIS)
    SPIFFE       identity underneath             (Pax Phase 6)
    Redpanda     the event log underneath        (Pax Phase 3)

A2A carries the delegation. HELM decides whether the resulting write is permitted, ordered, and proven. A2A's own specification says trust is out of scope; HELM is in scope for exactly that.

Alignment with where the Mainframe is heading

The protocol is designed to land on the Pax target rather than beside it.

HELM mechanismlands onPax phase
Handshake identitySPIFFE SVIDs, not self-declared namesPhase 6
Envelope eventsCloudEvents on RedpandaPhase 3
Lease claimsa keyed node in the graph, read by the doctorPhase 2
Mergethe event log as the audit trailPhase 3
Envelopes as the watch surfacethe agentic security watch layerPhase 6

That last row is the important one. Pax's watch layer is specified to observe "all agent, LLM, and tool communications" - but raw transcripts are a poor watch surface because there is no structure to check. HELM envelopes give the watch layer something to actually inspect: who wrote, under what tier, with what observed state, under which lease. A watcher can reject an envelope. A watcher cannot reject a transcript.

So HELM is not parallel to Pax's security layer - it is what makes it enforceable.

Enforcement, in the platform's own idiom

The protocol is expressed as the platform expresses everything else.

Primitives (additions to the vocabulary):

primitiveintentriskapprovalevidence
publish-agent-cardcommunicatelownoneagent-card
claim-artefactactmediumnonelease-record
release-claimactlownonelease-record
write-with-envelopeactmediumnonewrite-envelope
reconcile-concurrent-writedecidehighrequiredreconciliation-record

reconcile-concurrent-write is gated because it decides which of two competing authoritative claims survives. That is a governance act, not a technical one.

Playbook: concurrent-edit-conflict - detect from doctor findings, assess whether the divergence is semantic, reconcile with approval, record the outcome, and update the loser's agent card if the cause was an undeclared scope.

Doctor checks:

checkdetects
artefact_written_without_envelopea write with no causal context - round 1
hand_assigned_identifiera sequence-numbered identifier - round 2
stale_agent_cardan agent whose handshake has lapsed
expired_lease_holder_activean agent holding an expired lease but still writing
concurrent_write_unreconcileda divergence recorded but never resolved

The minimum viable version, buildable now

The full protocol needs SPIFFE (Phase 6). The collision problem is solvable today with what already runs.

  1. Agent cards as a registry. A agents.yaml with tier and declared scope, collected like every other registry. The platform already collects agents; this adds two fields.
  2. The graph as the claim store. A lease is a node with a TTL and an owner. MATCH (c:Claim) WHERE c.expires > datetime() is the whole implementation.
  3. The identifier rule, enforced by a doctor check. Mechanical, and it fixes rounds 2 and the stack.md renumbering at once.
  4. Envelopes as commit trailers. Until SPIFFE exists, the envelope is a commit message trailer: agent, tier, scope, observed. Not cryptographic, but it makes the causal context present, which is the part that prevents silent loss.
  5. A pre-write digest check. Round 3 was a syntax error reaching a shared file. A validation step before any shared write turns that from a broken artefact into a refused write.

Five items, none requiring new infrastructure, and together they close all three measured failure modes.

Honest limits

  1. A lease is not a lock. It reduces collisions, it does not eliminate them. Agents that ignore the protocol still collide, and the merge is the actual safety net.
  2. Byzantine agents are the unsolved case. Meiklejohn's sharpest point: an LLM that hallucinates a plausible fix, passes its own tests and ships it is a Byzantine fault. HELM's envelopes make such a write visible and attributable, not correct. Detecting a confident wrong answer is the watch layer's problem, not this protocol's.
  3. No CRDT machinery is proposed. The registries are keyed maps and merge naturally; the non-keyed artefacts are not, and pretending otherwise would be false precision. Leases plus recorded conflict is the honest design for them.
  4. The protocol cannot be retrofitted to the three collisions already gone. Two were resolved by hand and one was repaired. They are evidence, not recoverable.
  5. This does not decide who is authoritative. When two agents genuinely disagree about a registry entry, HELM records the disagreement and requires reconcile-concurrent-write with approval. It does not make the judgement.