A2A Protocol Support

View as Markdown

IDA integrates with Google’s Agent-to-Agent (A2A) protocol to enable cross-vendor agent collaboration with verifiable identity. A2A defines how agents discover each other, negotiate tasks, and exchange results.

A2A Protocol Overview

Agent Card Serving

IDA agents serve A2A-compatible Agent Cards at the .well-known endpoint:

1GET https://agent.example.com/.well-known/agent.json

See Agent Discovery & Cards for the full Agent Card format.

Task Lifecycle

A2A defines a task lifecycle that IDA extends with identity verification:

StateDescriptionIDA Extension
submittedTask received by server agentIBCT verified, delegation checked
workingAgent is processing the taskAudit trail started
input-requiredAgent needs more informationHITL if high-risk
doneTask completed successfullyAudit receipt signed
failedTask failedFailure logged to audit trail
canceledTask canceled by clientCancellation logged

Authentication Flow

IDA extends A2A authentication with DID-based auth:

Standard A2A (OAuth 2.0)

1POST /a2a
2Authorization: Bearer <oauth-access-token>
3Content-Type: application/json
4
5{
6 "jsonrpc": "2.0",
7 "method": "tasks/send",
8 "params": { "..." }
9}

IDA-Enhanced (DID Auth + IBCT)

1POST /a2a
2Authorization: DIDAuth <did-auth-token>
3X-IDA-IBCT: <ibct-token>
4X-IDA-Agent-DID: did:adi:agent:buyer01...
5Content-Type: application/json
6
7{
8 "jsonrpc": "2.0",
9 "method": "tasks/send",
10 "params": {
11 "id": "task-001",
12 "message": {
13 "role": "user",
14 "parts": [
15 {
16 "type": "text",
17 "text": "Compare prices for organic milk across all authorized merchants"
18 }
19 ]
20 }
21 },
22
23 "ida": {
24 "agentDid": "did:adi:agent:buyer01...",
25 "ibct": "eyJhbGciOiJFZERTQSJ9...",
26 "delegationChain": ["urn:uuid:root-delegation"]
27 }
28}

Task Send with IDA Identity

Request

1{
2 "jsonrpc": "2.0",
3 "method": "tasks/send",
4 "params": {
5 "id": "task-price-compare-001",
6 "message": {
7 "role": "user",
8 "parts": [
9 {
10 "type": "text",
11 "text": "Find the best price for 1 gallon organic milk"
12 }
13 ]
14 },
15 "metadata": {
16 "ida_agent_did": "did:adi:agent:buyer01...",
17 "ida_ibct": "eyJhbGciOiJFZERTQSJ9...",
18 "ida_required_trust_score": 70
19 }
20 },
21 "id": "req-001"
22}

Response (Working)

1{
2 "jsonrpc": "2.0",
3 "result": {
4 "id": "task-price-compare-001",
5 "status": {
6 "state": "working",
7 "message": "Comparing prices across 2 merchants..."
8 },
9 "metadata": {
10 "ida_server_agent_did": "did:adi:agent:seller01...",
11 "ida_audit_receipt_id": "receipt-abc123"
12 }
13 },
14 "id": "req-001"
15}

Response (Done)

1{
2 "jsonrpc": "2.0",
3 "result": {
4 "id": "task-price-compare-001",
5 "status": {
6 "state": "done"
7 },
8 "artifacts": [
9 {
10 "name": "price-comparison",
11 "parts": [
12 {
13 "type": "text",
14 "text": "Best price: FreshMart - $5.99/gallon (OrganicCo: $6.49)"
15 }
16 ]
17 }
18 ],
19 "metadata": {
20 "ida_audit_receipt": {
21 "id": "receipt-abc123",
22 "agentDid": "did:adi:agent:seller01...",
23 "result": "success",
24 "signature": "z58DAdFfa9SkqZMVPxAQpic7..."
25 }
26 }
27 },
28 "id": "req-001"
29}

Server Agent Setup

Express.js A2A Server with IDA

1import express from 'express';
2import { IDAClient } from '@ida/sdk';
3
4const app = express();
5const ida = new IDAClient({ apiUrl: 'http://localhost:8080' });
6
7// Serve Agent Card
8app.get('/.well-known/agent.json', (req, res) => {
9 res.json({
10 name: "Price Comparison Agent",
11 description: "Compares prices across merchants",
12 url: "https://price-agent.example.com",
13 identity: {
14 did: "did:adi:agent:seller01...",
15 operatorDid: "did:adi:merchant001...",
16 trustScore: 88
17 },
18 skills: [
19 {
20 id: "price-compare",
21 name: "Price Comparison",
22 tags: ["prices", "comparison"]
23 }
24 ],
25 authentication: {
26 schemes: [
27 { scheme: "did-auth", didMethod: "did:adi" },
28 { scheme: "oauth2", flows: ["client_credentials"] }
29 ]
30 }
31 });
32});
33
34// A2A endpoint
35app.post('/a2a', async (req, res) => {
36 const { method, params, ida: idaParams } = req.body;
37
38 // Verify client agent's identity
39 if (idaParams?.ibct) {
40 const verification = await ida.verifyIBCT(idaParams.ibct);
41 if (!verification.valid) {
42 return res.json({
43 jsonrpc: "2.0",
44 error: { code: -32001, message: "IBCT verification failed" }
45 });
46 }
47 }
48
49 if (method === 'tasks/send') {
50 // Process task
51 const result = await handleTask(params);
52 return res.json({
53 jsonrpc: "2.0",
54 result: { id: params.id, status: { state: "done" }, artifacts: [result] }
55 });
56 }
57});

Multi-Agent Collaboration

A2A enables multi-agent workflows where IDA provides the trust layer:

Each A2A interaction carries:

  1. The sending agent’s IBCT (proving delegation)
  2. The task payload
  3. Audit receipts for every step

A2A + DID Auth vs OAuth 2.0

FeatureOAuth 2.0DID Auth + IBCT
Identity proofClient ID + secretCryptographic DID signature
DelegationNot supportedFull delegation chain
Scope enforcementOAuth scopes (static)IBCT scope (per-invocation)
Trust scoringNot availableOn-chain trust score
Audit trailApplication-levelCryptographic receipts
RevocationToken revocationReal-time delegation revocation

IDA supports both authentication methods. OAuth 2.0 is available for backward compatibility with non-IDA agents.