Skip to content

feat: add VaidIdentityPlugin for verified agent identity and delegation - #190

Open
solara-associates wants to merge 1 commit into
google:mainfrom
solara-associates:feat/189-vaid-identity-plugin
Open

solara-associates wants to merge 1 commit into
google:mainfrom
solara-associates:feat/189-vaid-identity-plugin

Conversation

@solara-associates

Copy link
Copy Markdown

Related to #189

Adds VaidIdentityPlugin, a thin BasePlugin in google.adk_community.plugins over vaid-adk 0.2.0 (Apache-2.0, https://github.com/solara-associates/vaid/tree/main/python/vaid-adk).

It verifies each agent's signed identity (VAID) and delegation chain before the agent runs, before it is delegated to as a sub-agent, and before every tool call, denying fail-closed whenever any of that cannot be positively confirmed. Each identity is a signed document that can only narrow as it is delegated (scope, capabilities, expiry, tenant), verified offline with a public key, with pluggable revocation. Registered once on the Runner, it covers every agent and tool in the invocation tree, including sub-agents reached through transfer_to_agent.

This mirrors the AgentGovernancePlugin shape (#141):

  • src/google/adk_community/plugins/vaid_identity_plugin.py, exported from plugins/init.py the same way
  • pyproject optional extra: vaid = ["vaid-adk>=0.2.0,<0.3"]
  • fail-closed ImportError at import time when vaid-adk is not installed
  • contributing/samples/vaid_identity/ with a README and a runnable main.py
  • tests under tests/plugins/, following the existing plugin test naming

VaidIdentityPlugin performs no verification logic of its own; it delegates before_agent_callback and before_tool_callback to vaid_adk.VaidAuthPlugin.

Compatibility

vaid-adk 0.2.0 requires google-adk>=2.0,<3 and python>=3.10. This repo currently resolves google-adk 2.11.0 and requires python>=3.10, so no conflict and no environment marker is needed on the extra.

Testing plan

Unit tests under tests/plugins/test_vaid_identity_plugin.py cover: an allowed in-scope tool call, a denied out-of-scope call before the tool runs, a denied call for an agent with no registered presentation, a denied call for a tool with no entry in tool_authorizations, and the ImportError path when vaid-adk is absent. VAID documents are minted in-test with an Ed25519 key (cheap, no network), the same way vaid-adk's own tests do.

Pytest summary:

tests/plugins/test_vaid_identity_plugin.py::test_plugin_name PASSED
tests/plugins/test_vaid_identity_plugin.py::test_before_agent_callback_allows_registered_identity PASSED
tests/plugins/test_vaid_identity_plugin.py::test_before_agent_callback_denies_unregistered_agent PASSED
tests/plugins/test_vaid_identity_plugin.py::test_before_tool_callback_allows_in_scope_call PASSED
tests/plugins/test_vaid_identity_plugin.py::test_before_tool_callback_denies_out_of_scope_call PASSED
tests/plugins/test_vaid_identity_plugin.py::test_before_tool_callback_denies_unregistered_agent PASSED
tests/plugins/test_vaid_identity_plugin.py::test_before_tool_callback_denies_unmapped_tool_never_default_allow PASSED
tests/plugins/test_vaid_identity_plugin.py::test_raises_import_error_when_vaid_adk_missing PASSED

8 passed in 1.08s

Full suite (unrelated to this change) remains green: 82 passed, 14 skipped.

Runner E2E

contributing/samples/vaid_identity/main.py runs through a real ADK Runner with no model or API key (the two agents are plain BaseAgent subclasses, so the sample exercises the genuine ADK plugin_manager extension points rather than a mock of them). A coordinator delegates to a worker holding an attenuated VAID; the worker's in-scope tool call is allowed and its out-of-scope call is denied before the tool runs.

Command: python contributing/samples/vaid_identity/main.py

Console output:

[coordinator] delegating to worker
[worker] lookup_order: ALLOWED
[worker] issue_refund: DENIED (out_of_scope)

Install: pip install google-adk-community[vaid]

Adds a thin BasePlugin, VaidIdentityPlugin, over vaid-adk 0.2.0
(https://github.com/solara-associates/vaid, Apache-2.0). It verifies each
agent's signed identity (VAID) and delegation chain before the agent runs,
before it is delegated to as a sub-agent, and before every tool call,
denying fail-closed whenever any of that cannot be positively confirmed.

Mirrors the AgentGovernancePlugin shape (google#141): same plugins package
location, same optional-extra pattern, same fail-closed ImportError when
the extra is not installed, a sample under contributing/samples with a
README and a runnable main.py, and tests under tests/plugins.

Related to google#189.
@solara-associates
solara-associates marked this pull request as ready for review October 13, 2026 08:52
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