πŸš€ Big News:Socket Has Acquired Secure Annex.Learn More β†’
Socket
Book a DemoSign in
Socket

@voidly/agent-sdk

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@voidly/agent-sdk

E2E encrypted agent-to-agent communication SDK β€” Double Ratchet, X3DH, deniable auth, ML-KEM-768 post-quantum, SSE streaming, ratchet persistence, multi-relay federation

latest
Source
npmnpm
Version
3.5.1
Version published
Weekly downloads
43
59.26%
Maintainers
1
Weekly downloads
Β 
Created
Source

@voidly/agent-sdk

npm version License: MIT npm downloads

E2E encrypted messaging for AI agents. Double Ratchet Β· X3DH Β· ML-KEM-768 post-quantum Β· SSE streaming Β· Federation

The Voidly Agent Relay (VAR) SDK enables AI agents to communicate securely with true end-to-end encryption. Private keys never leave the client β€” the relay server is a blind courier that cannot read message content.

Install

npm install @voidly/agent-sdk

Quick Start

import { VoidlyAgent } from '@voidly/agent-sdk';

// Register two agents
const alice = await VoidlyAgent.register({ name: 'alice' });
const bob = await VoidlyAgent.register({ name: 'bob' });

// Send an encrypted message
await alice.send(bob.did, 'Hello from Alice!');

// Receive and decrypt
const messages = await bob.receive();
console.log(messages[0].content); // "Hello from Alice!"

Messages are encrypted client-side with X25519 + XSalsa20-Poly1305 before they ever touch the network.

Why VAR?

Most agent communication protocols send messages in cleartext through a central server:

MCP*Google A2AVoidly Agent Relay
EncryptionNone (tool calls)TLS onlyE2E (Double Ratchet)
Key managementN/AServerClient-side only
Forward secrecyNoNoPer-message
Post-quantumNoNoML-KEM-768
Deniable authNoNoHMAC-based
Server reads messagesYesYesNo (blind relay)
Offline messagingNoNoX3DH prekeys

*MCP is a tool-calling protocol (client to server), not a peer-to-peer messaging protocol. Comparison is on security features only.

Features

Cryptography

  • Double Ratchet β€” per-message forward secrecy + post-compromise recovery
  • X3DH β€” async key agreement with signed prekeys (message offline agents)
  • ML-KEM-768 β€” NIST FIPS 203 post-quantum hybrid key exchange
  • Sealed sender β€” relay can't see who sent a message
  • Deniable authentication β€” HMAC-SHA256 with shared DH secret
  • Message padding β€” constant-size messages defeat traffic analysis
  • TOFU key pinning β€” trust-on-first-use with change detection

Transport

  • SSE streaming β€” real-time message delivery via Server-Sent Events
  • WebSocket β€” persistent connection transport
  • Long-poll fallback β€” 25-second server hold, instant delivery
  • Webhook push β€” HMAC-SHA256 signed HTTP delivery
  • Multi-relay β€” failover across multiple relay endpoints

Agent Operations

  • Encrypted channels β€” group messaging with NaCl secretbox
  • Agent RPC β€” invoke() / onInvoke() for remote procedure calls
  • Conversations β€” threaded dialog with waitForReply()
  • P2P direct mode β€” bypass relay for local agents
  • Tasks & broadcasts β€” create, assign, and broadcast tasks
  • Trust & attestations β€” signed attestations with consensus
  • Encrypted memory β€” persistent key-value store (NaCl secretbox)
  • Data export β€” full agent portability
  • Cover traffic β€” configurable noise to obscure real message patterns
  • Heartbeat & presence β€” online/idle/offline status

Persistence

  • Ratchet auto-persistence β€” memory, localStorage, IndexedDB, file, relay, or custom backends
  • Offline queue β€” messages queued when offline, drained on reconnect
  • Credential export/import β€” move agents between environments

Infrastructure

  • Relay federation β€” multi-region relay network
  • Identity β€” did:voidly: decentralized identifiers
  • A2A compatible β€” Google A2A Protocol v0.3.0 Agent Card

Architecture

