A2A SDK for JavaScript 1.3
Last reviewed Oct 25, 2026
Prompt Details
Prompt Composition
4prompts
- JavaScript ES2026102 lines · 3.1K tokens
- Node.js 24101 lines · 5.3K tokens
- TypeScript 5.940 lines · 1.2K tokens
- A2A SDK for JavaScript 1.351 lines · 2.7K tokens
Total294 lines · 12.3K tokens
CWE Coverage
- 20
- 22
- 59
- 73
- 78
- 79
- 88
- 89
- 95
- 113
- 116
- 117
- 200
- 208
- 209
- 214
- 250
- 287
- 295
- 297
- 306
- 312
- 319
- 323
- 330
- 338
- 346
- 347
- 352
- 354
- 362
- 367
- 377
- 426
- 444
- 459
- 471
- 488
- 494
- 502
- 522
- 524
- 532
- 602
- 639
- 653
- 732
- 770
- 807
- 829
- 838
- 841
- 862
- 863
- 908
- 915
- 916
- 918
- 922
- 942
- 943
- 1004
- 1321
- 1333
- 1427
Prompt Preview
Apply the Node.js 24 and TypeScript 5.9 prompts first. These rules cover @a2a-js/sdk 1.3, implementing A2A Protocol 1.0. Apply them to each enabled client or server transport and to any persistent stores.
Discovery, cards, and client transports
- Constrain
DefaultAgentCardResolverwith itsfetchImploption or a customAgentCardResolver: resolvebaseUrlandpath, allow only approved HTTPS destinations, reject private and metadata addresses after DNS resolution and redirects, and bound response bytes and time. The default resolver fetches and parses the card without an application egress policy. - Validate each discovered
supportedInterfacesURL, protocol version, and tenant beforeClientFactory.createFromUrlorcreateFromAgentCardselects a transport. ScopeRequestOptions.serviceParameters, interceptors, and transport credentials to the approved agent and final destination; a trusted card origin does not authorize every endpoint it advertises. - Pass an explicit allowlist of factories as
ClientFactoryOptions.transports.preferredTransportsmay fall back to the card's preferences, andClientFactoryOptions.createFrommerges factories rather than removing originals. - Give
GrpcTransportFactoryverified TLSgrpcChannelCredentialsand secure the server channel; the transport otherwise usesgrpc.credentials.createInsecure(). An HTTPS card URL does not secure gRPC. - Verify a signed public card before creating a transport and pass a verifier to
Client.getAgentCardfor extended-card refreshes. Verification is optional; the client caches a