ACK-ID A2A Demo
Step-by-step guide demonstrating mutual authentication between agents using ACK-ID and A2A.
Overview
ACK-ID is a protocol built on W3C Standards designed to bring verifiable, secure, compliant identity, reputation, and service discovery to agents.
A2A (Agent2Agent) is a protocol developed by Google to standardize communication between multiple agents.
This interactive command-line demo showcases how two A2A-compatible agents can use ACK-ID to verify each other’s identity and trust that they are communicating with the expected agent.
Getting Started
Before running this demo, follow the Quickstart Guide to ensure you are set up properly.
Running the Demo
You can use the demo by running the following command from the root of this repository:
Alternatively, from within the demo directory (./demos/identity-a2a
):
Demo Walkthrough
This demo showcases a mutual authentication flow between a Bank Customer Agent and a Bank Teller Agent using ACK-ID DIDs and JWTs exchanged within A2A message bodies. The demo walks through the following authentication flow:
Initial Contact - Customer Agent Initiates
The Customer Agent sends an authentication request as an A2A message containing a signed JWT with a nonce:
The JWT payload includes:
Bank Teller Agent Response
The Bank Teller Agent verifies the customer’s JWT signature and responds with its own signed JWT, including both the customer’s nonce and a new server nonce:
The Bank’s JWT payload:
Subsequent Communications
After successful mutual authentication, all subsequent messages include a signature in the metadata:
The signature is a JWT with the payload:
with aud
and iss
set for the counterparty and sender’s DID, respectively.
Security Benefits
This authentication flow provides several security advantages:
- Mutual Authentication: Both parties prove their identity through cryptographic signatures.
- Replay Attack Prevention: Nonces and JWT IDs ensure messages cannot be replayed.
- Man-in-the-Middle (MITM) Protection: The
aud
andiss
fields are pinned in the JWTs, preventing tampering. An attacker cannot modify requests or responses without invalidating the signatures. - Short-lived Tokens: 5-minute expiry limits the window for potential attacks.
- Verifiable Identity: DID-based authentication ensures cryptographic proof of identity.
Further Exploration
- Agent Commerce Kit Documentation
- ACK-ID Documentation
- A2A Documentation