A2A SDK for Go 2.7
Last reviewed Oct 25, 2026
Prompt Details
Prompt Composition
2prompts
- Go 1.26134 lines · 5.6K tokens
- 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.Resolveraccepts a complete URL andfile://URLs, follows its configuredhttp.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.Verifierwith keys anchored to the expected provider, then explicitly reject a resolved card with no signatures. The resolver invokes its verifier only whencard.Signaturesis nonempty. Never treat ajku,kid, or endpoint inside an untrusted card as its own trust anchor. - Pass only verified or otherwise trusted cards to
a2aclient.NewFromCardorFactory.CreateFromCard; these constructors assume the card is trusted. Check eachSupportedInterfacesURL against the intended agent and egress policy before the factory can try it.PreferredTransportschanges order rather than excluding other compatible transports; useWithDefaultsDisabledand explicit transport factories when only particular bindings are allowed. - Scope
AuthInterceptorcredentials by the currentSessionID, agent, and security scheme. Attach a session ID for each call, fail closed if the card requires credentials but