Python SDK for OpenLeash — authorization + proof sidecar for AI agents
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openleash_sdk-0.3.0.tar.gz.
File metadata
- Download URL: openleash_sdk-0.3.0.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef8ca08dc8b5f9083339677fa4476910f581b26f6021776d5164227270b1614d
|
|
| MD5 |
f15a31a49191be586c9c0006cce1958c
|
|
| BLAKE2b-256 |
ddfa08ef43d296c76cf454bcc386a46979509137cb1dd5467a891ce95477f4ee
|
Provenance
The following attestation bundles were made for openleash_sdk-0.3.0.tar.gz:
Publisher:
ci.yml on openleash/openleash
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openleash_sdk-0.3.0.tar.gz -
Subject digest:
ef8ca08dc8b5f9083339677fa4476910f581b26f6021776d5164227270b1614d - Sigstore transparency entry: 1243514581
- Sigstore integration time:
-
Permalink:
openleash/openleash@7bc1788cc3fec5b7c245e59eb346c7e9175960be -
Branch / Tag:
refs/tags/v0.11.0 - Owner: https://github.com/openleash
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@7bc1788cc3fec5b7c245e59eb346c7e9175960be -
Trigger Event:
push
-
Statement type:
File details
Details for the file openleash_sdk-0.3.0-py3-none-any.whl.
File metadata
- Download URL: openleash_sdk-0.3.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
abaa6c0aa8898ed28df312e08d55eb6f18f8efdff38c679cfb3d5053029e7241
|
|
| MD5 |
4d3c328aaa14710b1322c6fd52d639b0
|
|
| BLAKE2b-256 |
4d904b1701ed306081c5b3cc07f94d3ac832bba3f54ec83e0fc795aac49ea7ef
|
Provenance
The following attestation bundles were made for openleash_sdk-0.3.0-py3-none-any.whl:
Publisher:
ci.yml on openleash/openleash
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openleash_sdk-0.3.0-py3-none-any.whl -
Subject digest:
abaa6c0aa8898ed28df312e08d55eb6f18f8efdff38c679cfb3d5053029e7241 - Sigstore transparency entry: 1243514582
- Sigstore integration time:
-
Permalink:
openleash/openleash@7bc1788cc3fec5b7c245e59eb346c7e9175960be -
Branch / Tag:
refs/tags/v0.11.0 - Owner: https://github.com/openleash
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@7bc1788cc3fec5b7c245e59eb346c7e9175960be -
Trigger Event:
push
-
Statement type: