Skip to main content

A2SPA Python Payload Helpers

Helper-only Python package for building, hashing, and signing A2SPA runtime authorization payloads.

The verifier remains server-side. This package does not authorize actions by itself.

Install

pip install a2spa

For ML-DSA signing support where the optional wheel is available:

pip install "a2spa[pq]"

Basic Usage

from a2spa import build_payload_fields, build_signed_request, policy_input

payload = build_payload_fields(
    agent_id="user-123_sender",
    target_agent_id="user-123_receiver",
    input_data=policy_input(action="deliver", workflow_scope="messages:deliver"),
)

request_body = build_signed_request(private_key_text, payload)

Send request_body to POST /api/verify_payload with your account API key in the x-api-key header.

Helper Functions

  • build_payload_fields(...)
  • policy_input(...)
  • policy_template(...)
  • state_continuity_claim(...)
  • canonicalize_payload(...)
  • compute_payload_hash(...)
  • finalize_payload(...)
  • sign_payload(...)
  • build_signed_request(...)
  • build_debug_snapshot(...)

Security Boundary

Private keys must stay in a secret manager, server environment, or deployment secret. Do not paste private keys into chats, logs, client-side code, or source control.

Download files

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

Source Distribution

a2spa-0.1.1.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

a2spa-0.1.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file a2spa-0.1.1.tar.gz.

File metadata

  • Download URL: a2spa-0.1.1.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.9

File hashes

Hashes for a2spa-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6c1a15b709462a377c75a61e34861f4fef894a08a0884dc22895b12637c6c280
MD5 510d3e0d87270215884786afe02b23c6
BLAKE2b-256 4f8974c2ba89ca2600e3ddee0173805f1cc7f3dd380f046dd36fa8d8c3d30384

See more details on using hashes here.

File details

Details for the file a2spa-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: a2spa-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.9

File hashes

Hashes for a2spa-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f65f4d79fc136c0cf38b0dec5d4094067c2f0363d8c99eacbde38e295083e934
MD5 23472d3115d5d7e39ff935decb647078
BLAKE2b-256 88ffa4e5f37947947876e06604a01b18205f469c9f8dd23a8ef7f5ba58c028c7

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 Sentry Error logging StatusPage Status page