A2A SDK for Java 1.4
Last reviewed Oct 25, 2026
Prompt Details
Prompt Composition
2prompts
- Java 25113 lines · 2.8K tokens
- A2A SDK for Java 1.440 lines · 1.9K tokens
Total153 lines · 4.7K tokens
CWE Coverage
- 20
- 22
- 59
- 78
- 79
- 88
- 89
- 93
- 95
- 117
- 190
- 201
- 208
- 209
- 214
- 294
- 295
- 297
- 306
- 319
- 323
- 327
- 338
- 347
- 362
- 367
- 378
- 427
- 470
- 471
- 494
- 502
- 532
- 611
- 639
- 653
- 681
- 732
- 770
- 772
- 776
- 789
- 807
- 841
- 862
- 863
- 915
- 916
- 918
- 922
- 942
- 1333
Prompt Preview
Apply these rules to A2A Java client, server, transport, and extras code. The SDK implements A2A Protocol 1.0 with optional protocol 0.3 compatibility; its minimum Java runtime is 17. The included Java 25 prompt supplies the language and runtime controls.
Agent discovery and client credentials
- Give
A2ACardResolver.builder().baseUrl(...)an approved HTTPS origin. Treat a fetched or registry-suppliedAgentCardas untrusted data: approve itssupportedInterfacesURLs, transport, tenant, advertised security schemes, and requested capabilities beforeClient.builder(card)connects or sends credentials. Keep private network and metadata destinations out of client egress, including any custom card path and redirect. - Account for
A2ACardResolver.getAgentCard()retrying the originally supplied base URL after a 404 at the computed well-known URL; scopeauthHeader(s)to an approved destination on both requests. Do not derive a credential-bearing card URL from an untrusted message or card. - Bind credentials in
ClientCallContextandAuthInterceptorto the intended agent, principal, and security scheme. Accept API-key header injection only for the SDK's allowed header names andAPIKeySecurityScheme.Location.HEADER; do not add a card-chosen header, cookie, or query credential through a custom interceptor. - Keep redirect following disabled for credential-bearing
A2AHttpClientrequests, including POST and SSE paths in injected JDK, Vert.x, Android, or CDI clients. If a redirect is required, approve the new origin and reselect credentials before another request;