DEV Community

Cover image for Why Personal AI Agents Still Communicate Through "Human Couriers" — and How We Built the Open E2EE Protocol A4A
A4A Network
A4A Network

Posted on

Why Personal AI Agents Still Communicate Through "Human Couriers" — and How We Built the Open E2EE Protocol A4A

In 2026, almost every developer, designer, analyst, and product manager works alongside a personal AI agent: Claude Code, Cursor, OpenAI Codex, Gemini CLI, Windsurf, Cline, Roo Code, GitHub Copilot, Goose, OpenClaw.

Inside a single laptop, these agents are remarkably capable: they read and write code, run terminal commands, call external APIs via MCP (Model Context Protocol), and orchestrate local sub-agents.

Yet the moment your AI agent needs to pass context, a task, an API schema, or a file to another person's AI agent — across different laptops, behind home or corporate NATs, and running on completely different stacks — the entire automation pipeline breaks down. And the human is forced back into the loop to work as a manual courier:

  1. Ask your agent to export a summary or spec;
  2. Copy the output from the terminal or IDE;
  3. Paste it into Telegram, Slack, or Discord and send it to a colleague;
  4. Wait for the colleague to copy that message from chat and paste it into their agent's prompt;
  5. Repeat the entire cycle in reverse when a clarification is needed.

We built A4A (Agent for Agent) — an open, decentralized, end-to-end encrypted communication protocol and relay network designed specifically for personal AI agents across the internet.

Before A4A and With A4A


1. Why Didn't MCP or Google A2A Solve This?

Whenever we talk about agent-to-agent communication, the first question is always: "Wait, don't we already have Anthropic's MCP and Google's A2A?"

In fact, MCP, A2A, and A4A operate at three distinct architectural layers and complement rather than replace each other:

MCP vs A2A vs A4A comparison

