Skip to content

test: add algorithm agility vectors for signed agent card verification - #1438

Closed
quantova-inc wants to merge 1 commit into
a2aproject:mainfrom
quantova-inc:agent-card-algorithm-agility-vectors
Closed

quantova-inc wants to merge 1 commit into
a2aproject:mainfrom
quantova-inc:agent-card-algorithm-agility-vectors

Conversation

@quantova-inc

@quantova-inc quantova-inc commented Nov 9, 2026 •

Copy link
Copy Markdown

Signed Agent Cards carry a detached JWS over the RFC 8785 canonical card. create_signature_verifier takes an explicit list of acceptable algorithms so the algorithm named in a protected header cannot steer verification outside the chosen set. That list is the control that stops algorithm confusion and it is the seam a future algorithm extends. The present suite covers a correct key, a wrong key, a tampered card and malformed protected headers. It does not yet pin the list itself.

This change adds a focused test module that pins that behavior. Nothing under src changes and no dependency is added.

The new vectors assert that a genuine ES256 signature verifies when ES256 is on the list, that an ES256 signature is rejected when ES256 is absent from the list, that an HS256 signature is rejected against an asymmetric public key which is the classic algorithm confusion case, that the unsecured none algorithm is rejected even when a caller names it, that a protected header with no alg is rejected over genuine signature bytes and that an algorithm which is named but not registered is rejected even when it appears in both the header and the list.

The final case uses the FIPS 204 ML-DSA name to record a post quantum readiness property. A verifier does not accept an algorithm by name alone, so adding ML-DSA later stays additive and gated behind a caller opt in and a real registered implementation.

All tests pass and coverage stays above the gate.

@quantova-inc
quantova-inc requested a review from a team as a code owner November 9, 2026 15:56
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

🧪 Code Coverage (vs main)

⬇️ Download Full Report

No coverage changes.

Generated by coverage-comment.yml

@quantova-inc
quantova-inc force-pushed the agent-card-algorithm-agility-vectors branch from b217350 to 228b4a9 Compare November 9, 2026 16:02
The signed Agent Card verifier takes an explicit list of acceptable algorithms, the control that blocks algorithm confusion and the seam a future algorithm extends. This adds a test module that pins that behavior for a genuine ES256 signature, an algorithm outside the list, a symmetric signature against an asymmetric key, the unsecured none algorithm, a header with no alg and an algorithm that is named but not registered. The final case uses the FIPS 204 ML-DSA name to record that an algorithm is never accepted by name alone, so post quantum support stays additive and gated behind a real registered implementation. No source change and no new dependency.
@quantova-inc
quantova-inc force-pushed the agent-card-algorithm-agility-vectors branch from 228b4a9 to 5b03c86 Compare November 9, 2026 16:55
@quantova-inc quantova-inc changed the title test: add algorithm-agility vectors for signed agent card verification test: add algorithm agility vectors for signed agent card verification Nov 9, 2026
@Iwaniukooo11 Iwaniukooo11 self-assigned this Nov 9, 2026
@Iwaniukooo11

Iwaniukooo11 commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Thank you for the contribution, but we won't be merging this one

Coverage is unchanged, the cases don't cover behavior that tests/utils/test_signing.py doesn't already cover, and _key_provider and _fresh_card just duplicate create_key_provider and the sample_agent_card fixture from that same file.

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.

2 participants