A2A SDK for Go 2.7

Last reviewed Oct 25, 2026

Export as PDF

Prompt Details

Prompt Composition

2prompts
  1. Go 1.26134 lines · 5.6K tokens
  2. A2A SDK for Go 2.740 lines · 2.1K tokens
Total174 lines · 7.7K tokens

CWE Coverage

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

Prompt Preview

Apply these rules to applications using github.com/a2aproject/a2a-go/v2 on the 2.7 line, whether they expose an A2A server, consume another agent, or both. The A2A protocol version advertised in an Agent Card is separate from the SDK version.

Discover and connect to agents

  • Resolve Agent Cards only from approved HTTPS origins. agentcard.Resolver accepts a complete URL and file:// URLs, follows its configured http.Client, and reads the entire response; reject untrusted local-file URLs, bound response size and redirects, and apply destination checks to every connection and redirect before parsing a card.
  • When signatures are required, configure agentcard.Resolver.Verifier with keys anchored to the expected provider, then explicitly reject a resolved card with no signatures. The resolver invokes its verifier only when card.Signatures is nonempty. Never treat a jku, kid, or endpoint inside an untrusted card as its own trust anchor.
  • Pass only verified or otherwise trusted cards to a2aclient.NewFromCard or Factory.CreateFromCard; these constructors assume the card is trusted. Check each SupportedInterfaces URL against the intended agent and egress policy before the factory can try it. PreferredTransports changes order rather than excluding other compatible transports; use WithDefaultsDisabled and explicit transport factories when only particular bindings are allowed.
  • Scope AuthInterceptor credentials by the current SessionID, agent, and security scheme. Attach a session ID for each call, fail closed if the card requires credentials but