ActPass Python SDK — signed action authorization for AI agents (zero dependencies)
Project description
ActPass Python SDK
Zero-dependency (stdlib-only) Python client for the ActPass runtime, mirroring
the TypeScript @actpass/sdk surface (spec §14).
Install
pip install actpass
Usage (§14.2)
from actpass import create_actpass
# The API key IS your identity — apk_… (gateway/agent) or apdv_… (developer);
# the server resolves tenant + agent from it.
client = create_actpass(api_key="apk_...")
# Preflight + guarded execution in one call. execute_fn runs ONLY on allow/warn.
result = client.guard(
goal="resolve_refund_request",
tool="stripe.refund.create",
resource="stripe:charge:ch_123",
args={"chargeId": "ch_123", "amount": 14900, "currency": "USD"},
execute_fn=lambda ctx: stripe.Refund.create(charge="ch_123", amount=14900),
)
print(result["decision"]["decision"]) # allow | deny | require_approval | ...
Other methods: preflight(), issue_passport(), verify_passport(),
revoke_passport(), record_evidence(), plus hash_payload() /
sign_payload() helpers for evidence hashing.
Behavior
- Fails closed: any non-2xx (except 401/403, which return the parsed body)
raises
ActPassError; a network failure raises too.guard()only executes your function onallow/warn. - Tenant is a hint: sent as
x-actpass-tenant; the gateway resolves the authoritative tenant from the authenticated principal (§11.2). - Zero dependencies:
urllib/json/hmac/hashlibfrom the stdlib only.
Test
cd packages/sdk-python && python -m unittest discover -s tests
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 actpass-1.1.2.tar.gz.
File metadata
- Download URL: actpass-1.1.2.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1fdea34fdd4069b2d66cc82423d24ad84fe69c467057b50ba0ed45b27758f6b0
|
|
| MD5 |
ce41b649ec284d403a165f3a5f3ac473
|
|
| BLAKE2b-256 |
ae6f678fb4b723e47327f8ebf8a2a9ccffa3bbb41c411a461d14c9210fe42f97
|
File details
Details for the file actpass-1.1.2-py3-none-any.whl.
File metadata
- Download URL: actpass-1.1.2-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d16dcaf4f089179baddc09a51ec0be4a2f5ef9b28870734ad4aa1059f0f2cd66
|
|
| MD5 |
8035410fb5ddeacc1165f57fb6e2adbe
|
|
| BLAKE2b-256 |
cb5f9eb47e60914f27f16c0234e52e8967a889a5a408781054b27c0ac54d5655
|