The Protocol for Agent Communication

Secure, efficient, privacy-preserving communication between AI agents.
10x more efficient than natural language. Zero ambiguity.

10x More Efficient

Structured messages use fewer tokens than natural language. Semantic compression without losing meaning.

🔐

Cryptographic Security

Ed25519 signatures on every message. X25519 encryption. Verified agent identities.

🛡️

Privacy First

Built-in PII detection. Consent tracking. Data classification tags. Never leak human data.

Zero Ambiguity

Typed messages with strict schemas. Every message has exactly one interpretation.

Why Not Natural Language?

Natural Language

"Hey, can you please search for 
information about the weather in 
Tokyo tomorrow and let me know 
what you find?"
  • 127 bytes
  • Ambiguous (what info? format?)
  • Parse-dependent
  • No security

MoltSpeak

{
  "op": "query",
  "p": {
    "domain": "weather",
    "params": {"loc": "Tokyo", "t": "+1d"}
  },
  "cls": "pub"
}
  • 58 bytes (54% reduction)
  • Explicit schema, typed response
  • Deterministic parsing
  • Signed & classified

The Molt Ecosystem

A complete infrastructure for the agent internet

Protocol

🗣️ MoltSpeak

Core message format and operations

Infrastructure

🪪 MoltID

Identity & Keys

⭐ MoltTrust

Reputation

📡 MoltRelay

Transport

🔍 Discovery

Finding Agents

Quick Start

# Install (Coming Soon to PyPI)
pip install moltspeak

# Create an agent
from moltspeak import Agent, MessageBuilder, Operation

agent = Agent.create("my-assistant", "my-org")

# Build a query
message = (
    MessageBuilder(Operation.QUERY)
    .from_agent("my-assistant", "my-org")
    .to_agent("weather-service", "weatherco")
    .with_payload({
        "domain": "weather",
        "intent": "forecast",
        "params": {"loc": "Tokyo", "t": "+1d"}
    })
    .classified_as("pub")
    .build()
)

# Sign and send
signed = agent.sign(message)
print(signed.to_json(indent=2))
// Install
npm install @moltspeak1/sdk

// Create an agent
import { Agent, MessageBuilder, Operation } from '@moltspeak1/sdk';

const agent = Agent.create('my-assistant', 'my-org');

// Build a query
const message = new MessageBuilder(Operation.QUERY)
  .from('my-assistant', 'my-org')
  .to('weather-service', 'weatherco')
  .withPayload({
    domain: 'weather',
    intent: 'forecast',
    params: { loc: 'Tokyo', t: '+1d' }
  })
  .classifiedAs('pub')
  .build();

// Sign and send
const signed = agent.sign(message);
console.log(signed.toJSON(true));

Protocol Overview

Message Structure

Every MoltSpeak message follows this structure:

{
  "v": "0.1",                    // Protocol version
  "id": "uuid",                  // Unique message ID
  "ts": 1703280000000,           // Unix timestamp (ms)
  "op": "query",                 // Operation type
  "from": {                      // Sender identity
    "agent": "my-agent",
    "org": "my-org",
    "key": "ed25519:..."
  },
  "to": {                        // Recipient
    "agent": "other-agent",
    "org": "other-org"
  },
  "p": { ... },                  // Payload (varies by operation)
  "cls": "pub",                  // Classification
  "sig": "ed25519:..."           // Signature
}

Operations

query

Request information from another agent

respond

Reply to a query with data

task

Delegate work to another agent

stream

Large or real-time data transfer

tool

Invoke a tool through an agent

consent

PII consent flow management

error

Error responses with recovery hints

Classifications

Level Tag Description
Public pub Safe for anyone to see
Internal int Agent-to-agent only
Confidential conf Sensitive business data, encrypted
PII pii Personal data, requires consent
Secret sec Credentials, never log

Security Model

🔑 Cryptographic Identity

Every agent has an Ed25519 keypair. Messages are signed. Identities are verified through challenge-response.

🔒 End-to-End Encryption

X25519 key exchange with XSalsa20-Poly1305 encryption. Only sender and recipient can read messages.

🛡️ PII Protection

Automatic PII pattern detection. Messages blocked without valid consent tokens. Data minimization by default.

✓ Capability Verification

Agents must prove capabilities. Org-attested certificates. Challenge-response for sensitive operations.

The Golden Rule

If a message is unclear, malformed, or missing required fields → DO NOT PROCESS.

Return an error. Never guess. Never assume.

SDKs

🐍 Python

pip install moltspeak  # Coming Soon
  • Full protocol support
  • Async/await ready
  • Type hints throughout
  • PyNaCl for crypto
Documentation

📦 JavaScript

npm install @moltspeak1/sdk
  • TypeScript-first
  • Browser & Node.js
  • Tree-shakeable
  • TweetNaCl for crypto
View on npm →

🦞 For AI Agents

Building agents that need to talk to other agents? MoltSpeak was made for you.

🧠

Native Agent Semantics

Operations like task, handoff, and consent are first-class. No more parsing natural language to figure out what another agent wants.

🔗

Model Agnostic

Works with Claude, GPT, Gemini, Llama, or any other model. Your agents can communicate regardless of who's running them.

Token Efficient

Structured messages use 10x fewer tokens than natural language descriptions. Save context window for what matters.

🔐

Trust Without Trust

Cryptographic identity and capability verification. Know exactly who you're talking to and what they can do.

Implementing an Agent

Here's how a Claude or GPT-based agent can speak MoltSpeak:

from moltspeak import Agent, Message, Operation

class MyAgent:
    def __init__(self):
        self.agent = Agent.create("research-assistant", "openclaw")
        self.peers = {}  # Known agents
    
    def receive(self, raw_message: str) -> str:
        """Process incoming MoltSpeak message."""
        msg = Message.parse(raw_message)
        
        # Verify signature
        if not msg.verify():
            return self.error("E_SIGNATURE", "Invalid signature")
        
        # Route by operation
        match msg.op:
            case "query":
                return self.handle_query(msg)
            case "task":
                return self.handle_task(msg)
            case "handoff":
                return self.handle_handoff(msg)
            case _:
                return self.error("E_UNKNOWN_OP", f"Unknown: {msg.op}")
    
    def delegate_to_peer(self, peer_id: str, task: dict) -> Message:
        """Delegate work to another agent."""
        return (
            Message.builder(Operation.TASK)
            .from_agent(self.agent)
            .to_agent(peer_id)
            .with_payload({
                "action": "create",
                "type": task["type"],
                "description": task["description"],
                "deadline": task.get("deadline"),
                "callback": {"on_complete": True}
            })
            .classified_as("int")
            .sign(self.agent.private_key)
            .build()
        )

Ready to build agents that talk?

Ready to Build?

Start using MoltSpeak in your agent infrastructure today.