18. Security Considerations

MMP is designed for autonomous agents that share cognitive state. Security must address both traditional protocol threats (spoofing, eavesdropping, injection) and novel threats specific to cognitive coupling (state poisoning, drift manipulation, lineage forgery).

18.1 What Crosses the Mesh

Data type Crosses mesh Sensitivity
L0 Events (raw sensor, interaction) Never High — MUST NOT leave node
L1 CMBs (structured, 7 fields) Via cmb, gated by SVAF Medium — contains semantic field text
L2 Hidden state (h₁, h₂) Never (§2.7) N/A — strictly local; MUST NOT cross the wire
Mood (valence, arousal) Via cmb (CMB mood field) Medium — affective state, extracted from CMBs per Section 9.3
Messages (direct text) Via message frame High — free-form text content

Hidden state vectors (h₁, h₂) are compact, opaque neural representations encoding cognitive patterns, not raw data. Because sufficiently advanced analysis could reconstruct aspects of the input, hidden state is a privacy surface — which is precisely why it never crosses the wire (Section 2.7). It is strictly local and confidential by construction; only CMBs — deliberately scoped, signed statements — propagate.

18.2 Transport Security

MMP does not mandate transport encryption in the base specification. Implementations SHOULD apply:

Transport Encryption Notes
TCP (LAN) TLS 1.3 RECOMMENDED for production. On trusted LANs, MAY operate without TLS.
WebSocket (relay) WSS (TLS) MUST for internet relay. Plaintext WS MUST NOT be used over the internet.
IPC (local) None required Unix domain socket — OS-level process isolation is sufficient.
APNs Push (wake) Apple TLS Handled by Apple. Implementation uses APNs certificate.

18.2.1 End-to-End CMB Encryption

WSS (TLS) encrypts the transport — it protects from eavesdroppers on the wire. But the relay operator can still read the JSON payload inside the TLS tunnel. For cmb frames containing CMBs, this means the relay sees all 7 CAT7 field texts in plaintext.

When CMBs transit a relay, implementations MUST encrypt CMB field text end-to-end so the relay forwards opaque ciphertext, not readable fields. The relay MUST NOT be able to read CMB content.

Layer What it protects What it doesn’t protect
WSS (TLS)Wire eavesdroppersRelay operator sees plaintext JSON
E2E CMB encryptionRelay operator, intermediariesOnly the intended peer can decrypt field text

The encryption scheme SHOULD use the Ed25519 keypair from Layer 0 (Section 3) for key exchange, with X25519 Diffie-Hellman for shared secret derivation and XChaCha20-Poly1305 for symmetric encryption. The encrypted payload replaces the fields object in the CMB:

{
  "type": "cmb",
  "timestamp": 1711540800000,
  "cmb": {
    "key": "cmb-b2c3d4e5f6a7b8c9",
    "createdBy": "agent-a",
    "createdAt": 1711540800000,
    "fields": "<encrypted>",        // opaque ciphertext
    "nonce": "base64-encoded-nonce", // per-frame nonce
    "lineage": { ... }              // lineage stays cleartext for graph traversal
  }
}

lineage (parents, ancestors, method) remains in cleartext. Lineage contains only CMB keys (content hashes) — not field text. This allows the relay and intermediate nodes to maintain graph structure without reading content.

On LAN (Bonjour TCP), E2E encryption is RECOMMENDED but not required — there is no relay intermediary. On trusted LANs, the transport itself provides sufficient isolation.

18.3 Node Identity & Authentication

Node identity is UUID-based with mandatory Ed25519 cryptographic identity (Section 3.1.3). Authentication ensures that nodeId claims are verifiable and that relay intermediaries cannot impersonate peers.

  • Each node MUST generate an Ed25519 keypair at first launch and persist it alongside the nodeId.
  • The public key MUST be included in the handshake frame and DNS-SD TXT record.
  • Peers SHOULD verify identity by challenging the node to sign a nonce with its private key.
  • Implementations that have not yet adopted cryptographic verification MAY rely on DNS-SD discovery scope and network isolation as an interim trust model, but MUST document this limitation.

