Python SDK for Coproduct A2A — provable-coordination extension client with bearer-token minting, manifest signature verification, and framework adapters (LangGraph, CrewAI).
Project description
coproduct-a2a — Python SDK for Coproduct A2A
Client for the coproduct.provable-coordination.v1 A2A extension. Mints bearer tokens, calls A2A methods, verifies the server's signed provenance manifest on every response.
Why this exists
An A2A agent that declares the coproduct.provable-coordination.v1 extension in its Agent Card gets three guarantees added to every response:
- Provenance trail — signed lineage back to inputs, acting agent, capability
- Capability envelope — calls are bounded by declared capabilities
- Cohort witnesses — Pa.Parallel I1–I7 invariants attested on every call
This SDK is the 5-line integration that makes those guarantees visible to Python agents.
Install
pip install coproduct-a2a
# or, with uv:
uv add coproduct-a2a
Quickstart — LangGraph
from coproduct_a2a import Client, verify_manifest
client = Client.from_env() # reads COPRODUCT_A2A_{ENDPOINT,PUBLIC_KEY,TOKEN}
response = client.send_message("hello, agent!")
manifest = verify_manifest(response, client.server_public_key)
print(f"Task {response['result']['id']} at rev {manifest['hydrate_log_rev']}")
That's it. Five lines. The verify_manifest call raises InvalidSignature if the server returned anything the declared pubkey didn't sign.
LangGraph adapter
from langgraph.graph import StateGraph
from coproduct_a2a.langgraph import ProvableCoordinationNode
graph = StateGraph(AgentState)
graph.add_node("agent", ProvableCoordinationNode(client))
The node wraps the message/send call; incoming state gets mapped to A2A params; the response's manifest is attached to the outgoing state as state.provenance_manifest.
CrewAI wrapper
from crewai import Agent
from coproduct_a2a.crewai import wrap_agent_with_provenance
agent = Agent(role="Reporter", goal="Summarize the workspace")
wrapped = wrap_agent_with_provenance(agent, client)
Every tool invocation threads through the provable-coordination extension; the crew log gains signed manifests it can audit.
Manifest fields
The verified manifest dict carries:
| Field | Type | Meaning |
|---|---|---|
manifest_version |
"1" |
Pinned to this extension URI |
provenance_trail |
list[ProvenanceStep] |
Ordered steps citing data sources |
capability_envelope_sha |
str |
SHA-256 of the declared envelope |
cohort_witnesses |
list[CohortWitness] |
Pa.Parallel I1–I7 attestations |
hydrate_log_rev |
int |
Monotonic server-state revision |
signature |
str |
ed25519:<base64url> over JCS-canonicalized payload |
Reference deployment
coproduct.fly.dev is a live instance running the A2A server this SDK talks to. Point COPRODUCT_A2A_ENDPOINT=https://coproduct.fly.dev/a2a to integration-test against it. The /aha page on that host is a browser-based tamper playground for the same manifest verification this SDK does in Python.
See also
coproduct-a2a— Rust A2A server (the reference this SDK verifies against)coproduct-demo-a2a-langgraph— LangGraph state graph using this SDK end-to-endcoproduct-demo-ragkit·coproduct-demo-taskhub— 5-agent companion demoscoproduct.provable-coordination.v1spec
Releasing
Releases are published to PyPI via GitHub Actions trusted-publisher OIDC — no API token stored in this repo. To cut a release:
- Bump
[project].versioninpyproject.toml. - Commit + push to
main. - Tag with
v<version>and push the tag:git tag v0.2.0 && git push origin v0.2.0. - Create a GitHub Release from that tag (via the web UI or
gh release create v0.2.0 --generate-notes).
The publish workflow builds dist/, smoke-tests the wheel, and uploads to PyPI. See .github/workflows/publish.yml.
First-time setup: PyPI trusted-publisher config must exist. See the pypi GitHub Actions environment for the configuration.
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
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 coproduct_a2a-0.1.0.tar.gz.
File metadata
- Download URL: coproduct_a2a-0.1.0.tar.gz
- Upload date:
- Size: 13.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65c9e2d91f8a6720bf55a9c427ff5306ff22f9058294c54a35bcdbfd0bf881de
|
|
| MD5 |
f1c397747ea3ce778748696fd6ec0cf6
|
|
| BLAKE2b-256 |
bee3f63a65f58ba60593943db6696a9b1df71e689f6747a5df71cabc11d28a1f
|
Provenance
The following attestation bundles were made for coproduct_a2a-0.1.0.tar.gz:
Publisher:
publish.yml on coproduct-opensource/coproduct-a2a-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
coproduct_a2a-0.1.0.tar.gz -
Subject digest:
65c9e2d91f8a6720bf55a9c427ff5306ff22f9058294c54a35bcdbfd0bf881de - Sigstore transparency entry: 1360257158
- Sigstore integration time:
-
Permalink:
coproduct-opensource/coproduct-a2a-python@b0cf8315b9339a30f9e5609485ab96354183f618 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/coproduct-opensource
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b0cf8315b9339a30f9e5609485ab96354183f618 -
Trigger Event:
release
-
Statement type:
File details
Details for the file coproduct_a2a-0.1.0-py3-none-any.whl.
File metadata
- Download URL: coproduct_a2a-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09ee431f21240e091cabe44a50cebdeae755a7213f01fb06e240c55157c309fe
|
|
| MD5 |
b2d916fd3edad02bffbbbbbef5059518
|
|
| BLAKE2b-256 |
dbeb17ab6dc16cfcb0bc80d155c2d4361cd1173a0adb8e77b3d788163659b563
|
Provenance
The following attestation bundles were made for coproduct_a2a-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on coproduct-opensource/coproduct-a2a-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
coproduct_a2a-0.1.0-py3-none-any.whl -
Subject digest:
09ee431f21240e091cabe44a50cebdeae755a7213f01fb06e240c55157c309fe - Sigstore transparency entry: 1360257221
- Sigstore integration time:
-
Permalink:
coproduct-opensource/coproduct-a2a-python@b0cf8315b9339a30f9e5609485ab96354183f618 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/coproduct-opensource
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b0cf8315b9339a30f9e5609485ab96354183f618 -
Trigger Event:
release
-
Statement type: