Security and Encryption
September 4, 2026 · View on GitHub
HiveMind Core secures communication between the server and its satellites with the poorman_handshake library as its cryptographic foundation.
Handshake and Key Exchange
HiveMind Core uses the poorman_handshake Noise handshake for authentication and transport key setup, managed by HiveMindClientConnection in hivemind_core.protocol.
- Identity: every client has an
Access Keyand aPasswordstored throughhivemind_core.database.ClientDatabase. The access key admits the client; the password derives the Noise pre-shared key. - Noise handshake: the v3 Noise handshake (XXpsk2/KKpsk0) is the sole key exchange. It authenticates both ends against the shared password and establishes a forward-secret, always-encrypted transport (HIVEMIND-CRYPTO-1 §3.4). A connection that cannot complete it is rejected with a
1008close — there is no legacy fallback. - PSK: the pre-shared key is
argon2id(password, SHA-256(node_id)). A constrained device that cannot run argon2id on-device flashes the value thathivemind-core derive-pskprints. - Static-key pinning: the server pins the client's Noise static key on first use (TOFU) and rejects a later contradicting key, so a reinstalled client must clear the pin with
hivemind-core reset-noise-pin. - Cipher/encoding: the Noise suite fixes the AEAD cipher;
encodingsnegotiate framing only. A v3 session is encrypted regardless of the chosen encoding.
Encryption Standards
- ChaCha20-Poly1305 and AES-256-GCM: the AEAD ciphers the Noise transport uses, giving both confidentiality and data integrity.
- argon2id: derives the Noise pre-shared key from the password, resisting brute-force attacks.
- RSA: used for
INTERCOMmessages, so nodes can exchange end-to-end encrypted messages that a relay node cannot read. The server verifies the origin signature and pins the sender's public key on first sighting. AnINTERCOMframe with no signed envelope proves nothing about its origin, so the server drops it instead of relaying it.
Permissions and Access Control
The server enforces access control through ClientDatabase and HiveMindClientConnection:
-
Message whitelist:
MessageTypeACLPolicychecks each client'sallowed_typeswhitelist during routing. See Policy Admission Chain. -
Skill/intent blacklisting: restrict which AI skills a specific satellite can trigger with
hivemind-core blacklist-skillandblacklist-intent(hivemind_core.scripts). -
Node-level isolation: clients only receive messages meant for them, or broadcast to their permission level, as defined by
HiveMindNodeTypeinhivemind_core.protocol. -
QUERY/CASCADE response routing:
is_responsemetadata on a QUERY or CASCADE message is checked against the samecan_escalate/can_propagatepermission as an original request, and checked before the response is routed._route_query_responsetrustsmetadata.originator_peeras a bare delivery address, with no proof the sender ever took part in thatquery_id; without the permission gate, a client with no escalate/propagate rights could forge{"is_response": true, "originator_peer": <victim>}around an arbitrary payload and have it delivered to the victim's connection.This closes the unprivileged forgery path, not every forgery path: a client that does hold escalate/propagate permission can still address a response at a peer for a query it never participated in, because the server keeps no per-query record of who actually asked, and routing trusts the sender's own claimed
originator_peer. A privileged sender is still bounded by whatever the message-type ACL and its own permission scope allow, but response addressing itself is not verified against the query.