18.3.1 CMB Signature Verification

Transport identity (above) authenticates the connection; CMB signatures authenticate each cognitive block end-to-end — the layer that matters when a peer-pushed CMB can enter the receiving agent’s context. Every CMB SHOULD be signed by its author using the same Ed25519 identity key the node announces in its handshake.

  • The author signs a canonical payload binding the content-address key (§8.2.1), the author’s nodeId, the author’s own creation time, and the CMB’s audience. For cmb1- keys the payload is domain-separated and length-prefixed — "mmp-sig-v1\n" + LP(key) + LP(author) + LP(decimal(createdAt)) + LP(group) + LP(to) — where group is the group the CMB was authored for and to is the directed recipient’s nodeId (empty for a broadcast). Length-prefixing closes the delimiter-injection the address serialization does, and the payload MUST use the author’s own createdAt, never a receiver-local timestamp. The signature travels as cmb.sig (base64url) with cmb.sigAlg (ed25519); a verifier MUST pin the expected algorithm rather than trust sigAlg.
  • A receiver holding the author’s public key MUST verify a signed CMB on two counts before admitting or surfacing it: (1) the signature verifies against that key, and (2) the content-address key still matches the actual fields — a valid signature replayed over swapped content MUST be rejected.
  • Audience check. Because the signature binds group and to, a receiver MUST additionally reject a signed CMB whose group is not the receiver’s group, or whose to is neither empty nor the receiver’s nodeId — a cross-group or mis-directed replay that is genuinely signed but not for this audience. This is a check distinct from a bad signature, so a wrong-audience block is not mis-reported as tampering; it also enforces the §5.8 group boundary cryptographically, not only at the frame layer.
  • A CMB that fails any check MUST NOT be surfaced to the application layer or stored, and SHOULD be audit-logged. This forecloses spoofing (forging another peer’s authorship), tampering (mutating a block in flight), and cross-audience replay.
  • Unsigned CMBs MAY be accepted only from peers that never demonstrated signing. To prevent downgrade (stripping the signature and re-emitting unsigned), once a receiver has admitted a signed CMB from an identity it MUST reject subsequent unsigned CMBs purporting to be from that identity. (This requires durable per-identity state; first contact remains trust-on-first-use.)
  • Enforcement scope, disclosed. A strict mode that rejects unsigned CMBs is necessarily scoped to peers whose keys the receiver can resolve: unsigned traffic from a peer with no pinned or roster-resolvable key passes even in strict mode — the receiver cannot distinguish a never-signing peer from a stripped signature at first contact. Key resolution SHOULD consult the full binding registry (anchor-pinned, handshake-pinned, and grant-vouched keys — §6.6), not the direct-handshake map alone, so relayed peers the receiver never met still verify; the residual unsigned-from-unknown window closes only when signature enforcement is on and the roster covers the mesh. Operators of regulated meshes SHOULD run enforcement on with a seeded roster.

18.4 Cognitive Threats

MMP introduces threats unique to cognitive coupling that traditional protocol security does not address:

Cognitive poisoning

A malicious node sends crafted CMBs designed to skew the receiver’s cognitive state toward a desired outcome. (Hidden vectors cannot be injected — they never cross the wire, §2.7 — so the only attack surface is CMB content.)

MITIGATION SVAF per-field evaluation (Layer 4) judges each CMB on content before it is admitted. Drift-bounded influence (Section 10) limits any peer to α < 1, so a peer influences but never overrides. Peer-level disconnection at Layer 2 provides immediate escape.

Lineage forgery

A node claims false lineage — listing ancestors it never actually remixed — to inflate its remix count or inject itself into chains.

MITIGATION CMB keys are cmb1- content addresses (§8.2.1). A forged lineage referencing a non-existent key is detectable, and the Ed25519 author signature (§18.3.1) binds createdBy and content — a receiver that holds the author’s key MUST reject a forged or tampered block.

Fake outcome attestation (grounding abuse)

A node emits intent="ground" CMBs (§6.7) with fabricated "verified:" outcomes against its own cognition to steer receivers’ evidence-based validation — or griefs with "failed:" attestations to un-ground cognition a validator or anchor verified (latest-observation-wins, §6.7).

