A2A SDK for Python 1.2
Last reviewed Oct 26, 2026
Prompt Details
Prompt Composition
2prompts
- Python 3155 lines · 3.8K tokens
- A2A SDK for Python 1.250 lines · 2.7K tokens
Total205 lines · 6.4K tokens
CWE Coverage
- 20
- 23
- 36
- 59
- 78
- 79
- 89
- 95
- 117
- 201
- 208
- 209
- 214
- 250
- 295
- 306
- 319
- 328
- 338
- 347
- 362
- 367
- 379
- 409
- 416
- 426
- 427
- 470
- 488
- 502
- 524
- 532
- 611
- 639
- 674
- 694
- 732
- 770
- 772
- 776
- 807
- 829
- 841
- 862
- 916
- 918
- 1104
- 1333
- 1395
- 1426
- 1427
Prompt Preview
Apply the Python 3 prompt first. These rules cover the a2a-sdk 1.2 line, researched against 1.2.3, with its A2A 1.0 bindings and any deliberately enabled v0.3 compatibility routes. Run it on a security-supported Python minor compatible with the SDK.
Agent discovery and client identity
- Put
A2ACardResolverandClientFactory.create_from_urlbehind a destination policy before fetching a card. Constrain the base URL, card path, redirects, resolved address, timeout, and response size; keepresolver_http_kwargsunder application control. The resolver loads the JSON body and logs the fetched card at INFO. - Supply
signature_verifierwhen card authenticity is required, including for an extended card fetched later. Verify a card passed directly toClientFactory.createbefore use.create_signature_verifieraccepts any one valid signature, so bind its trusted key to the expected agent, constrain algorithms, and treatkidandjkuas untrusted selectors rather than arbitrary key or URL authority. - Inspect every
AgentCard.supported_interfacesURL,protocol_binding,protocol_version, and tenant before creating a client. SetClientConfig.supported_protocol_bindingsto the bindings you intend to use and register only reviewed transport producers. A signed card authenticates its contents; it does not authorize an outbound destination or downgrade. - Provide a
grpc_channel_factorythat makes a peer-verified TLS channel with message limits. SetClientCallContext.timeouton gRPC calls; the SDK requires a channel factory but does not choose its security