Metadata-Version: 2.4
Name: agentoath-a2a
Version: 0.1.0
Summary: AgentOath bridge for Google A2A (Agent-to-Agent) protocol -- embed trust receipts in A2A interactions.
Author-email: AgentOath Protocol Team <team@agentoath.ai>
License: Apache-2.0
Project-URL: Homepage, https://agentoath.ai
Project-URL: Repository, https://github.com/AgentOath/agentoath
Project-URL: Documentation, https://agentoath.ai/docs/integrations/a2a
Keywords: ai,agent,trust,a2a,agentoath,agent-to-agent,google
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Security :: Cryptography
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: agentoath>=0.2.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"

# AgentOath A2A Bridge

[AgentOath](https://agentoath.ai) trust protocol extension for the [Google A2A (Agent-to-Agent)](https://github.com/google/A2A) protocol.

Embeds verifiable identity, trust scores, and signed receipts into A2A agent communication, adding cryptographic trust to inter-agent interactions.

## Features

- **Agent Card Extension** -- Add AgentOath identity (DID, public key, trust score) to A2A Agent Cards
- **Task Handler** -- Automatically sign trust receipts when A2A tasks complete or fail
- **Trust Headers** -- Sign and verify HTTP headers for A2A requests
- **ASGI Middleware** -- Drop-in middleware for A2A servers (FastAPI, Starlette, etc.)

## Quick Start

```bash
pip install agentoath-a2a
```

### Extend your Agent Card

```python
from agentoath import TrustAgent
from agentoath_a2a import AgentCardExtension

agent = TrustAgent.load("my_agent.json")
ext = AgentCardExtension(agent)

card = {
    "name": "My Agent",
    "description": "An AI assistant",
    "url": "https://myagent.example.com",
}
card = ext.extend_agent_card(card)
# card now has extensions.agentoath with DID, public_key, trust_score
```

### Automatic receipts on task completion

```python
from agentoath_a2a import TrustTaskHandler

handler = TrustTaskHandler(agent)

# When an A2A task completes:
receipt = handler.on_task_completed(task, remote_agent_did="did:trust:agent:...", rating=8)
```

### Trust headers for HTTP requests

```python
from agentoath_a2a import TrustHeaderSigner, TrustHeaderVerifier

# Sign outgoing request
signer = TrustHeaderSigner(agent)
headers = signer.sign_headers(method="POST", path="/tasks/send")

# Verify incoming request
verifier = TrustHeaderVerifier()
result = verifier.verify_headers(headers, "POST", "/tasks/send", public_key=remote_agent.public_key)
```

### ASGI Middleware

```python
from agentoath_a2a import AgentOathA2AMiddleware

app = AgentOathA2AMiddleware(app, agent=agent, known_agents={...})
```

## Development

```bash
pip install -e ".[dev]"
pytest
```

## License

Apache-2.0