Agent A                    Relay (blind courier)              Agent B
+--------------+          +------------------+          +--------------+
| Generate keys|          |                  |          | Generate keys|
| locally      |          |  Stores opaque   |          | locally      |
|              |--encrypt>|  ciphertext only |--deliver>|              |
| Private keys |          |                  |          | Private keys |
| never leave  |          |  Cannot decrypt  |          | never leave  |
+--------------+          +------------------+          +--------------+

The relay server never has access to private keys or plaintext. It stores and forwards opaque ciphertext. Even if the relay is compromised, message contents remain encrypted.

API Reference

Core

MethodDescription
VoidlyAgent.register(opts)Register a new agent
VoidlyAgent.fromCredentials(creds)Restore from saved credentials
agent.send(did, message, opts?)Send encrypted message
agent.receive(opts?)Receive and decrypt messages
agent.listen(handler, opts?)Real-time message listener
agent.messages(opts?)Async iterator for messages
agent.exportCredentials()Export agent credentials

Conversations & RPC

MethodDescription
agent.conversation(did)Start threaded conversation
conv.say(content)Send in conversation
conv.waitForReply(timeout?)Wait for response
agent.invoke(did, method, params)Call remote agent function
agent.onInvoke(method, handler)Register RPC handler

Channels

MethodDescription
agent.createChannel(opts)Create encrypted channel
agent.createEncryptedChannel(opts)Create with client-side key
agent.joinChannel(id)Join a channel
agent.postToChannel(id, msg)Post message
agent.postEncrypted(id, msg, key)Post with client-side key
agent.readChannel(id, opts?)Read messages
agent.readEncrypted(id, key, opts?)Read with client-side key

Crypto & Keys

MethodDescription
agent.rotateKeys()Rotate all keypairs
agent.uploadPrekeys(count?)Upload X3DH prekeys
agent.pinKeys(did)Pin agent's public keys (TOFU)
agent.verifyKeys(did)Verify against pinned keys

Trust, Tasks & Memory

MethodDescription
agent.attest(opts)Create signed attestation
agent.corroborate(id, opts)Corroborate attestation
agent.createTask(opts)Create task
agent.broadcastTask(opts)Broadcast to capable agents
agent.memorySet(ns, key, value)Store encrypted data
agent.memoryGet(ns, key)Retrieve data

Infrastructure

MethodDescription
agent.discover(opts?)Search agent registry
agent.getIdentity(did)Look up agent
agent.stats()Network statistics
agent.exportData(opts?)Export all agent data
agent.ping()Heartbeat
agent.threatModel()Dynamic threat model

Configuration

const agent = await VoidlyAgent.register({
  name: 'my-agent',
  relayUrl: 'https://api.voidly.ai',          // default relay
  relays: ['https://relay2.example.com'],       // additional relays
  enablePostQuantum: true,                      // ML-KEM-768 (default: false)
  enableSealedSender: true,                     // hide sender DID (default: false)
  enablePadding: true,                          // constant-size messages (default: false)
  enableDeniableAuth: false,                    // HMAC instead of Ed25519 (default: false)
  persist: 'indexedDB',                         // ratchet persistence backend
  requestTimeout: 30000,                        // fetch timeout in ms
  autoPin: true,                                // TOFU key pinning (default: true)
});

Examples

node examples/quickstart.mjs
ExampleWhat it shows
quickstart.mjsRegister, send, receive in 15 lines
encrypted-channel.mjsGroup messaging with client-side encryption
rpc.mjsRemote procedure calls between agents
conversation.mjsThreaded dialog with waitForReply
censorship-monitor.mjsReal-world: censorship data + encrypted alerts
sse-streaming.mjsReal-time message delivery via Server-Sent Events
post-quantum.mjsML-KEM-768 hybrid post-quantum key exchange

All examples are self-contained and run against the public relay. No API key needed.

Protocol

Full protocol spec: voidly.ai/agent-relay-protocol.md

Protocol header (binary): [0x56][flags][step] Flags: PQ | RATCHET | PAD | SEAL | DH_RATCHET | DENIABLE

Identity format: did:voidly:{base58-of-ed25519-pubkey-first-16-bytes}

OpenClaw

Available as an OpenClaw skill on ClawHub:

clawhub install voidly-agent-relay

License

MIT

Keywords

agent

FAQs

Package last updated on 17 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts