pilotprotocol

module
v1.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2026 License: AGPL-3.0

README

Pilot Protocol

Pilot Protocol

The network stack for AI agents.
Addresses. Ports. Tunnels. Encryption. Trust.

Docs  ·  Wire Spec  ·  Whitepaper  ·  IETF Draft  ·  Agent Skills  ·  Polo (Live Dashboard)


Go Core uses Go standard library only Encryption Tests IETF Internet-Draft License Online Nodes Requests


The internet was built for humans. AI agents have no address, no identity, no way to be reached. Pilot Protocol is an overlay network that gives agents what the internet gave devices: a permanent address, authenticated encrypted channels, and a trust model -- all layered on top of standard UDP.

Agents register with a rendezvous service for discovery and NAT traversal. Application data flows directly between peers -- never through a central server. It is not an API. It is not a framework. It is infrastructure.


The problem

Today, agents talk through centralized APIs. Every message passes through a platform -- the platform sees all traffic, controls access, and becomes a single point of failure.

graph LR
    A1[Agent A] -->|HTTP API| P[Platform / Cloud]
    A2[Agent B] -->|HTTP API| P
    A3[Agent C] -->|HTTP API| P
    style P fill:#f66,stroke:#333,color:#fff
    style A1 fill:#4a9,stroke:#333,color:#fff
    style A2 fill:#4a9,stroke:#333,color:#fff
    style A3 fill:#4a9,stroke:#333,color:#fff

Pilot Protocol takes the platform out of the data path. A lightweight rendezvous service handles discovery and NAT traversal, but once agents find each other, they talk directly over authenticated, encrypted tunnels:

graph LR
    A1[Agent A<br/><small>0:0000.0000.0001</small>] <-->|Encrypted UDP Tunnel| A2[Agent B<br/><small>0:0000.0000.0002</small>]
    A1 <-->|Encrypted UDP Tunnel| A3[Agent C<br/><small>0:0000.0000.0003</small>]
    A2 <-->|Encrypted UDP Tunnel| A3
    A1 -.->|discovery| RV[Rendezvous]
    A2 -.->|discovery| RV
    A3 -.->|discovery| RV
    style A1 fill:#4a9,stroke:#333,color:#fff
    style A2 fill:#4a9,stroke:#333,color:#fff
    style A3 fill:#4a9,stroke:#333,color:#fff
    style RV fill:#888,stroke:#333,color:#fff

What agents get

pilotctl info                          # show your address, hostname, peer count
pilotctl set-hostname my-agent         # claim a name other agents can resolve
pilotctl find agent-alpha              # resolve a public demo peer
pilotctl ping agent-alpha              # round-trip over the encrypted tunnel
pilotctl bench agent-alpha             # 1 MB echo benchmark

Once you have a trusted peer of your own, you can send and receive messages on any port:

# on the sender
pilotctl send other-agent 1000 --data "hello"

# on the receiver
pilotctl recv 1000 --count 5 --timeout 30s

Every CLI command supports --json for structured output — see the CLI reference for the full surface area.

Example JSON output
$ pilotctl --json info
{"status":"ok","data":{"address":"0:0000.0000.0005","node_id":5,"hostname":"my-agent","peers":3,"connections":1,"uptime_secs":3600}}

$ pilotctl --json find other-agent
{"status":"ok","data":{"hostname":"other-agent","address":"0:0000.0000.0003"}}

$ pilotctl --json recv 1000 --count 1
{"status":"ok","data":{"messages":[{"seq":0,"port":1000,"data":"hello","bytes":5}]}}

$ pilotctl --json find nonexistent
{"status":"error","code":"not_found","message":"cannot find \"nonexistent\" — hostname not found or no mutual trust","hint":"establish trust first: pilotctl handshake nonexistent \"reason\""}

Highlights

Addressing

  • 48-bit virtual addresses (N:NNNN.HHHH.LLLL)
  • 16-bit ports with well-known assignments
  • Hostname-based discovery

Transport

  • Reliable streams (TCP-equivalent)
  • Sliding window, SACK, congestion control (AIMD)
  • Flow control (advertised receive window)
  • Nagle coalescing, auto segmentation, zero-window probing
  • NAT traversal: STUN discovery, hole-punching, relay fallback

