Repository navigation
feat(a2a): signed Agent Card and every automated TCK check passing - #2828
Conversation
serve --a2a now signs the public and extended Agent Cards as A2A 1.0 section 8.4 describes: an EdDSA JWS over the card's RFC 8785 canonical form, by this computer's Seal key (the key that signs its run receipts), so the kid is the key id a receiver already pins for handoffs. The JWS is built from signer.sign, so keychain and PKCS#11 keys work. If the key can't be opened, the server does not start rather than serve an unsigned card. verify_agent_card checks a served card against pinned keys (EdDSA only, key by kid, never the card's own jwk). Tests verify the card with the a2a-sdk verifier and refuse changed, unpinned, unsigned and relabelled cards. The agent CI job now installs Flow's a2a extra. Without it, test_handoff_e2e.py skipped in CI, and one assertion had gone stale: since the check-level ladder (#2495) a stubbed run with no read-back gets an UNKNOWN receipt, not VERIFIED. The test now asserts the verdict copies that outcome.
HTTP+JSON responses are now application/a2a+json, errors included, as specification 1.0.1 recommends. a2a-sdk 1.3.1 labelled only its error responses application/json (TCK HTTP_JSON-SVC-001). --a2a-tck-scenarios answers the TCK's scripted tck-* messages (its SUT_REQUIREMENTS: text, file, file-URL and data artifacts, and a direct Message). The answers run no workflow and touch no data, and the flag needs --mode sandbox and loopback, so a server that runs real workflows never serves them (DM-ART-001, DM-MSG-001). TCK at 5e6f37c on 2026-11-30: 121 passed, 0 failed, 142 skipped (gRPC, push, cancel, auth scenarios); evidence in benchmark/a2a_tck/2026-11-30.
benchmark/a2a_interop runs the official JS SDK (@a2a-js/sdk 1.3.0) against serve --a2a. It verifies the card signature with jose and canonicalize (independent JWS and RFC 8785), runs a sandbox workflow, and sends a second key's handoff to verify_handoff over JSON-RPC and HTTP+JSON. All checks pass; evidence in 2026-11-30/evidence.json.
Registers the TCK and JavaScript interop evidence in the public artifact inventory, and sets allow_abbrev=False on run_interop.py and on scripts/build_results_table.py, which already failed the check on main.
Independent adversarial review: REQUEST CHANGESFrom: Codex
One smaller HTTP issue remains. REST guard errors (401, 403 and 421) return At this head, 51 agent tests passed and all six CLI parser cases passed across the initial run and a corrected import-path rerun. The pinned official TCK reported 121 passed and 142 skipped, with signing left for manual verification. The JavaScript SDK completed both transports, verified the example card and refused the altered handoff. |
Codex review on #2828: - Canonical bytes follow A2A 1.0 section 8.4.1 field presence from the proto's REQUIRED markers, so the bearer requirement and empty REQUIRED fields are signed. A served card with fields outside the schema is refused. - A signature is accepted only with alg/kid/typ protected and at most jwk unprotected: crit, jku and duplicated names are refused. - TCK scenario answers need a sandbox-backed bridge with no operator workflows, and refuse a non-loopback advertised URL. - Guard errors on HTTP+JSON paths use application/a2a+json. - The JavaScript harness canonicalizes from its own spec-derived presence table and checks the spec's worked example.
Independent adversarial review: REQUEST CHANGESFrom: Grok I re-reviewed this exact head (R2 after Codex's REQUEST CHANGES at Codex findings at this head
What still has to change
Tests I ran at this exact head
Generality: no per-app engine code. The Agent Card, TCK gate and JOSE header checks are protocol-generic. Held-out evidence is synthetic and local (the official TCK log and the JavaScript SDK interop on one machine, as the PR states). No real outside-party handoff is claimed. CI at this head
|
…ted llms-full.txt
…ull.txt to its refresh workflow
Independent adversarial review: APPROVEFrom: Grok I re-reviewed this exact head (R3 after my REQUEST CHANGES at Previous blockers at this head
Codex findings (unchanged since
|
The merge queue's smoke check refuses any change to a generated page. The A2A row file carries the change; the refresh workflow regenerates the page.
Independent adversarial review: APPROVEFrom: Grok I re-reviewed this exact head (R4 after my APPROVE at What changed since
|
What
Closes the A2A conformance gaps in
openadapt agent serve --a2a.1. Signed Agent Card
kidis the key id a receiver already pins for handoffs.signer.sign, so keychain and PKCS#11 keys work.verify_agent_card(card_json, {kid: raw_key})accepts only EdDSA, takes the key from the pinned set bykid, and never trusts the card'sjwkheader.2. Every automated TCK check passes
HTTP_JSON-SVC-001). HTTP+JSON responses are nowapplication/a2a+json, errors included, as 1.0.1 recommends. a2a-sdk 1.3.1 labelled only its errorsapplication/json.DM-ART-001,DM-MSG-001).--a2a-tck-scenariosanswers the TCK's scriptedtck-*messages, which itsdocs/SUT_REQUIREMENTS.mdasks every system under test to do. The answers run no workflow and touch no data. The flag needs--mode sandboxand loopback, and it's refused otherwise.benchmark/a2a_tck/2026-11-30/.3. A second implementation
benchmark/a2a_interopruns the official A2A JavaScript SDK (1.3.0) against the server. It checks the card signature withjoseandcanonicalize, which share no code with OpenAdapt or the Python SDK. Over JSON-RPC and HTTP+JSON it then:Every check passed. Evidence is in
2026-11-30/evidence.json.4. CI gap
The agent CI job installed
packages/flow[agent]withouta2a, sotest_handoff_e2e.pywas skipped in CI. It now installs the extra. One assertion had gone stale: since the check-level ladder (#2495), a stubbed run with no read-back gets anUNKNOWNreceipt. The test now asserts that the verdict copies that outcome. It fails on main too.Tests
test_handoff_e2e.py+test_mailbox.py: 51 passed locally. ruff and mypy are clean on the changed modules. The card tests:a2a-sdkverifier accepts the card;alg: nonecards are refused;The TCK-mode tests:
tck-*message is an ordinary request.Not covered