Skip to main content

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

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.3.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.3-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file actpass-1.1.3.tar.gz.

File metadata

  • Download URL: actpass-1.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 13004e67e8b9a8648729674c2d932d8d8cd2b9fd98f0f60bb6f413f3a3f0353d
MD5 48d8d82bf005c2cef4e3555178e23be2
BLAKE2b-256 e8a7ac45ba3acac77b317645507ec9e510ac5a3c3085640535bf5999f25b47de

See more details on using hashes here.

File details

Details for the file actpass-1.1.3-py3-none-any.whl.

File metadata

  • Download URL: actpass-1.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9f2c82fbb790df09f72b5cfe26a5b4290b96063b2ab4ebdfc059f5978e38eb28
MD5 d3431322a909b6d4603ed09a8a65d562
BLAKE2b-256 d06c8b01367c50b2dd45a0a5bd5f9706ee3f5f609be4deac0644c2ec34101259

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.1.3 This release

2 files

1.1.2

2 files

1.1.0

2 files

Supported by

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