vouch-a2a 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- vouch_a2a-0.1.0/PKG-INFO +74 -0
- vouch_a2a-0.1.0/README.md +55 -0
- vouch_a2a-0.1.0/pyproject.toml +30 -0
- vouch_a2a-0.1.0/setup.cfg +4 -0
- vouch_a2a-0.1.0/src/vouch_a2a/__init__.py +11 -0
- vouch_a2a-0.1.0/src/vouch_a2a.egg-info/PKG-INFO +74 -0
- vouch_a2a-0.1.0/src/vouch_a2a.egg-info/SOURCES.txt +9 -0
- vouch_a2a-0.1.0/src/vouch_a2a.egg-info/dependency_links.txt +1 -0
- vouch_a2a-0.1.0/src/vouch_a2a.egg-info/requires.txt +4 -0
- vouch_a2a-0.1.0/src/vouch_a2a.egg-info/top_level.txt +1 -0
- vouch_a2a-0.1.0/tests/test_smoke.py +69 -0
vouch_a2a-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vouch-a2a
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Bind A2A (Agent2Agent) Agent Cards to a Vouch identity for verifiable agent-to-agent trust.
|
|
5
|
+
Author: Ramprasad Gaddam
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://vouch-protocol.com
|
|
8
|
+
Project-URL: Source, https://github.com/vouch-protocol/vouch
|
|
9
|
+
Keywords: a2a,agent2agent,vouch,ai-agents,verifiable-credentials,identity
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Topic :: Security :: Cryptography
|
|
14
|
+
Requires-Python: >=3.9
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
Requires-Dist: vouch-protocol>=1.6.0
|
|
17
|
+
Provides-Extra: dev
|
|
18
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
19
|
+
|
|
20
|
+
# vouch-a2a
|
|
21
|
+
|
|
22
|
+
Bind [A2A](https://a2a-protocol.org/) (Agent2Agent) Agent Cards to a
|
|
23
|
+
[Vouch](https://vouch-protocol.com) identity, so two agents can establish trust
|
|
24
|
+
before they collaborate.
|
|
25
|
+
|
|
26
|
+
A2A standardized how agents discover and talk to each other through Agent Cards.
|
|
27
|
+
It does not, by itself, prove who stands behind an agent. `vouch-a2a` attaches a
|
|
28
|
+
W3C Verifiable Credential (`eddsa-jcs-2022` Data Integrity proof) to the card,
|
|
29
|
+
optionally with a delegation chain back to the human or org that operates the
|
|
30
|
+
agent. A verifier can then refuse an unsigned or impostor peer.
|
|
31
|
+
|
|
32
|
+
## Install
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pip install vouch-a2a
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Sign an Agent Card
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
from vouch import Signer
|
|
42
|
+
from vouch_a2a import sign_agent_card
|
|
43
|
+
|
|
44
|
+
signer = Signer(private_key=PRIV_JWK, did="did:web:agents.acme.com")
|
|
45
|
+
|
|
46
|
+
card = {
|
|
47
|
+
"name": "BillingAgent",
|
|
48
|
+
"url": "https://agents.acme.com/billing",
|
|
49
|
+
"version": "1.0.0",
|
|
50
|
+
"capabilities": {"streaming": True},
|
|
51
|
+
"skills": [{"id": "invoice", "name": "Create invoice"}],
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
signed_card = sign_agent_card(signer, card) # adds a 'vouchCredential' field
|
|
55
|
+
# Optionally bind to an org principal:
|
|
56
|
+
# signed_card = sign_agent_card(signer, card, parent_credential=org_principal_cred)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Verify a peer's card
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
from vouch_a2a import verify_agent_card
|
|
63
|
+
|
|
64
|
+
ok, passport = verify_agent_card(peer_card, public_key=peer_pubkey)
|
|
65
|
+
if not ok:
|
|
66
|
+
raise PermissionError("Refusing to collaborate with an unverified agent")
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
The credential binds to the card's `url` (the stable agent identity). The input
|
|
70
|
+
card is never mutated; `sign_agent_card` returns a copy.
|
|
71
|
+
|
|
72
|
+
## License
|
|
73
|
+
|
|
74
|
+
Apache-2.0.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# vouch-a2a
|
|
2
|
+
|
|
3
|
+
Bind [A2A](https://a2a-protocol.org/) (Agent2Agent) Agent Cards to a
|
|
4
|
+
[Vouch](https://vouch-protocol.com) identity, so two agents can establish trust
|
|
5
|
+
before they collaborate.
|
|
6
|
+
|
|
7
|
+
A2A standardized how agents discover and talk to each other through Agent Cards.
|
|
8
|
+
It does not, by itself, prove who stands behind an agent. `vouch-a2a` attaches a
|
|
9
|
+
W3C Verifiable Credential (`eddsa-jcs-2022` Data Integrity proof) to the card,
|
|
10
|
+
optionally with a delegation chain back to the human or org that operates the
|
|
11
|
+
agent. A verifier can then refuse an unsigned or impostor peer.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install vouch-a2a
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Sign an Agent Card
|
|
20
|
+
|
|
21
|
+
```python
|
|
22
|
+
from vouch import Signer
|
|
23
|
+
from vouch_a2a import sign_agent_card
|
|
24
|
+
|
|
25
|
+
signer = Signer(private_key=PRIV_JWK, did="did:web:agents.acme.com")
|
|
26
|
+
|
|
27
|
+
card = {
|
|
28
|
+
"name": "BillingAgent",
|
|
29
|
+
"url": "https://agents.acme.com/billing",
|
|
30
|
+
"version": "1.0.0",
|
|
31
|
+
"capabilities": {"streaming": True},
|
|
32
|
+
"skills": [{"id": "invoice", "name": "Create invoice"}],
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
signed_card = sign_agent_card(signer, card) # adds a 'vouchCredential' field
|
|
36
|
+
# Optionally bind to an org principal:
|
|
37
|
+
# signed_card = sign_agent_card(signer, card, parent_credential=org_principal_cred)
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Verify a peer's card
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
from vouch_a2a import verify_agent_card
|
|
44
|
+
|
|
45
|
+
ok, passport = verify_agent_card(peer_card, public_key=peer_pubkey)
|
|
46
|
+
if not ok:
|
|
47
|
+
raise PermissionError("Refusing to collaborate with an unverified agent")
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The credential binds to the card's `url` (the stable agent identity). The input
|
|
51
|
+
card is never mutated; `sign_agent_card` returns a copy.
|
|
52
|
+
|
|
53
|
+
## License
|
|
54
|
+
|
|
55
|
+
Apache-2.0.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "vouch-a2a"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Bind A2A (Agent2Agent) Agent Cards to a Vouch identity for verifiable agent-to-agent trust."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
license = { text = "Apache-2.0" }
|
|
12
|
+
authors = [{ name = "Ramprasad Gaddam" }]
|
|
13
|
+
keywords = ["a2a", "agent2agent", "vouch", "ai-agents", "verifiable-credentials", "identity"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 4 - Beta",
|
|
16
|
+
"License :: OSI Approved :: Apache Software License",
|
|
17
|
+
"Programming Language :: Python :: 3",
|
|
18
|
+
"Topic :: Security :: Cryptography",
|
|
19
|
+
]
|
|
20
|
+
dependencies = ["vouch-protocol>=1.6.0"]
|
|
21
|
+
|
|
22
|
+
[project.optional-dependencies]
|
|
23
|
+
dev = ["pytest>=7.0"]
|
|
24
|
+
|
|
25
|
+
[project.urls]
|
|
26
|
+
Homepage = "https://vouch-protocol.com"
|
|
27
|
+
Source = "https://github.com/vouch-protocol/vouch"
|
|
28
|
+
|
|
29
|
+
[tool.setuptools.packages.find]
|
|
30
|
+
where = ["src"]
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""vouch-a2a: bind A2A Agent Cards to a Vouch identity.
|
|
2
|
+
|
|
3
|
+
Thin distribution wrapping vouch.integrations.a2a. It exists so the A2A binding
|
|
4
|
+
can be installed and listed on its own while the implementation stays
|
|
5
|
+
single-sourced in the vouch-protocol package.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from vouch.integrations.a2a import VOUCH_CARD_FIELD, sign_agent_card, verify_agent_card
|
|
9
|
+
|
|
10
|
+
__all__ = ["sign_agent_card", "verify_agent_card", "VOUCH_CARD_FIELD"]
|
|
11
|
+
__version__ = "0.1.0"
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vouch-a2a
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Bind A2A (Agent2Agent) Agent Cards to a Vouch identity for verifiable agent-to-agent trust.
|
|
5
|
+
Author: Ramprasad Gaddam
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://vouch-protocol.com
|
|
8
|
+
Project-URL: Source, https://github.com/vouch-protocol/vouch
|
|
9
|
+
Keywords: a2a,agent2agent,vouch,ai-agents,verifiable-credentials,identity
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Topic :: Security :: Cryptography
|
|
14
|
+
Requires-Python: >=3.9
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
Requires-Dist: vouch-protocol>=1.6.0
|
|
17
|
+
Provides-Extra: dev
|
|
18
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
19
|
+
|
|
20
|
+
# vouch-a2a
|
|
21
|
+
|
|
22
|
+
Bind [A2A](https://a2a-protocol.org/) (Agent2Agent) Agent Cards to a
|
|
23
|
+
[Vouch](https://vouch-protocol.com) identity, so two agents can establish trust
|
|
24
|
+
before they collaborate.
|
|
25
|
+
|
|
26
|
+
A2A standardized how agents discover and talk to each other through Agent Cards.
|
|
27
|
+
It does not, by itself, prove who stands behind an agent. `vouch-a2a` attaches a
|
|
28
|
+
W3C Verifiable Credential (`eddsa-jcs-2022` Data Integrity proof) to the card,
|
|
29
|
+
optionally with a delegation chain back to the human or org that operates the
|
|
30
|
+
agent. A verifier can then refuse an unsigned or impostor peer.
|
|
31
|
+
|
|
32
|
+
## Install
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pip install vouch-a2a
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Sign an Agent Card
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
from vouch import Signer
|
|
42
|
+
from vouch_a2a import sign_agent_card
|
|
43
|
+
|
|
44
|
+
signer = Signer(private_key=PRIV_JWK, did="did:web:agents.acme.com")
|
|
45
|
+
|
|
46
|
+
card = {
|
|
47
|
+
"name": "BillingAgent",
|
|
48
|
+
"url": "https://agents.acme.com/billing",
|
|
49
|
+
"version": "1.0.0",
|
|
50
|
+
"capabilities": {"streaming": True},
|
|
51
|
+
"skills": [{"id": "invoice", "name": "Create invoice"}],
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
signed_card = sign_agent_card(signer, card) # adds a 'vouchCredential' field
|
|
55
|
+
# Optionally bind to an org principal:
|
|
56
|
+
# signed_card = sign_agent_card(signer, card, parent_credential=org_principal_cred)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Verify a peer's card
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
from vouch_a2a import verify_agent_card
|
|
63
|
+
|
|
64
|
+
ok, passport = verify_agent_card(peer_card, public_key=peer_pubkey)
|
|
65
|
+
if not ok:
|
|
66
|
+
raise PermissionError("Refusing to collaborate with an unverified agent")
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
The credential binds to the card's `url` (the stable agent identity). The input
|
|
70
|
+
card is never mutated; `sign_agent_card` returns a copy.
|
|
71
|
+
|
|
72
|
+
## License
|
|
73
|
+
|
|
74
|
+
Apache-2.0.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
src/vouch_a2a/__init__.py
|
|
4
|
+
src/vouch_a2a.egg-info/PKG-INFO
|
|
5
|
+
src/vouch_a2a.egg-info/SOURCES.txt
|
|
6
|
+
src/vouch_a2a.egg-info/dependency_links.txt
|
|
7
|
+
src/vouch_a2a.egg-info/requires.txt
|
|
8
|
+
src/vouch_a2a.egg-info/top_level.txt
|
|
9
|
+
tests/test_smoke.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
vouch_a2a
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"""Smoke tests for the vouch-a2a package."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PublicKey
|
|
6
|
+
from jwcrypto.common import base64url_decode
|
|
7
|
+
import json
|
|
8
|
+
|
|
9
|
+
from vouch import Signer, generate_identity
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _pub(kp):
|
|
13
|
+
return Ed25519PublicKey.from_public_bytes(base64url_decode(json.loads(kp.public_key_jwk)["x"]))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def test_package_exports():
|
|
17
|
+
import vouch_a2a
|
|
18
|
+
|
|
19
|
+
assert vouch_a2a.sign_agent_card is not None
|
|
20
|
+
assert vouch_a2a.verify_agent_card is not None
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def test_sign_and_verify_card():
|
|
24
|
+
from vouch_a2a import sign_agent_card, verify_agent_card, VOUCH_CARD_FIELD
|
|
25
|
+
|
|
26
|
+
kp = generate_identity()
|
|
27
|
+
signer = Signer(private_key=kp.private_key_jwk, did="did:web:agents.acme.com")
|
|
28
|
+
|
|
29
|
+
card = {"name": "BillingAgent", "url": "https://agents.acme.com/billing", "version": "1.0.0"}
|
|
30
|
+
signed = sign_agent_card(signer, card)
|
|
31
|
+
|
|
32
|
+
# input not mutated, credential added on the copy
|
|
33
|
+
assert VOUCH_CARD_FIELD not in card
|
|
34
|
+
assert VOUCH_CARD_FIELD in signed
|
|
35
|
+
assert signed[VOUCH_CARD_FIELD]["proof"]["cryptosuite"] == "eddsa-jcs-2022"
|
|
36
|
+
|
|
37
|
+
ok, passport = verify_agent_card(signed, public_key=_pub(kp))
|
|
38
|
+
assert ok is True
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def test_unsigned_card_fails_closed():
|
|
42
|
+
from vouch_a2a import verify_agent_card
|
|
43
|
+
|
|
44
|
+
ok, passport = verify_agent_card({"name": "NoCred"}, public_key=None)
|
|
45
|
+
assert ok is False
|
|
46
|
+
assert passport is None
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def test_delegation_chain_on_card():
|
|
50
|
+
from vouch_a2a import sign_agent_card, verify_agent_card
|
|
51
|
+
|
|
52
|
+
org_kp = generate_identity()
|
|
53
|
+
agent_kp = generate_identity()
|
|
54
|
+
org = Signer(private_key=org_kp.private_key_jwk, did="did:web:acme.com")
|
|
55
|
+
agent = Signer(private_key=agent_kp.private_key_jwk, did="did:web:agents.acme.com")
|
|
56
|
+
|
|
57
|
+
# org issues a broad operate authority; agent narrows it onto its own card
|
|
58
|
+
parent = org.sign(
|
|
59
|
+
intent={
|
|
60
|
+
"action": "operate",
|
|
61
|
+
"target": "https://agents.acme.com",
|
|
62
|
+
"resource": "a2a:agent-card",
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
card = {"name": "BillingAgent", "url": "https://agents.acme.com/billing"}
|
|
66
|
+
signed = sign_agent_card(agent, card, parent_credential=parent)
|
|
67
|
+
|
|
68
|
+
ok, _ = verify_agent_card(signed, public_key=_pub(agent_kp))
|
|
69
|
+
assert ok is True
|