Skip to content

feat(a2a): signed Agent Card and every automated TCK check passing - #2828

Merged
abrichr merged 11 commits into
mainfrom
feat/a2a-signed-agent-card
Dec 1, 2026
Merged

abrichr merged 11 commits into
mainfrom
feat/a2a-signed-agent-card

Conversation

@abrichr

@abrichr abrichr commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

What

Closes the A2A conformance gaps in openadapt agent serve --a2a.

1. Signed Agent Card

  • Format. A2A 1.0 section 8.4: an EdDSA JWS over the card's RFC 8785 canonical form, on both the public and the extended card.
  • Key. The signing key is this computer's Seal key, the one that signs its run receipts. The kid is the key id a receiver already pins for handoffs.
  • Signing. The JWS is built from signer.sign, so keychain and PKCS#11 keys work.
  • Fails closed. If the key can't be opened, the server doesn't start.
  • Verifying. verify_agent_card(card_json, {kid: raw_key}) accepts only EdDSA, takes the key from the pinned set by kid, and never trusts the card's jwk header.

2. Every automated TCK check passes

  • Error media type (HTTP_JSON-SVC-001). HTTP+JSON responses are now application/a2a+json, errors included, as 1.0.1 recommends. a2a-sdk 1.3.1 labelled only its errors application/json.
  • Scripted scenarios (DM-ART-001, DM-MSG-001). --a2a-tck-scenarios answers the TCK's scripted tck-* messages, which its docs/SUT_REQUIREMENTS.md asks every system under test to do. The answers run no workflow and touch no data. The flag needs --mode sandbox and loopback, and it's refused otherwise.
  • TCK result. At 5e6f37c on 2026-11-30: 121 passed, 0 failed, 142 skipped (gRPC, push, cancel and auth scenarios the server doesn't offer). MUST is 78.7%, because the TCK counts skipped and manual checks as not passed. Evidence is in benchmark/a2a_tck/2026-11-30/.

3. A second implementation

benchmark/a2a_interop runs the official A2A JavaScript SDK (1.3.0) against the server. It checks the card signature with jose and canonicalize, which share no code with OpenAdapt or the Python SDK. Over JSON-RPC and HTTP+JSON it then:

  • runs a sandbox workflow;
  • verifies a second key's handoff;
  • refuses a tampered handoff.

Every check passed. Evidence is in 2026-11-30/evidence.json.

4. CI gap

The agent CI job installed packages/flow[agent] without a2a, so test_handoff_e2e.py was 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 an UNKNOWN receipt. 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:

  • the official a2a-sdk verifier accepts the card;
  • changed, unpinned, unsigned and alg: none cards are refused;
  • a second untrusted signature doesn't block the valid one;
  • both cards are signed off loopback;
  • an unopenable key means no app is built.

The TCK-mode tests:

  • the flag is refused outside sandbox and off loopback;
  • each scripted answer is correct;
  • with the flag off, a tck-* message is an ordinary request.

Not covered

  • No real outside party. Both parties in the interop run are keys on one computer. No handoff has gone to another organisation.
  • No standards submission. The handoff-receipt extension hasn't been submitted to any standards body.
  • Receipt coverage. Receipts for sandbox and strict at-rest runs are being handled in a separate PR.

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.
@abrichr abrichr changed the title feat(a2a): sign the Agent Card with the receipt key feat(a2a): signed Agent Card and every automated TCK check passing Nov 30, 2026
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.
@abrichr

abrichr commented Nov 30, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: REQUEST CHANGES

From: Codex
Reviewed-Head: 855585f

  1. The signature omits the card’s bearer requirement. I compared a generated token-protected card with its canonical bytes. The served card contains securityRequirements with a bearer entry. The signed bytes omit the entire field. The same recursive cleanup drops the required empty description and skills in the specification’s worked example. Use field-presence rules before JCS and test the expected bytes independently. The JavaScript harness repeats the Python cleanup. Canonicalizer · A2A §8.4.1
  2. The verifier ignores critical JWS headers. It checks the protected algorithm and key ID but accepts a signature from a pinned key even when it specifies an unsupported critical extension. It also ignores collisions with unprotected header names. Validate the complete JOSE header before accepting a signature. Verifier · RFC 7515 §5.2
  3. The TCK gate trusts a mode label. The CLI selects a sandbox engine, but the ASGI builder also accepts a bridge with real workflow engines if its mode says sandbox. The positive test itself relabels the production bridge. Require a sandbox-backed bridge and use one in the positive test. The loopback check should also reject an explicitly advertised non-loopback public URL while TCK answers are enabled. Startup guard

One smaller HTTP issue remains. REST guard errors (401, 403 and 421) return application/json before the new media-type handling runs. Guard response

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.
@abrichr

abrichr commented Dec 1, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: REQUEST CHANGES

From: Grok
Reviewed-Head: 91b0a56

I re-reviewed this exact head (R2 after Codex's REQUEST CHANGES at 855585f0). The three Codex findings and the REST media-type issue are fixed. I am not approving yet: smoke/ci is red because this PR hand-edits a generated page, and the branch conflicts with main.

Codex findings at this head

  1. Canonical card bytes follow A2A 1.0 §8.4.1 presence rules. _present_fields keeps REQUIRED fields (including empty description/skills in the spec example) and explicit presence; a token card's securityRequirements bearer entry is in the signed bytes. A JSON card is parsed into AgentCard first, so an unknown field is refused rather than left unsigned. Covered by test_canonical_card_follows_the_spec_presence_rules and test_a_token_cards_bearer_requirement_is_signed.
  2. The verifier checks the whole JOSE header. _card_header allows only alg/kid/typ in the protected header and jwk in the unprotected header; crit, jku, a duplicated name, or a typ other than JOSE are skipped. The key still comes from the pinned set by kid, never from the card's jwk. Covered by test_card_verifier_checks_the_whole_jose_header.
  3. TCK mode no longer trusts a mode label. build_app requires mode == "sandbox", a non-null sandbox, no bundles_dir, and no workflows. Relabelling the production fixture is refused. An advertised non-loopback public_url is refused even when the listen host is loopback; http://localhost:9999 is allowed. Covered by test_tck_scenarios_need_sandbox_and_loopback and the sandbox_bridge fixture used by the positive TCK test.
  4. REST guard errors (401/403/421) are application/a2a+json. JSON-RPC guard errors stay application/json. Covered by test_guard_errors_use_the_a2a_media_type_on_rest and the existing HTTP_JSON-SVC-001 test.

What still has to change

  1. llms-full.txt is a generated page this PR edited by hand, and the committed text is stale. python3 scripts/build_capabilities.py --check-pr origin/main fails, which is why the smoke job's "No generated page was edited by hand" step is red (ci, run-ci and packages-gate follow it). The committed file still has the retracted summary lines ("0% silent errors" across 60 upgrades, "0 / 96 prompt injections succeeded on AgentDojo"). Regenerating from current sources produces the ledger-backed results table. Please drop the hand edit (git checkout origin/main -- llms-full.txt, or regenerate so the file matches scripts/build_llms_full.py) and leave the refresh workflow to update it after merge.
  2. This branch conflicts with current origin/main on scripts/build_results_table.py. I did not merge main into this branch. The conflict is wrapping of the ArgumentParser(..., allow_abbrev=False) line already on main. The author should merge or rebase onto current main and resolve it.

Tests I ran at this exact head

  • packages/agent/tests/test_handoff_e2e.py and test_mailbox.py: 55 passed.
  • ruff check on the changed Flow modules: clean.
  • packages/flow/scripts/check_engine_generality.py: "Engine generality OK (7 baseline hits left)".

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

  • review-verdict is red because the newest posted review was still Codex REQUEST CHANGES at 855585f0, not this head.
  • Smoke/ci/packages-gate/run-ci are red on the generated-page check above. Package unit, type and lint jobs on the status rollup had passed.
  • I am not merging. No release decision from me.

@abrichr

abrichr commented Dec 1, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: APPROVE

From: Grok
Reviewed-Head: f65df38

I re-reviewed this exact head (R3 after my REQUEST CHANGES at 91b0a568). The two blockers from that review are fixed. There is no A2A or TCK code change since 91b0a568 (git diff 91b0a568 f65df380 on the A2A modules is empty). I am not merging.

Previous blockers at this head

  1. llms-full.txt is no longer a hand edit. It is byte-identical to current main (dd8bb971). python3 scripts/build_capabilities.py --check-pr dd8bb971 passes, and --guard passes. Smoke is green. CAPABILITIES.md was regenerated from the row files (the A2A row, and the feat(quickstart): replace act 3 with a crash and restart of a batch #2840 quickstart-restart row that already exists as a source file on main). Further llms-full.txt refresh stays with the post-merge workflow.
  2. The conflict with main on scripts/build_results_table.py is gone. This head contains current main (dd8bb971) and keeps main's allow_abbrev=False line. The PR is MERGEABLE.

Codex findings (unchanged since 91b0a568, still hold)

  1. Canonical card bytes follow A2A 1.0 §8.4.1 presence rules. _present_fields keeps REQUIRED fields (including empty description/skills in the spec example) and explicit presence; a token card's securityRequirements bearer entry is in the signed bytes. A JSON card is parsed into AgentCard first, so an unknown field is refused rather than left unsigned. Covered by test_canonical_card_follows_the_spec_presence_rules and test_a_token_cards_bearer_requirement_is_signed.
  2. The verifier checks the whole JOSE header. _card_header allows only alg/kid/typ in the protected header and jwk in the unprotected header; crit, jku, a duplicated name, or a typ other than JOSE are skipped. The key still comes from the pinned set by kid, never from the card's jwk. Covered by test_card_verifier_checks_the_whole_jose_header.
  3. TCK mode no longer trusts a mode label. build_app requires mode == "sandbox", a non-null sandbox, no bundles_dir, and no workflows. Relabelling the production fixture is refused. An advertised non-loopback public_url is refused even when the listen host is loopback; http://localhost:9999 is allowed. Covered by test_tck_scenarios_need_sandbox_and_loopback and the sandbox_bridge fixture used by the positive TCK test.
  4. REST guard errors (401/403/421) are application/a2a+json. JSON-RPC guard errors stay application/json. Covered by test_guard_errors_use_the_a2a_media_type_on_rest and the existing HTTP_JSON-SVC-001 test.

Tests I ran at this exact head

  • packages/agent/tests/test_handoff_e2e.py and test_mailbox.py: 55 passed (from packages/agent).
  • ruff check on the changed Flow modules: clean.
  • packages/flow/scripts/check_engine_generality.py: "Engine generality OK (7 baseline hits left)".
  • scripts/build_capabilities.py --check-pr dd8bb971 and --guard: pass.

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

No release decision from me.

@abrichr
abrichr enabled auto-merge December 1, 2026 05:27
@abrichr
abrichr added this pull request to the merge queue Dec 1, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Dec 1, 2026
@abrichr
abrichr added this pull request to the merge queue Dec 1, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Dec 1, 2026
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.
@abrichr

abrichr commented Dec 1, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: APPROVE

From: Grok
Reviewed-Head: 3578593

I re-reviewed this exact head (R4 after my APPROVE at f65df380). The unique A2A and TCK code is unchanged. The merge-queue smoke failure on generated pages is fixed. I am not merging.

What changed since f65df380

  • Unique-to-PR files (git diff f65df380 HEAD on origin/main...HEAD) are empty. There is no A2A, TCK, or Agent Card logic change.
  • Commit 3578593f8 only restores CAPABILITIES.md and capabilities/CAPABILITIES.md.sha256. Those two files and llms-full.txt are now byte-identical to current main (2624f1000).
  • The A2A row file under capabilities/10-computer-use-agents/ still carries the signed-card and TCK evidence change. The refresh workflow rebuilds the page after merge.
  • This head contains the #2866 main merge, so the inherited run_quickstart(..., break_it=True) TypeError is gone.

Previous findings (unchanged, still hold)

The Codex and earlier Grok findings at f65df380 still apply: canonical card bytes follow A2A 1.0 §8.4.1 presence rules; the verifier checks the whole JOSE header and pins the key by kid; TCK mode requires a real sandbox and loopback; REST guard errors use application/a2a+json.

Checks I ran at this exact head

  • python3 scripts/build_capabilities.py --check-pr origin/main: pass.
  • python3 scripts/build_capabilities.py --guard: pass.
  • packages/flow/scripts/check_engine_generality.py: "Engine generality OK (7 baseline hits left)".

Generality: no per-app engine code. Held-out evidence remains synthetic and local, as the row file states. No real outside-party handoff is claimed.

CI at this head

Packages (including flow unit and default-at-rest shards, smoke, launcher, desktop tests) are green. review-verdict is red because the newest posted review was still my APPROVE at f65df380, not this head.

This branch does not contain #2853. That change is unrelated; GitHub reports MERGEABLE. I did not merge main.

No release decision from me.

@abrichr
abrichr added this pull request to the merge queue Dec 1, 2026
Merged via the queue into main with commit 31e1492 Dec 1, 2026
59 of 60 checks passed
@abrichr
abrichr deleted the feat/a2a-signed-agent-card branch December 1, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant