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.9.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.9-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.9-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.9-py3-none-macosx_11_0_x86_64.whl (23.5 MB view details)

Uploaded Python 3macOS 11.0+ x86-64

pilotprotocol-1.13.9-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.9.tar.gz.

File metadata

  • Download URL: pilotprotocol-1.13.9.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.9.tar.gz
Algorithm Hash digest
SHA256 3ab780d94d3773f4394d5fcee49d9832de91db46c2168c132f201071711b58f6
MD5 4f7aaf65b6f20b19f08b334005201895
BLAKE2b-256 26039dfcf671b44392f65e7d55d46693f7fe7665efa1d134157bd651d80ae69d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pilotprotocol-1.13.9-py3-none-manylinux_2_34_x86_64.manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 d3b1b6d52640a35ea6dea15dd1ea2e0609513a2c7a945fd2d28ba1ba711d0ffb
MD5 5939f7df389a12b328adeab35eaf6f56
BLAKE2b-256 6de096e4af6034b92a9223daeffcbafc4ae63e3f34da96b756862b228584b7cd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pilotprotocol-1.13.9-py3-none-manylinux_2_34_aarch64.manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 bf7c932754658d2e7a2877ece2dd5db35d97c6f65a728f2dcc61ee42b66b23ab
MD5 481b3f4407dae05acada7e55c4d805be
BLAKE2b-256 79a2fe9bee23803c0f0e245a0c2b3a1ad213ec1d3e3f6e9c0fadd2cd18930605

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pilotprotocol-1.13.9-py3-none-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 d94ad9836e531755183b16d72de44b5fb4388f94812da02d84ae6b584fc01d23
MD5 f8bf5dc8aff41a520edb4a3b05761497
BLAKE2b-256 b4f0681c35b54f6e239e2eff42d90f7729fd12e4f45298b30cec314f0fa914fa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pilotprotocol-1.13.9-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 04ae887ae433710d72c5b1d4039e5573176cba01096ad1ddbab00aad8cfbbafe
MD5 9016a6e6b7672e1903bcb241de4e23fa
BLAKE2b-256 d31b4fc0c9c9669427f22d98c48e32ba551dc5a0846afc5907055b5753511fe8

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.13.9 This release

5 files

1.13.8

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