DISCOVERY / POLICY / HANDOFF

ADK Java and A2A: validate a discovered peer before handoff

Inspect a trusted Agent Card and one whose endpoint origin differs.

A2A 0.3 JSON-RPC subset / six adapter gates

Destination and task

Accepted artifact

Inspected gates

    Edit the discovered card

    Current snapshot

    Offline application policy. No card signature, Java runtime, network request or real token. Pinned A2A 0.3 specification.

    Follow the adapter boundary

    This offline experiment explains a boundary an ADK Java application needs when delegating to a remote agent. It does not run Java, ADK, an LLM or a network client. The wire examples are explicitly pinned to A2A 0.3.0 JSON-RPC; they are not a claim about the newest protocol release. Agent Card JSON is editable and parsed on every change. Card example replaces that text with a bounded case. The six gates separately inspect JSON, endpoint policy, skill compatibility, credential audience, request construction and response interpretation. At the opening settings, seek to sixty seconds: one fictional message/send request produces the text artifact “Use a finite retry budget.” Inspect the request and response in Current snapshot. Dispatch alone is never reported as task completion.

    Separate endpoint policy from credential policy

    Choose Wrong origin. With Allowlisted origin, the URL is rejected before a send. Switch Endpoint policy to Advertised HTTPS: the endpoint gate now passes, but Peer-bound credential still stops the handoff at Credential audience. Choose Broad credential to observe one fictional send and credentialExposed true. This is an intentional unsafe comparison, not a suggested policy. No credential value exists or leaves the page. HTTPS, an absent URL username/password, and no fragment are required in both endpoint modes. Origin matching compares a parsed URL including scheme, host and effective port, not a string prefix. The allowlist is an application rule, not a claim that A2A requires discovery and service endpoints to share an origin. DNS resolution, redirects, private address ranges, certificate checks, signature verification and token cryptography are outside the model.

    Check the actual selected contract

    Return Card example to Valid card, choose Allowlisted origin and Peer-bound credential. Requested skill Translate stops at Skill and contract because only summarize is advertised. Choose Summarize again. Wrong transport fails because this particular adapter supports JSONRPC only. Image-only skill fails because its per-skill inputModes override the card defaults; editing that array to text/plain makes it compatible. Output modes work the same way. Removing protocolVersion or changing it away from 0.3.0 blocks the adapter. The bounded security parser accepts a bearer-only alternative whose named scheme is HTTP bearer. It does not implement every valid security scheme or the complete Agent Card schema. Missing credential always blocks. Skill matching is a local routing choice; the constructed message has no invented skillId field. A card declares capabilities and authentication requirements, but cannot grant the caller authorization.

    Distinguish completion, rejection and uncertainty

    At the valid settings, Response fixture Completed yields a correlated task with a text artifact. Working retains a task identifier and reports working-not-complete; Failed reports peer-failed. Wrong correlation ID and Malformed JSON reject the response after exactly one send. The synthetic response delay is fixed at 150 milliseconds. Deadline 100 therefore reports timeout-unknown with one send and no accepted artifact; 200 and 300 permit interpretation. A timeout does not establish whether remote work happened. There is no automatic retry, cancellation, deduplication, polling or durable task store. This adapter accepts only the supplied task-response forms; direct Message results, streaming, alternate transports and multi-turn tasks need additional implementation. The fabricated delay is independent of inspection time and is not a measured service benchmark.

    Control the inspection and retain evidence

    Play advances six gates over sixty inspection seconds. Pause freezes the view; Next gate pauses and advances to the next ten-second boundary. Restart retains the inputs and returns to zero. Timeline seeks without running, and Speed changes inspection pace between quarter, half, normal and double. Changing any scenario input resets the trace. Hidden tabs pause. Export trace JSON downloads both the complete deterministic model and the currently inspected prefix, so an uninspected future result is clearly separate. Capture baseline records the inputs and visible result; Replace baseline updates it and Clear baseline removes it. Notes remain in this browser and Export notes downloads observations. Expand experiment enters full screen. Compare the stopping gate, send count, destination, exposure flag and final task state. JSON is rendered as text, never HTML. The existing readings connect this local adapter to Agent Card fields and ADK integration; successful fixtures do not certify a production endpoint.

    Views are my own and do not represent any employer, past or present.

    Search