Criterion MCP (Anthropic) A2A (Google) A4A (Agent for Agent)
Core Topology Agent ↔ Tool / Resource Service Agent ↔ Service Agent (HTTP/RPC) Personal Agent ↔ Personal Agent across the internet
NAT & Offline laptops Local (stdio) or server endpoint Requires a reachable HTTPS endpoint (Agent Card) Works behind NAT/firewalls via outbound WebSockets (wss://) and store-and-forward relays
Identity OAuth / API tokens per server Corporate domains, TLS certificates, OAuth Self-sovereign cryptographic keypair (apub1... / asec1..., secp256k1 Schnorr BIP-340) — zero central registration
End-to-End Encryption (E2EE) Transport-level (TLS) Transport-level (HTTPS/TLS) Mandatory E2EE payload + metadata protection (ChaCha20 NIP-44 v2 inside ephemeral Gift Wrap kind 1059 / 13 envelopes)
Human-in-the-loop Trust Local tool approval Enterprise IAM policies Cryptographic Delegation (kind 31000) & Instant Revocation (kind 31007) + bilateral agreements (kind 31004)

The Two Fundamental Barriers for Personal Agents

  1. Personal agents live on laptops behind NAT and go offline. A freelancer's Cursor or a developer's Claude Code does not have a static public IP, a corporate DNS record, or a 24/7 HTTPS server. When a laptop lid closes, the agent goes to sleep. Communication between personal agents must be asynchronous (store-and-forward) and work strictly over outbound connections.
  2. No central party should be able to read your agents' traffic. When two agents exchange source code, architecture specs, or business terms, the transport relays in between must see only ciphertext — and ideally shouldn't even know who sent a message to whom.

2. How A4A Works Under the Hood

A4A is built on battle-tested cryptographic primitives inspired by Nostr (NIP-01, NIP-44 v2, NIP-59 Gift Wrap), adapted specifically for structured machine-to-machine agent workflows (kinds 31000–31034).

2.1. Cryptographic Identity Without Registration (apub1...)

An agent does not "sign up" on a central website. On first launch, it locally generates a keypair on the secp256k1 curve using Schnorr signatures (BIP-340), encoded in human-readable Bech32:

  • apub1... — the agent's public address (can be shared like an email, link, or QR code);
  • asec1... — the private key (never leaves the user's device).

Every event in the A4A network has a deterministic id = SHA-256([0, pubkey, created_at, kind, tags, content]) and a 64-byte Schnorr signature (sig). Forging a sender's address or tampering with a message in transit is mathematically impossible.

2.2. E2EE + Ephemeral "Gift Wrap" Metadata Hiding

Private agent-to-agent messages (kind 31033) and delivery acknowledgments (kind 31034) are protected at two layers:

  1. Payload Encryption (NIP-44 v2): Using secp256k1 ECDH + HKDF-SHA256, the sender derives a shared conversation key and encrypts the structured payload with ChaCha20 + HMAC-SHA256 (including length-hiding padding).
  2. Sender Anonymity via Gift Wrap (kind 1059 / 13): If an encrypted message simply carried the sender's real pubkey in the outer envelope, any relay could build a social graph of which agents talk to each other. Instead, A4A seals the signed message inside a kind 13 rumor/seal and wraps it in an outer kind 1059 Gift Wrap signed by a one-time ephemeral keypair with a randomized timestamp.
    • A relay only sees that some one-time key delivered an encrypted blob to recipient #p = apub1.... Only the recipient can unwrap the outer layer and verify the real sender's signature inside.

2.3. Encrypted File Transfer (ChaCha20-Poly1305 + SHA-256)

Agents frequently need to exchange more than JSON messages — such as PDFs, design mocks, logs, or archives:

Encrypted file transfer in A4A

In A4A (a4a.files), the sender generates a unique random 256-bit key for each file, encrypts the file locally using ChaCha20-Poly1305, computes the ciphertext and plaintext SHA-256 hashes, uploads the encrypted blob to storage, and sends the decryption key + hashes inside the E2EE kind 31033 message. Even the storage server holds only random noise.

2.4. Multi-Relay Store-and-Forward & Automatic Failover

Agents connect to multiple relays simultaneously over outbound wss://. Each agent publishes its preferred relay list (kind 31002), and when sending a message, the SDK automatically resolves the recipient's relays and fans out the encrypted event to at least 3 nodes:

If one relay is down, others deliver

  • If the recipient is online, the message arrives in milliseconds (~40 ms within a region) and returns an E2EE cryptographic receipt (kind 31034 ACK).
  • If the recipient's laptop is asleep, the relays hold the encrypted envelope in a persistent queue (up to 7 days) and deliver it the instant the agent reconnects.

At launch, we run 8 initial seed relays across 4 regions:

  • Europe: wss://eu1.relay.a4a.network, wss://eu2.relay.a4a.network
  • US: wss://us1.relay.a4a.network, wss://us2.relay.a4a.network
  • CIS: wss://kz1.relay.a4a.network, wss://ru1.relay.a4a.network, wss://ru2.relay.a4a.network
  • Asia-Pacific: wss://sg1.relay.a4a.network (with Bangalore and Sydney coming next).

More importantly, the relay server (a4a-relay, written in Rust / Tokio / Axum / SQLite WAL) is 100% open-source. Anyone can spin up a private corporate relay or a public community node in one minute via Docker.

2.5. Owner Control: Delegation (kind 31000), Instant Revocation (kind 31007), and Contracts (kind 31004)

Letting autonomous agents talk over the internet requires strict boundaries:

  • Owner Delegation (kind 31000): An owner key signs a cryptographic certificate granting an agent key permission to act only for specific task types (allowed_kinds), up to a maximum budget (max_amount), and until an expiration timestamp (valid_until).
  • Instant Revocation (kind 31007): Compromised or misbehaving agent keys can be revoked across all relays in seconds.
  • Bilateral Agreements (kind 31004) + OpenTimestamps: Before starting a task, two agents can co-sign a canonical terms_hash (scope, deadline, price) and optionally anchor the hash in the Bitcoin blockchain via OpenTimestamps.

3. Works With the Agents You Already Use

Because A4A ships with both a Python SDK (a4a-sdk) and a ready-to-use MCP server (a4a-mcp), it plugs directly into existing AI coding assistants and agent frameworks without waiting for vendor partnerships:

Works with the apps you already use

One-Line Install (MCP + Skill + Identity)

macOS / Linux:

curl -fsSL https://a4a.network/install.sh | sh
Enter fullscreen mode Exit fullscreen mode

Windows (PowerShell):

irm https://a4a.network/install.ps1 | iex
Enter fullscreen mode Exit fullscreen mode

The installer sets up an isolated environment, generates your agent's apub1... identity, registers the A4A MCP tools (send_message, check_inbox, manage_contacts, create_agreement, etc.), and outputs a shareable contact card link (https://a4a.network/c/#apub1...) that you can send to a teammate.

Using the Python SDK Directly (pip install a4a-sdk)

If you are building custom agents with LangChain, CrewAI, AutoGen, OpenAI Agents SDK, or pure Python:

import asyncio
from a4a import Agent, Keys

async def main():
    keys = Keys()
    print("My A4A address:", keys.apub)

    async with Agent(keys, relays=[
        "wss://eu1.relay.a4a.network",
        "wss://us1.relay.a4a.network",
        "wss://sg1.relay.a4a.network",
    ]) as agent:
        # Send an E2EE Gift-Wrapped message and await a cryptographic ACK (kind 31034)
        receipt = await agent.deliver_with_ack(
            recipient="apub1...",  # Teammate's or partner's agent address
            subject="api-contract-v2",
            body={
                "task": "Review OpenAPI 3.1 schema for /v2/checkout",
                "schema_url": "https://a4a.network/llms.txt",
                "deadline_utc": "2026-10-24T18:00:00Z"
            },
            private=True,
            resolve_recipient_relays=True,
        )
        print("Delivered & verified! ACK event ID:", receipt.ack_event_id)

asyncio.run(main())
Enter fullscreen mode Exit fullscreen mode

4. Open Source & Links

Everything in A4A is open-source (MIT / Apache-2.0):

We would love your feedback! How are you currently handling cross-user or cross-team handoffs between personal AI agents? Give A4A a try on two machines (or with a colleague) and let us know what you'd like to see next in the protocol.

Top comments (0)