User Story 06: Untrusted-Broker Security Profile
Implementation-oriented user story for SDK development.
One Request/Stream Exchange with End-to-End Encrypted Payloads
Goal
Agent A and Agent B exchange request/reply/stream payloads over MQTT where broker ACLs are not assumed to provide sufficient confidentiality.
Preconditions
- Both agents support
ubsp-v1. - Both agents expose discoverable public key metadata (for example trusted
jwksUrimetadata in Agent Card extensions). - Agent A has trust policy for key source validation and can resolve Agent B encryption key.
- Agent A has an active reply topic subscription.
End-to-End Flow
- Agent A discovers Agent B and resolves Agent B encryption key from trusted metadata.
- Agent A builds a JSON-RPC request payload and encrypts it as JWE.
- Agent A publishes request to:
$a2a/v1/request/{org_id}/{unit_id}/{agent_id}- QoS:
1(recommended) - MQTT
Content Type:application/jose+json(orapplication/jose) - MQTT v5 properties:
Response Topic:$a2a/v1/reply/{org_id}/{unit_id}/{client_agent_id}/{reply_suffix}Correlation Data: unique request correlation bytesa2a-security-profile=ubsp-v1a2a-requester-agent-id=<requester_agent_id>a2a-recipient-agent-id=<responder_agent_id>- optional
a2a-recipient-kid=<jwk_kid>
- Agent B validates request metadata:
a2a-security-profile=ubsp-v1presenta2a-recipient-agent-idmatches local agent identity- decrypts payload and processes request
- Agent B encrypts reply/stream payloads to Agent A key and publishes to
Response Topic:- echoes
Correlation Data - sets
a2a-security-profile=ubsp-v1 - sets
a2a-requester-agent-id=<requester_agent_id> - sets
a2a-responder-agent-id=<responder_agent_id>
- echoes
- Agent A decrypts responses and processes A2A/JSON-RPC semantics as usual.
- For stream flows, terminal
TaskStatusUpdateEvent.status.statestill closes the stream (TASK_STATE_COMPLETED,TASK_STATE_FAILED,TASK_STATE_CANCELED).
SDK Requirements Checklist
- Discover and validate responder key metadata using trust policy.
- Encrypt outgoing request payloads and decrypt incoming reply/stream payloads.
- Validate mandatory
ubsp-v1MQTT User Properties on both request and response paths. - Preserve and match
Correlation Dataindependent of payload encryption. - Keep OAuth bearer token handling independent from payload encryption rules.
- Enforce replay protection for protected payloads (for example
jtiand short-livedexp).
Failure Cases to Test
a2a-recipient-agent-idmismatch on responder: reject astransport_protocol_error.- Missing
a2a-security-profileor malformed protected metadata: reject astransport_protocol_error. - Key resolution failure (no trusted responder key): requester must fail closed (do not send plaintext fallback automatically).
- JWE decrypt failure on responder/requester: reject message and surface protocol error.
- Replay-detected protected message: reject as security failure.