openleash-sdk (Python)
Python SDK for OpenLeash — authorization + proof sidecar for AI agents.
Install
pip install openleash-sdk
Quick start
from openleash import (
authorize,
generate_ed25519_keypair,
sign_request,
verify_proof_offline,
)
# Generate a keypair for your agent
keypair = generate_ed25519_keypair()
print(keypair["public_key_b64"])
# Authorize an action (async)
result = await authorize(
openleash_url="http://127.0.0.1:8787",
agent_id="my-agent",
private_key_b64=keypair["private_key_b64"],
action={
"action_type": "purchase",
"payload": {"amount_minor": 500, "currency": "USD"},
},
)
# Verify a proof token offline
verification = verify_proof_offline(
token=result["proof_token"],
public_keys=[{"kid": "key-id", "public_key_b64": keypair["public_key_b64"]}],
)
API
| Function | Async | Description |
|---|---|---|
generate_ed25519_keypair() |
No | Generate Ed25519 keypair (DER SPKI/PKCS8, base64) |
sign_request(...) |
No | Sign an HTTP request with Ed25519 |
redeem_agent_invite(...) |
Yes | Register using an invite URL (recommended) |
registration_challenge(...) |
Yes | Request a registration challenge |
register_agent(...) |
Yes | Register an agent via challenge-response |
authorize(...) |
Yes | Send a signed authorization request |
verify_proof_online(...) |
Yes | Verify a proof token via the server |
verify_proof_offline(...) |
No | Verify a PASETO v4.public token locally |
Requirements
- Python 3.10+
- Dependencies:
cryptography,pyseto,httpx
License
Apache-2.0
Metadata
Release files for openleash-sdk 0.3.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 | Actions |
|---|---|---|---|---|
| openleash_sdk-0.3.0.tar.gz | 8.1 kB | With provenance | Details for openleash_sdk-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| openleash_sdk-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for openleash_sdk-0.3.0-py3-none-any.whl |
Total release size: 14.5 kB
Release files / openleash_sdk-0.3.0.tar.gz
| Download URL | openleash_sdk-0.3.0.tar.gz |
|---|---|
| Size | 8.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ef8ca08dc8b5f9083339677fa4476910f581b26f6021776d5164227270b1614d
|
|
BLAKE2b-256 checksum How to use checksums |
ddfa08ef43d296c76cf454bcc386a46979509137cb1dd5467a891ce95477f4ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 6, 2026.
Transparency logRelease files / openleash_sdk-0.3.0-py3-none-any.whl
| Download URL | openleash_sdk-0.3.0-py3-none-any.whl |
|---|---|
| Size | 6.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
abaa6c0aa8898ed28df312e08d55eb6f18f8efdff38c679cfb3d5053029e7241
|
|
BLAKE2b-256 checksum How to use checksums |
4d904b1701ed306081c5b3cc07f94d3ac832bba3f54ec83e0fc795aac49ea7ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 6, 2026.
Transparency logSecurity for openleash-sdk 0.3.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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for openleash_sdk-0.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 6, 2026.
Transparency logA 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.