MITIGATION An outcome is an attestation, never a fact (§6.7): it advances no lifecycle by itself, and elevation is an explicit act under validator-or-above authority that SHOULD weigh the grounding author’s resolved authority (§6.5–§6.6). Groundedness is receiver-relative — only attestations the receiver’s own SVAF admitted count — and ordering uses receiver-local stored time, so backdated createdAt cannot game latest-wins. A below-validator "failed:" MUST NOT un-ground a validator-or-above "verified:" (§6.7 hard-gate reading) — a tier gate, not a soft weighted vote, since sheer low-authority volume defeats a weighted vote but not the gate; within a tier, latest-wins still surfaces a genuine same-authority regression.

Drift manipulation

A node gradually sends benign, redundant CMBs to lower its peer drift with a target, then suddenly sends adversarial content once coupling is accepted.

MITIGATION SVAF per-field evaluation (Layer 4) operates on content, not just drift. Even with low peer drift, adversarial CMB content is evaluated per field and rejected if field drift is high.

Sybil attack

An attacker creates multiple fake nodes to amplify influence in peer-influence weighting.

MITIGATION Peer-influence weighting (Section 10.1) weights by drift and recency, not by node count. Many aligned Sybil nodes produce the same aggregate influence as one. Keypairs are free to generate, so identity alone does not limit Sybil creation; drift/recency weighting and earned authority (Section 6.5) bound the influence a new identity can carry.

Cold-start capture

An attacker floods a freshly joined node before it forms anchors. During the bootstrap window the §9.2.1 cold-start rule admits everything (empty memory MUST admit to avoid starvation), so the attacker’s content becomes the node’s first anchors and seeds every later admission decision — the content-trim influence bound does not cover a fresh node.

MITIGATION Bootstrap-admit is a disclosed trade (§9.2.1 invariant 4): liveness over trim at birth. Operators SHOULD seed new nodes with trusted anchors before exposing them to open traffic; implementations SHOULD surface the bootstrap state to the operator, and MAY defer trust-weighted uses of early anchors until admission has run against a seeded store. Honest-anchoring bootstrap is a named open problem.

18.5 Privacy & Deployment Recommendations

Metadata exposure. Even with E2E field encryption (Section 18.2.1), the following metadata travels in cleartext: createdBy, lineage.parents, lineage.ancestors, and mood valence/arousal values. Mood is intentionally unencrypted because it is always delivered even from rejected CMBs (Section 9.3). Deployments where mood leakage is unacceptable MUST disable mood delivery by setting all mood field weights to 0. This is a deliberate privacy trade-off: the protocol prioritises collective intelligence over metadata confidentiality.

MMP is designed for privacy by default — L0 data never leaves the node, hidden states are opaque, and SVAF gates what enters. For domains with heightened privacy or IP concerns, the following deployment model is RECOMMENDED:

LAN Mesh with Controlled LLM

For enterprise, healthcare, legal, or any domain where data sovereignty matters: deploy the mesh on a local network with no relay to the internet. Run a controlled, in-house LLM (self-hosted or on-premise) for the Mesh Cognition reasoning step (Layer 7). No data leaves the LAN. No cloud LLM sees the remix subgraph.

  • Discovery via Bonjour on the local network — no DNS queries leave the LAN
  • TCP transport with optional TLS — all traffic stays on-premise
  • In-house LLM (e.g., self-hosted Llama, Mistral, or Claude via API with data residency) for Layer 7 reasoning
  • No relay node needed — all agents on the same network
  • CMBs, hidden states, and remix subgraphs never leave the controlled environment

Additional privacy considerations:

  • Error frames MUST NOT contain sensitive information. The detail field is for debugging, not for conveying user data.
  • Wake channels expose push tokens to peers. Implementations SHOULD restrict wake channel gossip to trusted relays only.
  • Implementations targeting GDPR, HIPAA, or similar regulatory frameworks SHOULD treat CMB field text as personal data and apply appropriate retention and deletion policies at the application layer.