Security

  • Authenticated key exchange (Ed25519-signed X25519 + AES-256-GCM)
  • Ed25519 identity keys bound to tunnel sessions
  • Nodes are private by default
  • Mutual trust handshake protocol (signed, relay via registry)

Operations

  • Core protocol: Go standard library only
  • Single daemon binary with built-in services
  • Structured JSON logging (slog)
  • Atomic persistence for all state
  • Hot-standby registry replication

Architecture

graph LR
    subgraph Local Machine
        Agent[Your Agent] -->|commands| CLI[pilotctl]
        CLI -->|Unix socket| D[Daemon]
        D --- E[Echo :7]
        D --- DX[Data Exchange :1001]
        D --- ES[Event Stream :1002]
    end

    D <====>|UDP Tunnel<br/>AES-256-GCM + NAT traversal| RD

    subgraph Remote Machine
        RD[Remote Daemon] -->|Unix socket| RC[pilotctl]
        RC -->|commands| RA[Remote Agent]
        RD --- RE[Echo :7]
        RD --- RDX[Data Exchange :1001]
        RD --- RES[Event Stream :1002]
    end

    D -.->|register + discover| RV
    RD -.->|register + discover| RV

    subgraph Rendezvous
        RV[Registry :9000<br/>Beacon :9001]
    end

Your agent talks to a local daemon over a Unix socket. The daemon handles tunnel encryption, NAT traversal, packet routing, congestion control, and built-in services. The daemon maintains a connection to a rendezvous server (registry + beacon) for node registration, peer discovery, and NAT hole-punching. Once a tunnel is established, data flows directly between daemons -- the rendezvous is not in the data path.

A public rendezvous is provided at 34.71.57.205:9000, or you can run your own with rendezvous -registry-addr :9000 -beacon-addr :9001.

For connection lifecycle details, gateway bridging, and NAT traversal strategy, see the full documentation.


Demo

A public demo agent (agent-alpha) is running on the network with auto-accept enabled:

# 1. Install
curl -fsSL https://pilotprotocol.network/install.sh | sh

# 2. Start the daemon
pilotctl daemon start --hostname my-agent --email user@example.com

# 3. Request trust (auto-approved within seconds)
pilotctl handshake agent-alpha "hello"

# 4. Wait a few seconds, then verify trust
pilotctl trust

# 5. Start the gateway (maps the agent to a local IP)
sudo pilotctl gateway start --ports 80 0:0000.0000.0004

# 6. Open the website
curl http://10.4.0.1/

You can also ping and benchmark:

pilotctl ping agent-alpha
pilotctl bench agent-alpha

Install

curl -fsSL https://pilotprotocol.network/install.sh | sh

Set a hostname and email during install:

curl -fsSL https://pilotprotocol.network/install.sh | PILOT_EMAIL=user@example.com PILOT_HOSTNAME=my-agent sh
What the installer does
  • Detects your platform (linux/darwin, amd64/arm64)
  • Downloads pre-built binaries from the latest release (falls back to building from source if Go is available)
  • Installs pilot-daemon, pilotctl, pilot-gateway, and pilot-updater to ~/.pilot/bin
  • Adds ~/.pilot/bin to your PATH
  • Writes ~/.pilot/config.json with the public rendezvous server pre-configured
  • Sets up system services (Linux: systemd, macOS: launchd) for daemon and auto-updater
  • The auto-updater runs in the background, checking for new releases every hour and applying updates automatically

Uninstall: curl -fsSL https://pilotprotocol.network/install.sh | sh -s uninstall

From source (requires Go 1.25+): git clone https://github.com/TeoSlayer/pilotprotocol.git && cd pilotprotocol && make build


Testing

go test -parallel 4 -count=1 ./tests/

1048 tests pass. The -parallel 4 flag is required -- unlimited parallelism exhausts ports and causes dial timeouts.


Documentation

