add-mesh
Python reference implementation of the ADD Protocol (Agent Discovery, Delegation & Trust) — an open overlay for the Agentic Web that adds discovery, capability delegation, and trust attestation on top of A2A and MCP.
Specifications live in spec/; the normative cross-language
conformance vectors live in test-vectors/.
Install
pip install add-mesh
Usage
from add_mesh.core import generate_signer, sign_envelope, verify_envelope
key_pair, signer = generate_signer()
print(key_pair.did) # did:key:z6Mk...
envelope = sign_envelope(signer, "add/delegation", {
"aud": "did:key:z6MkSubAgent...",
"maxSpendUsd": 5,
"ttl": 1200,
})
result = verify_envelope(envelope)
print(result.issuer, result.payload)
Verification establishes only that the holder of iss's key signed this
payload at the claimed time. It says nothing about whether they were entitled
to what the payload requests — that is the delegation layer's job.
Signers
sign_envelope takes any object satisfying the Signer protocol, so an agent
identity can live in a KMS or HSM rather than in local memory:
from add_mesh.core import Signer
class KmsSigner:
@property
def did(self) -> str:
return "did:key:z6Mk..."
def sign(self, message: bytes) -> bytes:
return my_kms.sign(key_id, message)
Notes on parity with the TypeScript implementation
The wire format is identical and validated by a bidirectional interop harness.
The APIs differ in one deliberate, idiomatic way: these functions are
synchronous, because signing is a microsecond-scale CPU operation and
cryptography exposes it synchronously. The TypeScript API is async because
WebCrypto and remote KMS clients are async there.
Two portability details are handled internally and are worth knowing about if you implement ADD in another language:
- RFC 8785 mandates ECMAScript number formatting, which differs from Python's
repr(1e-7not1e-07,1not1.0,100000000000000000000not1e+20). - RFC 8785 orders object keys by UTF-16 code unit, not code point. These
disagree for non-BMP characters, so a naive
sorted()produces a different signature over the same payload.
Development
pip install -e ".[dev]"
pytest
License
Apache-2.0.
Metadata
Release files for add-mesh 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| add_mesh-0.1.0.tar.gz | 77.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| add_mesh-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 158.8 kB
Release files / add_mesh-0.1.0.tar.gz
| Download URL | add_mesh-0.1.0.tar.gz |
|---|---|
| Size | 77.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f4871468afa9f431ff0588e0935e4ea4a74cd9f88f31cb9d69960f19de0d5fe9
|
|
BLAKE2b-256 checksum How to use checksums |
a57e31460915e08eff9cf59262f01c0a915131a37e796693cc9f94a5d510718f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Release files / add_mesh-0.1.0-py3-none-any.whl
| Download URL | add_mesh-0.1.0-py3-none-any.whl |
|---|---|
| Size | 81.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f4236530a2efc2216aaf4be91204cc4f3ee954bb97b937f329f19fcf5590ab49
|
|
BLAKE2b-256 checksum How to use checksums |
45aa930acef32c8004a4117ceac92cb88e0ec92fe19653a2e7a22903abc7ea36
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Security for add-mesh 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.