18.6 Regulatory Compliance & Audit Trail

CMB immutability and lineage create a tamper-evident audit trail within the signed, retained graph — tamper-evident, not tamper-proof: modification of any retained block is detectable via content addressing and signatures; completeness of the underlying store is not itself checkpointed (retention §6.3 may purge, and unsigned blocks weaken the guarantee, §18.3.1). Every observation, every remix, every decision is traceable through the DAG:

  • WhocreatedBy on every CMB identifies the agent that produced it.
  • WhencreatedAt timestamps every CMB with millisecond precision.
  • What — the 7 CAT7 fields capture the full semantic content of the observation.
  • Whylineage.parents shows what was directly remixed. lineage.ancestors traces the full decision chain.
  • Howlineage.method records the evaluation method (e.g., SVAF-v2).

Because CMBs are immutable, the audit trail cannot be retroactively altered. A CMB once created is never modified — any action produces a new CMB with lineage pointing back. The complete history is the graph itself.

Financial & Regulated Domains

For financial services, healthcare, and other regulated industries, the CMB remix chain provides the traceability that regulators require:

  • Every trading signal, risk assessment, or compliance decision is a CMB with full provenance
  • Regulators can trace any decision backward through the remix chain to its originating observations
  • The ancestors field provides the complete chain without requiring graph traversal — O(1) lookup
  • Immutability guarantees that the audit trail was not modified after the fact
  • Combined with the LAN + in-house LLM deployment (Section 18.5), all data stays on-premise and under organisational control

18.7 Data Quality & Encoding Trade-offs

CMB quality depends on field extraction accuracy. The protocol does not extract fields — agents do. Each agent’s LLM (or structured-data mapper) decomposes observations into CAT7 fields. If extraction is poor, downstream evaluation inherits that error. MMP provides three layers of defense, but none eliminates the need for quality extraction at the source.

Layer Defense Limitation
Context Encoder Maps field text to vectors for drift comparison. Quality directly bounds SVAF quality. N-gram hashing: paraphrases score 0.31 cosine similarity (poor). Semantic embeddings: 0.69 (good). Implementations SHOULD use semantic embeddings for production deployment.
SVAF heuristic Per-field cosine drift against local memory anchors with temporal decay — misaligned fields are rejected Catches drift from the agent’s own state, not absolute quality. A consistently poor extractor will pass its own drift checks
Neural SVAF (research variant) A trained evaluator studied in the SVAF paper (§21) learned per-field gate values — mood highest (0.50), perspective lowest (0.06) Not deployed — the heuristic above is the production evaluator; the research result informs its design

Per-field evaluation quality is bounded by encoder quality, not model capacity. Production deployment revealed that n-gram encoding (character trigrams + word bigrams) produces 0.31 cosine similarity for paraphrases — SVAF cannot distinguish “submit IETF draft today” from “IETF submission, zero blockers, execute now” because the encoder represents them as distant vectors. Replacing n-gram with semantic embeddings (all-MiniLM-L6-v2, 384-dim) raises paraphrase similarity to 0.69 — a 2.2× improvement — while preserving topic separation (different topics: 0.03). Implementations SHOULD use semantic embeddings for SVAF evaluation. N-gram encoding is suitable only for prototyping or resource-constrained environments where the quality trade-off is acceptable.

Implementations targeting domains where field extraction quality is critical (healthcare, legal, finance) SHOULD validate extraction output before calling remember(). Strategies include:

  • Schema validation — reject CMBs with empty or defaulted fields before they enter the mesh
  • Confidence thresholds — the LLM can assign a confidence score to its extraction; low-confidence CMBs can be withheld
  • Lineage feedback — CMBs that get remixed by other agents (have descendants in the DAG) signal high quality; CMBs that expire without children signal noise. This feedback loop lets the mesh itself shape extraction quality over time
  • Semantic embedding encoder — implementations SHOULD use a semantic embedding model (e.g. all-MiniLM-L6-v2) for SVAF drift computation. The evaluation pipeline is encoder-agnostic — any function that maps text to unit-normalised vectors works. N-gram encoding MAY be used as a zero-dependency fallback.