Pilot Protocol — Python SDK
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(returningConn/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:
PILOT_LIB_PATHenvironment variable (explicit path)- The installed package directory (bundled wheel layout)
~/.pilot/bin/(entry-point install location)<project_root>/bin/(development layout)- System library search path
Examples
See examples/ for runnable programs:
basic_usage.py— connection, identity, trustdata_exchange_demo.py— messages, files, JSONevent_stream_demo.py— pub/subtask_submit_demo.py— task delegationpydantic_ai_agent.py/pydantic_ai_multiagent.py— PydanticAI integration
Testing
python -m pytest tests/ -v
Links
- Homepage: https://pilotprotocol.network
- Issues: https://github.com/pilot-protocol/sdk-python/issues
- Node.js SDK:
pilotprotocolon npm - Swift SDK:
sdk-swift
License
AGPL-3.0-or-later. See LICENSE.
Metadata
Release files for pilotprotocol 1.18.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pilotprotocol-1.18.0.tar.gz | 22.3 kB | Without provenance | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| pilotprotocol-1.18.0-py3-none-manylinux_2_34_x86_64.manylinux_2_35_x86_64.whl | Python 3 | none | Linux glibc 2.34+ x86-64, Linux glibc 2.35+ x86-64 | Details |
| pilotprotocol-1.18.0-py3-none-manylinux_2_34_aarch64.manylinux_2_35_aarch64.whl | Python 3 | none | Linux glibc 2.35+ ARM64, Linux glibc 2.34+ ARM64 | Details |
| pilotprotocol-1.18.0-py3-none-macosx_11_0_x86_64.whl | Python 3 | none | macOS 11.0+ x86-64 | Details |
| pilotprotocol-1.18.0-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details |
Total release size: 94.8 MB
Release files / pilotprotocol-1.18.0.tar.gz
| Download URL | pilotprotocol-1.18.0.tar.gz |
|---|---|
| Size | 22.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b2f910ee6771d3fa11c0c32e23909c6258c113b10f19e3b3e73af70144692a8b
|
|
BLAKE2b-256 checksum How to use checksums |
fd1d8979a22791a2074477e10ceff17bae679be8f064dd0a6495f897440108da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / pilotprotocol-1.18.0-py3-none-manylinux_2_34_x86_64.manylinux_2_35_x86_64.whl
| Download URL | pilotprotocol-1.18.0-py3-none-manylinux_2_34_x86_64.manylinux_2_35_x86_64.whl |
|---|---|
| Size | 24.5 MB |
| Tags | Linux glibc 2.34+ x86-64 Linux glibc 2.35+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
08c19477e96934097313c95cb6b018fc32e328c20f5efbff9353e2e82db4a319
|
|
BLAKE2b-256 checksum How to use checksums |
cb0a9261cb51009e1cf7024741f6ccd09583061d0445ae30ea2ad5b86420d37e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / pilotprotocol-1.18.0-py3-none-manylinux_2_34_aarch64.manylinux_2_35_aarch64.whl
| Download URL | pilotprotocol-1.18.0-py3-none-manylinux_2_34_aarch64.manylinux_2_35_aarch64.whl |
|---|---|
| Size | 22.2 MB |
| Tags | Linux glibc 2.34+ ARM64 Linux glibc 2.35+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
9cd13bf616d4491b594c6ab6994c53ebd34dd20f93fb8d9bb3311d695c705a4f
|
|
BLAKE2b-256 checksum How to use checksums |
a00c5b6d13d10e31b0f3eaca0a1c7e8bfa3176b42d66e07a5b64d8663041485b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / pilotprotocol-1.18.0-py3-none-macosx_11_0_x86_64.whl
| Download URL | pilotprotocol-1.18.0-py3-none-macosx_11_0_x86_64.whl |
|---|---|
| Size | 25.2 MB |
| Tags | Python 3 macOS 11.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
e825853f92628f8fb170afd4d3b09148c08c43c4fb593e900fc5a6af1b106ce4
|
|
BLAKE2b-256 checksum How to use checksums |
99575a42c59a6f4bf3c0bccd6920d6a882ca2bf872d0c45bb87dfb6107d69cc6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / pilotprotocol-1.18.0-py3-none-macosx_11_0_arm64.whl
| Download URL | pilotprotocol-1.18.0-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 22.8 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
7b9141b72664d5391f4d076d80bef23522e1f9f48077d7f8ff964962249b60b5
|
|
BLAKE2b-256 checksum How to use checksums |
78391619953abecd18418eecbc68f4b67ba3762617b2bab27383b6fc368b8b16
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Security for pilotprotocol 1.18.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.