Skip to content

fix(signature): canonicalize the same payload when signing and verifying - #606

Merged
JakubWorek merged 1 commit into
mainfrom
jakubworek/fix-agent-card-signature
Jul 28, 2026
Merged

fix(signature): canonicalize the same payload when signing and verifying#606
JakubWorek merged 1 commit into
mainfrom
jakubworek/fix-agent-card-signature

Conversation

@JakubWorek

@JakubWorek JakubWorek commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Description

generateAgentCardSignature canonicalized the card as supplied, while
verifyAgentCardSignature canonicalized the proto-normalized card. A card
carrying an explicit protobuf default (e.g. capabilities.extensions[].required: false) was therefore signed with that member present and verified with it
absent, so the SDK rejected a signature it had just generated.

Moved the AgentCard.fromJSON / toJSON normalization (and the signatures
exclusion) into canonicalizeAgentCard, so both paths share one
canonicalization. Matches the Python SDK, which has always used a single shared
_canonicalize_agent_card() helper.

Fixes #605 🦕

@JakubWorek
JakubWorek requested a review from a team as a code owner July 28, 2026 09:45
@github-actions

Copy link
Copy Markdown

🧪 Code Coverage

⬇️ Download Full Report

Base PR Delta
src/signature.ts 94.11% 92.23% 🔴 -1.88%
Total 90.91% 90.9% 🔴 -0.01%

Generated by coverage-comment.yml

@JakubWorek
JakubWorek merged commit 7415e0e into main Jul 28, 2026
17 of 20 checks passed
@JakubWorek
JakubWorek deleted the jakubworek/fix-agent-card-signature branch July 28, 2026 10:19
bartek-gralewicz pushed a commit that referenced this pull request Jul 28, 2026
🤖 I have created a release *beep* *boop*
---


## [1.0.1](v1.0.0...v1.0.1)
(2026-07-28)


### Bug Fixes

* **compat/v0_3:** call context builder for compatibility layer
([#604](#604))
([771836c](771836c)),
closes [#600](#600)
* normalize legacy cards in createFromAgentCard
([#602](#602))
([9807a66](9807a66)),
closes [#601](#601)
* **signature:** canonicalize the same payload when signing and
verifying ([#606](#606))
([7415e0e](7415e0e))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

[Bug]: Agent card generated signature can fail its own verifier after protobuf normalization

2 participants