Skip to main content

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 on allow/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/hashlib from the stdlib only.

Test

cd packages/sdk-python && python -m unittest discover -s tests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

actpass-1.1.2.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

actpass-1.1.2-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

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

Hashes for actpass-1.1.2.tar.gz
Algorithm Hash digest
SHA256 1fdea34fdd4069b2d66cc82423d24ad84fe69c467057b50ba0ed45b27758f6b0
MD5 ce41b649ec284d403a165f3a5f3ac473
BLAKE2b-256 ae6f678fb4b723e47327f8ebf8a2a9ccffa3bbb41c411a461d14c9210fe42f97

See more details on using hashes here.

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

Hashes for actpass-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d16dcaf4f089179baddc09a51ec0be4a2f5ef9b28870734ad4aa1059f0f2cd66
MD5 8035410fb5ddeacc1165f57fb6e2adbe
BLAKE2b-256 cb5f9eb47e60914f27f16c0234e52e8967a889a5a408781054b27c0ac54d5655

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page