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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c1a15b709462a377c75a61e34861f4fef894a08a0884dc22895b12637c6c280
|
|
| MD5 |
510d3e0d87270215884786afe02b23c6
|
|
| BLAKE2b-256 |
4f8974c2ba89ca2600e3ddee0173805f1cc7f3dd380f046dd36fa8d8c3d30384
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f65f4d79fc136c0cf38b0dec5d4094067c2f0363d8c99eacbde38e295083e934
|
|
| MD5 |
23472d3115d5d7e39ff935decb647078
|
|
| BLAKE2b-256 |
88ffa4e5f37947947876e06604a01b18205f469c9f8dd23a8ef7f5ba58c028c7
|