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: the server resolves tenant + agent from it.
client = create_actpass(api_key="sk_...")

# 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.0.tar.gz (6.8 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.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: actpass-1.1.0.tar.gz
  • Upload date:
  • Size: 6.8 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.0.tar.gz
Algorithm Hash digest
SHA256 bdfb73aaab1346645365538f7b146b0424e3f121eaba97d31fbffb72ec5475f5
MD5 e476f093e0cd0f9cd8e3eeb1140db9b4
BLAKE2b-256 e3b7c7164c2bb4dc45bb6faa4c9e8e0608d44032f46be40a0dc046ef0f942f75

See more details on using hashes here.

File details

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

File metadata

  • Download URL: actpass-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.2 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d474ffe181182ef19224a1ed5e6a1396e10c1a94d1a7b822e85fa5c19dd18fa2
MD5 759e2db4acfda7cf05dbdbbef45fdfb6
BLAKE2b-256 079fbb9812ce179638873d20e10cc44524a3777d1cc2f399d7839f49733b34e5

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