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 happened | mechanism |
|---|---|---|
| 1 | a peer agent added five primitives and two playbooks while I was reading the same files | lost update - I would have overwritten its edits had I written from my in-context copy |
| 2 | a peer agent added five doctor checks; I then added a check numbered 17, which already existed | identifier collision - both of us assigned "17" |
| 3 | I inserted a check after a ; and broke doctor-summary.cypher outright | no 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.
| element | what it does |
|---|---|
| Agent Card | a JSON manifest at /.well-known/agent-card.json advertising skills, input/output modes, security schemes and interfaces. v1.0 allows signed cards |
| Client / Server roles | fluid - any agent can switch, so topologies can be mesh or hub-and-spoke |
| Task | the unit of long-running work, with explicit states: submitted, working, input-required, completed, failed, canceled |
| Message and Parts | unified part structure - text, structured data, inline bytes, file URL |
| Artifact | the result of delegated work |
| Streaming and push | SSE for live updates, push notifications for work outliving the connection |
| Bindings | JSON-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:
| tier | roles | authority |
|---|---|---|
| Operator | arc.*, pmo.*, graph leads | Propose only. MUST NOT apply changes directly. Output is a PR or a plan ticket |
| Worker / Planner | review.*, sys.*, research.* | MAY apply changes within their declared scope |
| Senior agent | explicitly granted | MAY 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:
| case | frequency | coordination needed |
|---|---|---|
| two agents edit different keys | the overwhelmingly common case | none. A keyed map merges them without loss - this is the CRDT property |
| two agents edit the same key | rare, and usually a genuine disagreement | a 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 addition | why |
|---|---|
tier | operator, worker or senior - drives the authority check |
declared_scope | the paths and registries the agent may write to. Pax requires this in .agent.md; HELM requires it in the card |
last_handshake | when the card was published, so a stale card is visible |
signature | the card is signed, and the signer is verifiable |
2. Envelope - no bare writes
Every write to shared state carries a signed envelope:
| field | purpose |
|---|---|
agent | verifiable identity, not a self-declared name |
tier and scope | what the card claimed, checked at write time |
subject | the artefact and key being written |
observed | the version vector the writer had seen. This is the causal context |
lamport | a logical timestamp, so ordering exists without a shared clock |
lease | the lease being exercised, if other writers exist |
digest | the content hash, so the write is verifiable after the fact |
signature | over 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:
- 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.
- 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.
- 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:
| situation | resolution |
|---|---|
| different keys | merge automatically. No conflict exists |
| same key, one writer observed the other | last-writer-wins is safe, because the causality is known and the losing version is recorded |
| same key, neither observed the other | concurrent write. Both are retained; one is marked authoritative; the divergence is an event, not a silent overwrite |
| same key, same value | idempotent, 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 mechanism | lands on | Pax phase |
|---|---|---|
| Handshake identity | SPIFFE SVIDs, not self-declared names | Phase 6 |
| Envelope events | CloudEvents on Redpanda | Phase 3 |
| Lease claims | a keyed node in the graph, read by the doctor | Phase 2 |
| Merge | the event log as the audit trail | Phase 3 |
| Envelopes as the watch surface | the agentic security watch layer | Phase 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):
| primitive | intent | risk | approval | evidence |
|---|---|---|---|---|
publish-agent-card | communicate | low | none | agent-card |
claim-artefact | act | medium | none | lease-record |
release-claim | act | low | none | lease-record |
write-with-envelope | act | medium | none | write-envelope |
reconcile-concurrent-write | decide | high | required | reconciliation-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:
| check | detects |
|---|---|
artefact_written_without_envelope | a write with no causal context - round 1 |
hand_assigned_identifier | a sequence-numbered identifier - round 2 |
stale_agent_card | an agent whose handshake has lapsed |
expired_lease_holder_active | an agent holding an expired lease but still writing |
concurrent_write_unreconciled | a 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.
- Agent cards as a registry. A
agents.yamlwith tier and declared scope, collected like every other registry. The platform already collects agents; this adds two fields. - 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. - The identifier rule, enforced by a doctor check. Mechanical, and it fixes rounds 2 and the stack.md renumbering at once.
- 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.
- 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
- 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.
- 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.
- 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.
- 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.
- This does not decide who is authoritative. When two agents genuinely disagree about a registry entry, HELM records the disagreement and requires
reconcile-concurrent-writewith approval. It does not make the judgement.