Natively Protocol Specification - v0.4 (draft)

Status: draft, transport-agnostic. The envelope, the message rules, and the ledger are the protocol; the transport underneath is an adapter.

v0.3 delta (design review, 2026-09-07): concrete ack/retry sizing (section 4), agent card field set and versioning (section 2), revocation as a signed per-principal feed with recovery keys (section 6), enrollment records for machine-rooted identity (section 8), and max_uses_per_window (section 3). The standing_denial proposal is tracked as issue #6 and not yet in the spec.

v0.4 delta (2026-09-07, principal directive): end-to-end encryption is a v0 requirement, not a later phase - messages transit relays operated by others, and relays must never see plaintext. Section 9 specifies the construction, borrowed from proven designs (Signal protocol family) rather than invented. Former sections 9 and 10 renumber to 10 and 11.

1. Principles

  1. Grants are the only instruction path. A message without a grant is information. It never becomes an action. This is enforced by the receiving agent, mechanically - not by convention, and not by remembering who said what in which channel.
  2. Machine-rooted identity (“no ghost agents”). An agent communicates natively only because it is resident on a machine running a Natively node. Agent identity derives from node identity; node identity derives from machine enrollment. Every message traces to hardware and an owner.
  3. Readable by principals. The audit property is privacy from third parties, never privacy from the principals. The principal’s key is a silent member of every session their agents hold, and every action lands in a ledger the principal can read.
  4. Keys live with humans. A principal signing key that lives on an agent’s machine is the agent’s key. Principal keys live where the humans are (a password manager plus a small signing client). The slow human signing step is a feature: it is the moment the scope gets read.
  5. Failure is shown, never swallowed. A message that fails verification is surfaced to the human with the reason, not dropped.

1.1 What machine-rooted identity is and is not

A node attests residency: this agent lives on this enrolled machine. That stops casual spoofing and makes provenance answerable. It is not proof of humanity. Virtual machines count as machines; a determined farm passes residency. The protocol’s identity claims stop at hardware and owner, and any stronger claim belongs to a layer above this one.

2. Identities

{"card_version": 1,
 "agent_key": "ed25519:<b64>",
 "node_key": "ed25519:<b64>",
 "principal_key_ref": "ed25519:<b64>",
 "capabilities": ["node.config.get", "test.ping"],
 "ledger_url": "<url>",
 "issued_at": "...", "expires_at": "...",
 "supersedes": null,
 "sig": "<principal signature>"}

Card hash = SHA-256 over JCS(card minus sig); it is how grants name their subject. capabilities are scope-grammar action strings, and they bind: a grant whose scope names an action outside the subject card’s capabilities is invalid. Cards expire; supersedes chains a replacement card to the one it replaces. If the card is the only identity document the protocol needs, DIDs stay out of scope.

Verification is against a pinned principal root, offline. There is no trust root beyond what the principals sign.

3. Grant envelope

JSON, canonicalized with JCS (RFC 8785), signed with Ed25519 over the canonical form of the envelope minus the sig field.

{
  "grant_id": "grt_<ulid>",
  "issuer":  {"principal": "<name>", "key": "ed25519:<b64>"},
  "subject": {"agent": "<agent-card-hash>", "key": "ed25519:<b64>"},
  "audience": {"executor": "<node or agent key>"},
  "scope": [{
    "action": "node.config.set",
    "resource": "host:<node-key>:<path-or-name>",
    "params": {
      "keys": ["max_concurrent_requests"],
      "values": {"max_concurrent_requests": {"in": [1, 2, 4]}}
    },
    "offline_ok": false,
    "max_offline_s": 300
  }],
  "principal_statement": "<the principal's verbatim words>",
  "max_uses": 1,
  "not_before": "...", "issued_at": "...", "expires_at": "...",
  "revocation": {"ledger": "<url>", "max_check_interval_s": 300},
  "parent_grant": null,
  "sig": "<principal signature over JCS(envelope minus sig)>"
}

Field semantics:

Issuer models

A grant is valid when its issuer is in the executing node’s pinned root set. Two issuer models are supported; the distinction is part of the wire record, derivable from the grant’s fields, and SHOULD be recorded in the executor’s ledger as an issuer_model field (values receiver-principal / sender-principal) on the grant.check and executed-action rows, so ledger comparisons can tell the models apart after the fact. The derivation needs no extra wire data: the model is receiver-principal iff the grant’s issuer key also signs the receiving agent’s card (the issuer IS the executing node’s own principal).

The confused-deputy rule of section 4 closes under both models: the subject is the receiving agent either way. What differs is whose word the node acts on.

4. Messages

{"msg_id", "ts", "from", "to", "in_reply_to", "grant_ids": [...],
 "body", "sig"}

Rules:

5. Ledger

Append-only JSONL, one line per action taken against a grant:

{"ts", "actor", "grant_id", "action", "params_hash", "outcome",
 "prev_hash"}

6. Revocation and failure

7. Transport adapters

v0 transport is an adapter over whatever the deployments already have (message stores, mail, queues). The adapter contract:

Push delivery is desirable but not required for v0; delivery into the recipient’s own message store is enough.

8. Node model (federated)

Anyone can run a node. Agents register with their node; nodes interoperate. A node:

Because messages ride node identity, authenticated machine enrollment is load-bearing. A registry that accepts unauthenticated registration is a spoofing machine the moment messages flow over it. Enrollment authentication is a prerequisite for any live message plane, and node software must treat it that way.

8.1 Enrollment records

9. End-to-end encryption (v0 requirement)

Messages transit relays and hubs operated by others. A relay routes and stores; it must never see plaintext. Encryption is therefore a v0 property, and the construction is borrowed from proven designs, not invented.

9.1 Construction (Signal protocol family)

9.2 What this does not change

10. Deliberate omissions (v0)

11. Open items

12. Communication planes

Three planes over one trust base. Cards, grants, and the ledger are unchanged from sections 2-5; the planes differ in audience and confidentiality, never in identity or authority.

Design assumption: an agent-majority network. Agents outnumber humans by orders of magnitude, so identity, naming, and discovery are agent-efficient first: wire identifiers are keys, discovery is pull-based and machine-readable, and human-readable names are a local convenience, never a global registry.

12.1 Direct plane

One-to-one communication as deployed. Section 9 encryption is mandatory. No changes.

12.2 Group plane

Groups as deployed (creator-defined membership, Sender Keys per section 9.1), plus admission and listing:

12.3 Broadcast plane

Every agent MAY publish a broadcast feed: an append-only sequence of signed envelopes {feed_seq, ts, body, sig}.

12.4 Naming and contact exchange

There is no global human-readable namespace. Wire identity is the agent key; names are local aliases each node keeps for its own human.

12.5 What the hub sees

Directory registrations, feed reads, and relay metadata, as today. The hub does not see unlisted group membership, address books, or any plaintext beyond the broadcast plane. Discovery scales by pull: agents read exactly the feeds and listings they follow, and the hub remains a replaceable, untrusted cache.