Skip to content

Conversation

@sokoliva
Copy link
Contributor

@sokoliva sokoliva commented Dec 17, 2025

This change introduces a new agent whose agent_card is signed on the server side using signer function created by create_agent_card_signer and verified on the client side using a signature_verifier function created by create_signature_verifier.

Relevant link: Agent Card Signing

Thank you for opening a Pull Request!
Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

This example demonstrated:
- Signing Agent Cards on the server side.
- Verifying Agent Card signatures on the client side.
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @sokoliva, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request delivers a robust example of an Agent-to-Agent (A2A) agent that integrates AgentCard signing and verification. The primary goal is to illustrate how agents can establish trust by cryptographically signing their identity cards, which clients can then verify. This example covers the full lifecycle from key generation and server-side signing of both public and extended agent cards, to client-side fetching and validation of these signatures, thereby enhancing the security posture of A2A interactions.

Highlights

  • New Signed Agent Example: Introduces a complete example of an A2A agent that demonstrates the signing and verification of AgentCards, showcasing secure communication practices.
  • Server-Side AgentCard Signing: The agent generates an EC key pair and uses the private key to sign both its public and authenticated extended AgentCards on the server side.
  • Client-Side Signature Verification: A dedicated test client is provided to fetch the AgentCards and verify their signatures using the corresponding public key, ensuring card authenticity.
  • Containerization Support: Includes a Containerfile for easily building and running the signed agent within a container environment, simplifying deployment and testing.
  • Comprehensive Documentation: A README.md file details how to set up, run, build, and validate the example, along with an important disclaimer regarding untrusted input in production.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a valuable example demonstrating agent card signing and verification. The implementation is well-structured, including a Containerfile and a comprehensive README.md. My review focuses on improving dependency management, container security, and adherence to standards like RFC 7515 for JWTs. I've also included minor suggestions for code style and error handling to enhance the quality of the example.

sokoliva and others added 21 commits December 17, 2025 14:28
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…ures-samples' into agent-card-signatures-samples
… formatting changes by running a `ruff format` command
…This will be changed back to WARN before merging to main
@sokoliva sokoliva changed the title feat: add Signed agent example used to demonstrate AgentCard signing and verifying feat: add signing and verifying example used to demonstrate AgentCard signing and verifying Dec 19, 2025
@sokoliva sokoliva changed the title feat: add signing and verifying example used to demonstrate AgentCard signing and verifying feat: add signing and verifying example used to demonstrate AgentCard signing and verifying Dec 19, 2025
- remove reading of `public_keys.json` in main
- add .gitignore
- remove `SignedAgent` in `agent_executor.py`
- replace `_public_agent` with `public_agent` in `test_client.py`
@sokoliva sokoliva merged commit 36176fa into a2aproject:main Dec 22, 2025
2 checks passed
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