A2A SDK for Go 2.5.0

Last reviewed Sep 19, 2026

Export as PDF

Prompt Details

Prompt Composition

2prompts
  1. Go 1.27130 lines · 5.5K tokens
  2. A2A SDK for Go 2.5.062 lines · 3.2K tokens
Total192 lines · 8.7K tokens

CWE Coverage

  • 15
  • 20
  • 22
  • 59
  • 73
  • 78
  • 79
  • 89
  • 94
  • 117
  • 190
  • 201
  • 208
  • 209
  • 250
  • 252
  • 257
  • 287
  • 295
  • 306
  • 307
  • 323
  • 327
  • 338
  • 347
  • 352
  • 362
  • 367
  • 378
  • 426
  • 444
  • 488
  • 494
  • 532
  • 636
  • 732
  • 759
  • 770
  • 772
  • 807
  • 841
  • 862
  • 863
  • 915
  • 916
  • 918
  • 922
  • 942
  • 1004
  • 1275
  • 1395
  • 1427
  • 1428

Prompt Preview

Apply the Go 1.27 baseline first. These rules cover github.com/a2aproject/a2a-go/v2 at v2.5.0, implementing A2A Protocol 1.0. The SDK requires Go 1.25.0 or newer.

Discovery and transport selection

  • Allow only approved HTTPS card locations before calling agentcard.Resolver.Resolve. Reject untrusted file: locations: 2.5.0 reads them directly from disk, bypassing Resolver.Client and its network controls. Confine any intentionally supported local cards to trusted deployment files.
  • Supply a restricted Resolver.Client and enforce a response-byte limit before parsing, with an error on overflow. The default resolver has a 30-second timeout but reads the whole response with io.ReadAll; a size check in CardParser is too late to bound that allocation.
  • Validate card structure and approved identity before creating a client or calling Client.UpdateCard; DefaultCardParser only unmarshals JSON. Where signed discovery is required, verify JWS signatures with the protocol's canonicalization rules and trusted provider keys; constrain key-discovery URLs as outbound requests.
  • Filter every AgentCard.SupportedInterfaces endpoint, protocol version, and binding against local policy. Use a2aclient.WithDefaultsDisabled() and register only approved transports; Config.PreferredTransports sorts candidates but does not exclude other registered transports. Defaults register JSON-RPC and REST, and connection setup can try multiple candidates.
  • Pass protected HTTP clients through WithJSONRPCTransport and WithRESTTransport, and configure TLS and destination controls