A2A SDK for JavaScript 1.3

Last reviewed Oct 25, 2026

Export as PDF

Prompt Details

Prompt Composition

4prompts
  1. JavaScript ES2026102 lines · 3.1K tokens
  2. Node.js 24101 lines · 5.3K tokens
  3. TypeScript 5.940 lines · 1.2K tokens
  4. 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 DefaultAgentCardResolver with its fetchImpl option or a custom AgentCardResolver: resolve baseUrl and path, 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 supportedInterfaces URL, protocol version, and tenant before ClientFactory.createFromUrl or createFromAgentCard selects a transport. Scope RequestOptions.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. preferredTransports may fall back to the card's preferences, and ClientFactoryOptions.createFrom merges factories rather than removing originals.
  • Give GrpcTransportFactory verified TLS grpcChannelCredentials and secure the server channel; the transport otherwise uses grpc.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.getAgentCard for extended-card refreshes. Verification is optional; the client caches a