Skip to main content

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

Releasing

Releases are published to PyPI via GitHub Actions trusted-publisher OIDC — no API token stored in this repo. To cut a release:

  1. Bump [project].version in pyproject.toml.
  2. Commit + push to main.
  3. Tag with v<version> and push the tag: git tag v0.2.0 && git push origin v0.2.0.
  4. 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


Download files

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

Source Distribution

coproduct_a2a-0.1.0.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

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

coproduct_a2a-0.1.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

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

Hashes for coproduct_a2a-0.1.0.tar.gz
Algorithm Hash digest
SHA256 65c9e2d91f8a6720bf55a9c427ff5306ff22f9058294c54a35bcdbfd0bf881de
MD5 f1c397747ea3ce778748696fd6ec0cf6
BLAKE2b-256 bee3f63a65f58ba60593943db6696a9b1df71e689f6747a5df71cabc11d28a1f

See more details on using hashes here.

Provenance

The following attestation bundles were made for coproduct_a2a-0.1.0.tar.gz:

Publisher: publish.yml on coproduct-opensource/coproduct-a2a-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for coproduct_a2a-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 09ee431f21240e091cabe44a50cebdeae755a7213f01fb06e240c55157c309fe
MD5 b2d916fd3edad02bffbbbbbef5059518
BLAKE2b-256 dbeb17ab6dc16cfcb0bc80d155c2d4361cd1173a0adb8e77b3d788163659b563

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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