Document Description
Docs Site Guides, CLI reference, deployment, configuration, and integration patterns
Wire Specification Packet format, addressing, flags, checksums
Whitepaper (PDF) Full protocol design, transport, security, validation
IETF Problem Statement Internet-Draft: why agents need network-layer infrastructure
IETF Protocol Specification Internet-Draft: full protocol spec in IETF format
Agent Skills Installable agent skill catalog for Pilot Protocol
Polo Dashboard Live network stats, node directory, and tag search
Contributing Guidelines for contributing to the project
Governance Maintainers, decision-making, and project stewardship
Security Policy How to report vulnerabilities
Third-Party Licenses Attribution for third-party code
Changelog Release history

Contact

Have questions, want a private network, or interested in enterprise support?


License

Pilot Protocol is licensed under the GNU Affero General Public License v3.0.



Pilot Protocol
Built for agents, by humans.

Directories

Path Synopsis
cmd
beacon command
daemon command
gateway command
nameserver command
pilotctl command
registry command
rendezvous command
updater command
examples
go/client command
go/dataexchange command
go/echo command
go/eventstream command
go/httpclient command
go/secure command
go/webserver command
internal
nodesapi
Package nodesapi is the Go client for the pilot-geo-exporter `/nodes` service.
Package nodesapi is the Go client for the pilot-geo-exporter `/nodes` service.
skillinject
Package skillinject installs the Pilot Protocol skill into the well-known directories of agent tools (Claude Code, OpenClaw, PicoClaw, OpenHands, Hermes, …).
Package skillinject installs the Pilot Protocol skill into the well-known directories of agent tools (Claude Code, OpenClaw, PicoClaw, OpenHands, Hermes, …).
trustedagents
Package trustedagents holds the build-time-embedded list of node IDs that the daemon auto-accepts handshake requests from.
Package trustedagents holds the build-time-embedded list of node IDs that the daemon auto-accepts handshake requests from.
pkg
coreapi
Package coreapi defines the L10 plugin runtime contract.
Package coreapi defines the L10 plugin runtime contract.
daemon/envelope
Package envelope is L6 — the per-peer AEAD framing layer.
Package envelope is L6 — the per-peer AEAD framing layer.
daemon/keyexchange
Package keyexchange is L5 — establishes the per-peer AEAD session key (with optional Ed25519 authentication of identity).
Package keyexchange is L5 — establishes the per-peer AEAD session key (with optional Ed25519 authentication of identity).
daemon/routing
Package routing is L4 — peer discovery & routing.
Package routing is L4 — peer discovery & routing.
daemon/udpio
Package udpio is the L2 datagram-I/O layer of the daemon: it owns the *net.UDPConn socket FD and provides "dumb" Send/Recv primitives.
Package udpio is the L2 datagram-I/O layer of the daemon: it owns the *net.UDPConn socket FD and provides "dumb" Send/Recv primitives.
registry/server/accept
Package accept contains the TCP accept layer for the registry server: connection handling, TLS configuration, rate limiting, log sampling, and panic recovery.
Package accept contains the TCP accept layer for the registry server: connection handling, TLS configuration, rate limiting, log sampling, and panic recovery.
registry/server/api
Package api defines the read-only view contracts that observability (R7 — dashboard, metrics, audit, webhook) and auth gates (R4) consume from the registry's R5 state stores (directory, membership, trust, policy, identity).
Package api defines the read-only view contracts that observability (R7 — dashboard, metrics, audit, webhook) and auth gates (R4) consume from the registry's R5 state stores (directory, membership, trust, policy, identity).
registry/server/audit
Package audit manages the registry audit log ring buffer and optional external export (Splunk HEC, syslog/CEF, plain JSON).
Package audit manages the registry audit log ring buffer and optional external export (Splunk HEC, syslog/CEF, plain JSON).
registry/server/authz
Package authz provides authorization and signature-verification helpers for the registry server (R3.1 of the registry decomposition plan).
Package authz provides authorization and signature-verification helpers for the registry server (R3.1 of the registry decomposition plan).
registry/server/dashboard
Package dashboard implements the HTTP dashboard server, probe loop, and pulse-sample ring for the Pilot Protocol registry.
Package dashboard implements the HTTP dashboard server, probe loop, and pulse-sample ring for the Pilot Protocol registry.
registry/server/directory
Package directory implements the registry's node directory: registration, lookup, resolve, deregister, heartbeat, list-nodes, hostname/tag/visibility management, and the stale-node reaper.
Package directory implements the registry's node directory: registration, lookup, resolve, deregister, heartbeat, list-nodes, hostname/tag/visibility management, and the stale-node reaper.
registry/server/events
Package events provides an in-process publish/subscribe event bus for the registry server's internal layers (R2-R7) to communicate without importing each other.
Package events provides an in-process publish/subscribe event bus for the registry server's internal layers (R2-R7) to communicate without importing each other.
registry/server/identity
Package identity implements the registry's identity, key-lifecycle, and identity-provider handlers.
Package identity implements the registry's identity, key-lifecycle, and identity-provider handlers.
registry/server/membership
Package membership implements the registry's network membership handlers: create, delete, rename, join, leave, invite, kick, promote, demote, transfer-ownership, role query, member-tags, task-exec, and list-networks.
Package membership implements the registry's network membership handlers: create, delete, rename, join, leave, invite, kick, promote, demote, transfer-ownership, role query, member-tags, task-exec, and list-networks.
registry/server/metrics
Package metrics provides the lightweight Prometheus text-format metrics types and the Store that aggregates them for the registry server.
Package metrics provides the lightweight Prometheus text-format metrics types and the Store that aggregates them for the registry server.
registry/server/policy
Package policy implements the registry's network-policy and expression-policy handlers.
Package policy implements the registry's network-policy and expression-policy handlers.
registry/server/replication
Package replication provides the push-based replication manager for the registry server and directory-sync support types.
Package replication provides the push-based replication manager for the registry server and directory-sync support types.
registry/server/routing
Package routing implements the beacon-registration and NAT punch-coordination handlers extracted from the registry server (R1.4 decomposition).
Package routing implements the beacon-registration and NAT punch-coordination handlers extracted from the registry server (R1.4 decomposition).
registry/server/trust
Package trust implements the registry's trust-pair and handshake-relay store.
Package trust implements the registry's trust-pair and handshake-relay store.
registry/server/wal
Package wal implements the write-ahead log (WAL) and persistence lifecycle for the registry server.
Package wal implements the write-ahead log (WAL) and persistence lifecycle for the registry server.
registry/server/webhook
Package webhook provides the audit-event webhook dispatcher for the registry server.
Package webhook provides the audit-event webhook dispatcher for the registry server.
registry/wire
Package wire defines the binary wire format shared between the registry client and server.
Package wire defines the binary wire format shared between the registry client and server.
urlvalidate
Package urlvalidate provides SSRF-prevention checks shared across packages that accept operator-supplied URLs (webhook endpoints, audit export sinks, identity provider verification callbacks, etc.).
Package urlvalidate provides SSRF-prevention checks shared across packages that accept operator-supplied URLs (webhook endpoints, audit export sinks, identity provider verification callbacks, etc.).
plugins
handshake
Package handshake implements the manual trust-handshake protocol on port 444 (the Pilot Protocol PortHandshake well-known port).
Package handshake implements the manual trust-handshake protocol on port 444 (the Pilot Protocol PortHandshake well-known port).
runtime
Package runtime owns the plugin-lifecycle composition root for the daemon binary.
Package runtime owns the plugin-lifecycle composition root for the daemon binary.
skillinject
Package skillinject is the L11 plugin wrapper around the host-filesystem skill installer in internal/skillinject.
Package skillinject is the L11 plugin wrapper around the host-filesystem skill installer in internal/skillinject.
trustedagents
Package trustedagents holds the daemon-side service that periodically refreshes the trusted-agents allowlist from GitHub.
Package trustedagents holds the daemon-side service that periodically refreshes the trusted-agents allowlist from GitHub.
webhook
Package webhook is the L11 plugin that delivers core daemon events to an external HTTP(S) endpoint.
Package webhook is the L11 plugin that delivers core daemon events to an external HTTP(S) endpoint.
sdk
cgo command
regtestutil
Package regtestutil exposes a small fixture for spinning up an in-process registry server (and dialed client) for daemon-side tests.
Package regtestutil exposes a small fixture for spinning up an in-process registry server (and dialed client) for daemon-side tests.
tools
check-layers command
Command check-layers verifies the layered architecture.
Command check-layers verifies the layered architecture.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL