Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Agent-DID × Google A2A Integration

Roadmap item: F2-02 — Google A2A proof-of-concept

Agent-DID as the identity layer for the Google A2A (Agent-to-Agent) protocol. This integration provides DID-based cryptographic identity for A2A agent discovery, request signing, and mutual authentication.

What This Solves

The A2A protocol is auth-agnostic — it defines how agents communicate (JSON-RPC 2.0 over HTTPS) and discover each other (AgentCards), but deliberately leaves authentication to the implementer. This creates a gap:

A2A Gap What Agent-DID Provides
No native cryptographic identity DID anchored to the agent's model, prompt, and capabilities
AgentCard has no verifiable identity proof DID fields embedded directly in the AgentCard
Request authenticity depends on external auth Ed25519 HTTP Message Signatures on every JSON-RPC request
No standard for mutual agent authentication DID-based verification of the counterparty agent

Features

  • DID-Enriched AgentCards — generate A2A-compliant AgentCards with embedded DID, controller, and http-signature-did authentication scheme
  • Request Signing — sign outgoing tasks/send, tasks/get requests using Agent-DID HTTP Signatures
  • Request Verification — verify incoming signed requests using the sender's DID
  • JSON-RPC Helpers — Pydantic models for A2A JSON-RPC 2.0 messages
  • Observability — structured, sanitized event emission for signing, verification, and card generation
  • Secure Defaults — sensitive fields redacted, private network targets blocked, extra config fields rejected

Identity Composition Contract

The canonical A2A identity invariant for this repository is documented in RFC-001-A2A-Identity-Composition-Contract.md, co-drafted with APS during Public Review.

The contract defines how two identity surfaces compose:

  • Identity-at-rest: the published AgentCard and its DID-published key material.
  • Identity-in-motion: the per-request HTTP signature and its keyid.

An A2A verifier must treat those surfaces as a single trust boundary: the per-request signing key must compose with the AgentCard and DID document key material, and the signing key must be authorized for the operation context described in §6.3 of the contract.

Current integration behavior publishes DID-enriched AgentCards and signs/verifies A2A requests with Agent-DID HTTP signatures. The stricter SDK-level enforcement of §6.3 verification-relationship binding is tracked in issue #34; the umbrella closure work for the composition contract remains tracked in issue #30.

Installation

cd integrations/a2a
python -m pip install -e ".[dev]"

Requires the Python SDK installed in dev mode:

cd sdk-python
python -m pip install -e ".[dev]"

Quick Start

from agent_did_sdk import AgentIdentity, AgentIdentityConfig, CreateAgentParams, InMemoryAgentRegistry
from agent_did_a2a import A2ASkill, create_agent_did_a2a_integration

# Create identity
AgentIdentity.set_registry(InMemoryAgentRegistry())
identity = AgentIdentity(AgentIdentityConfig(controller_signer=LocalKeySigner.generate()[0]))
runtime = await identity.create(
    CreateAgentParams(name="MyAgent", core_model="gpt-4.1", system_prompt="...")
)

# Create A2A integration
integration = create_agent_did_a2a_integration(
    agent_identity=identity,
    runtime_identity=runtime,
)

# Generate AgentCard for /.well-known/agent.json
card = integration.agent_card_json(
    agent_url="https://my-agent.example.com",
    skills=[A2ASkill(id="task-1", name="My Skill", description="Does something useful")],
)

# Sign an outgoing A2A request
signed = await integration.send_task(
    target_url="https://remote-agent.example.com/a2a",
    request_id=1,
    task_id="task-001",
    message={"role": "user", "parts": [{"type": "text", "text": "Hello"}]},
)

# Verify an incoming request
is_valid = await integration.verify_request(
    method="POST",
    url="https://my-agent.example.com/a2a",
    headers=incoming_headers,
    body=incoming_body,
)

Examples

Example Description
a2a_agent_did_discovery.py Agent publishes a DID-enriched AgentCard
a2a_mutual_auth_demo.py Two agents authenticate each other via DID HTTP Signatures

Running Tests

cd integrations/a2a
python -m pytest tests/ -q

Full quality gates:

python -m ruff check src/ tests/ examples/
python -m mypy src/
python -m pytest tests/ -q

Architecture

┌─────────────────────────────────────────────────────────┐
│  Agent A (Client)                                        │
│  ┌─────────────────────────────────────────────────┐    │
│  │ AgentDidA2AIntegration                           │    │
│  │  → build_agent_card() → /.well-known/agent.json │    │
│  │  → sign_request() → Signature + Signature-Input │    │
│  │  → send_task() → signed JSON-RPC POST           │    │
│  └─────────────────────┬───────────────────────────┘    │
├─────────────────────────┼───────────────────────────────┤
│         HTTPS + Ed25519 HTTP Message Signatures          │
├─────────────────────────┼───────────────────────────────┤
│  Agent B (Server)       ▼                                │
│  ┌─────────────────────────────────────────────────┐    │
│  │ AgentDidA2AIntegration                           │    │
│  │  → verify_request() → validate Signature header │    │
│  │  → resolve DID → fetch sender's public key      │    │
│  │  → ✓ authenticated → process A2A task           │    │
│  └─────────────────────────────────────────────────┘    │
└─────────────────────────────────────────────────────────┘

How It Fits With A2A

This integration uses A2A's authentication extension point. The A2A spec expects an authentication field in the AgentCard with one or more schemes. Agent-DID adds http-signature-did as a scheme, meaning:

  1. The AgentCard declares the agent's DID and authentication key
  2. Outgoing requests include Signature and Signature-Input headers per IETF HTTP Message Signatures
  3. The receiving agent resolves the sender's DID to obtain the public key
  4. Signature verification proves request authenticity and integrity

This approach is complementary to OAuth 2.0, mTLS, or any other A2A auth scheme — agents can support multiple schemes simultaneously.

License

Apache-2.0

Metadata

Release files for agent-did-a2a 1.0.0rc4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agent-did-a2a 1.0.0rc4
File Size Uploaded Provenance Actions
agent_did_a2a-1.0.0rc4.tar.gz 17.1 kB With provenance Details for agent_did_a2a-1.0.0rc4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agent-did-a2a 1.0.0rc4
File Interpreter ABI Platform Actions
agent_did_a2a-1.0.0rc4-py3-none-any.whl Python 3 none any Details for agent_did_a2a-1.0.0rc4-py3-none-any.whl

Total release size: 31.5 kB

Release files / agent_did_a2a-1.0.0rc4.tar.gz

Download URL agent_did_a2a-1.0.0rc4.tar.gz
Size 17.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a319fcaab84b72e9d43d47a2f891cad4e535ecdc307a225e6268942f4fc7120a
BLAKE2b-256 checksum
How to use checksums
87602b5503633faf12096f9a015d1851fa0bc87220d0d7ab08f6d0a7b4f114e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / agent_did_a2a-1.0.0rc4-py3-none-any.whl

Download URL agent_did_a2a-1.0.0rc4-py3-none-any.whl
Size 14.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9476c2cf0baa95995d638a0e94a6dfc24b06b6996fd470fea79ae44622e2eef1
BLAKE2b-256 checksum
How to use checksums
4feec007b989aad9f81dabe7f36d8b1441b74a5b8759d38a594635996cb02f91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Security for agent-did-a2a 1.0.0rc4

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for agent_did_a2a-1.0.0rc4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page