Skip to main content

Pilot Protocol — Python SDK

ci codecov License: AGPL-3.0

PyPI version Python versions

Python client for the Pilot Protocol overlay network. Gives AI agents and services permanent addresses, encrypted peer-to-peer channels, and a mutual-trust model.

The SDK calls into a pre-built libpilot shared library (.so / .dylib / .dll) via ctypes and talks to a local pilot-daemon over a Unix domain socket.

Install

pip install pilotprotocol

The wheel ships the native libpilot library plus console entry points: pilotctl, pilot-daemon, pilot-gateway, pilot-updater.

Supported platforms: Linux (x86_64, arm64), macOS (Intel, Apple Silicon). Windows is experimental.

Quick start

Make sure a daemon is running:

pilotctl daemon start --hostname my-agent

Then, from your code:

from pilotprotocol import Driver, PilotError

try:
    with Driver() as d:
        info = d.info()
        print(f"address={info['address']}")

        d.set_hostname("my-python-agent")

        peer = d.resolve_hostname("other-agent")
        with d.dial(f"{peer['address']}:1000") as conn:
            conn.write(b"hello")
            print(conn.read(4096))
except (PilotError, FileNotFoundError) as e:
    # Raised when libpilot isn't installed or no daemon is running.
    # Start one with: pilotctl daemon start --hostname my-agent
    print(f"pilot daemon unavailable: {e}")

API overview

Driver is the connection to the local daemon. Highlights:

  • Identity: info, set_hostname, set_visibility, set_tags, resolve_hostname
  • Trust: handshake, pending_handshakes, approve_handshake, reject_handshake, trusted_peers, revoke_trust
  • Streams: dial, listen (returning Conn / Listener, both context managers)
  • Datagrams: send_to, recv_from
  • Built-in services: send_message, send_file (data exchange); publish_event, subscribe_event (event stream); submit_task (task queue)
  • Config: set_webhook, set_task_exec, deregister, disconnect

All daemon-side errors are raised as PilotError.

from pilotprotocol import Driver, PilotError

try:
    with Driver() as d:
        d.resolve_hostname("unknown")
except (PilotError, FileNotFoundError) as e:
    print(f"error: {e}")

Native library lookup

The SDK searches for libpilot.{so,dylib,dll} in this order:

  1. PILOT_LIB_PATH environment variable (explicit path)
  2. The installed package directory (bundled wheel layout)
  3. ~/.pilot/bin/ (entry-point install location)
  4. <project_root>/bin/ (development layout)
  5. System library search path

Examples

See examples/ for runnable programs:

  • basic_usage.py — connection, identity, trust
  • data_exchange_demo.py — messages, files, JSON
  • event_stream_demo.py — pub/sub
  • task_submit_demo.py — task delegation
  • pydantic_ai_agent.py / pydantic_ai_multiagent.py — PydanticAI integration

Testing

python -m pytest tests/ -v

Links

License

AGPL-3.0-or-later. See LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pilotprotocol-1.13.8.tar.gz (22.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pilotprotocol-1.13.8-py3-none-manylinux_2_34_x86_64.manylinux_2_35_x86_64.whl (22.9 MB view details)

Uploaded Python 3manylinux: glibc 2.34+ x86-64manylinux: glibc 2.35+ x86-64

pilotprotocol-1.13.8-py3-none-manylinux_2_34_aarch64.manylinux_2_35_aarch64.whl (20.7 MB view details)

Uploaded Python 3manylinux: glibc 2.34+ ARM64manylinux: glibc 2.35+ ARM64

pilotprotocol-1.13.8-py3-none-macosx_11_0_x86_64.whl (23.5 MB view details)

Uploaded Python 3macOS 11.0+ x86-64

pilotprotocol-1.13.8-py3-none-macosx_11_0_arm64.whl (21.3 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file pilotprotocol-1.13.8.tar.gz.

File metadata

  • Download URL: pilotprotocol-1.13.8.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for pilotprotocol-1.13.8.tar.gz
Algorithm Hash digest
SHA256 b6c94e45e6c30bd1232ef8e165a4cb5431bebe3bd23856b3342d71f360186286
MD5 07d9ae5501c6b99d37fc54322a92aa28
BLAKE2b-256 2d36437b4b3bad9abddb7406e0a44856a85ad8c2950e861310edcbe9ebd90aa9

See more details on using hashes here.

File details

Details for the file pilotprotocol-1.13.8-py3-none-manylinux_2_34_x86_64.manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for pilotprotocol-1.13.8-py3-none-manylinux_2_34_x86_64.manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 940c23dc87e7a070e73ae051e438984abd4687a74a4ea3715040607988979352
MD5 53b427bffe09f65d0dfec1651bca0d57
BLAKE2b-256 15f4aa82860f30243e9b031c9df5b3c2a1b74cac36d57922902b7ab7ef756ceb

See more details on using hashes here.

File details

Details for the file pilotprotocol-1.13.8-py3-none-manylinux_2_34_aarch64.manylinux_2_35_aarch64.whl.

File metadata

File hashes

Hashes for pilotprotocol-1.13.8-py3-none-manylinux_2_34_aarch64.manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 adfbadff625ea5c9164dc8da0b17ba902a745f9e3340901df65e2c9e450f7a4f
MD5 f371b02871fa236fb4c5f8cae0ba1960
BLAKE2b-256 6eccba566382e36ec47947656359dce2bc1c4eafda314bc68236c84871c25722

See more details on using hashes here.

File details

Details for the file pilotprotocol-1.13.8-py3-none-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for pilotprotocol-1.13.8-py3-none-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 c96f5889265147ea3ee0275aaf3f164e6c2b5ba63d843cc7a464349d928b377a
MD5 ece8cae8600e21355f573c39bcf21e94
BLAKE2b-256 09171c78d01b239762dccf7c3b2f5284bedecb892c4dae8ad9b8d43d509e891a

See more details on using hashes here.

File details

Details for the file pilotprotocol-1.13.8-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pilotprotocol-1.13.8-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 193b509f87084f4786235fae0d2d2835eff7e219055caa80be68531fcbff5445
MD5 358c1ecf4f634acde07f19a458cbe0ec
BLAKE2b-256 72807e1d8ba28b5836ab31ffd009284e2ae78bb82afa496d360e24ddd528e92b

See more details on using hashes here.

Release history Release notifications | RSS feed

1.13.9

5 files

This release

1.13.8 This release

5 files

1.13.7

5 files

1.13.6

3 files

1.13.5

3 files

1.13.4

3 files

1.13.3

3 files

1.13.2

3 files

1.13.1

3 files

1.13.0

3 files

1.12.8

3 files

1.12.7

3 files

1.12.6

3 files

1.12.5

3 files

1.12.4

3 files

1.12.3

3 files

1.10.5

3 files

1.10.4

3 files

1.10.3

3 files

1.10.2

3 files

1.10.1

3 files

1.10.0

3 files

1.9.1

3 files

1.7.2

3 files

0.1.2

3 files

0.1.1

3 files

0.1.0

3 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page