Skip to content

feat(core): add agent-to-agent communication - #118

Open
Subhajitdas99 wants to merge 1 commit into
Zizka-ai:mainfrom
Subhajitdas99:feat/a2a-communication-wedge
Open

feat(core): add agent-to-agent communication#118
Subhajitdas99 wants to merge 1 commit into
Zizka-ai:mainfrom
Subhajitdas99:feat/a2a-communication-wedge

Conversation

@Subhajitdas99

Copy link
Copy Markdown
Contributor

Summary

Adds authenticated agent-to-agent communication within a tenant.

Changes

  • Add POST /v1/a2a/messages
  • Require agent-scoped API keys for A2A communication
  • Derive the sender exclusively from the authenticated API key
  • Prevent cross-tenant recipient access
  • Prevent agents from messaging themselves
  • Persist A2A messages through the existing event write path
  • Preserve session and correlation identifiers
  • Support optional message metadata
  • Add comprehensive A2A tests

Testing

  • python -m pytest core/tests/test_a2a.py -v — 9 passed
  • python -m pytest core/tests/test_a2a.py core/tests/test_route_authz.py core/tests/test_tenant_isolation.py -v — 24 passed
  • python -m compileall core — passed
  • git diff --check — passed

@Subhajitdas99

Copy link
Copy Markdown
Contributor Author

Thanks! All three CI checks are now passing and the branch is conflict-free. The A2A implementation is ready for review.

@saadamjad

Copy link
Copy Markdown
Collaborator

@Subhajitdas99 could you please confirm how this is currently working? It would be great if you could also share some screenshots of the working flow.

@Subhajitdas99

Copy link
Copy Markdown
Contributor Author

Hi @saadamjad, sure. The current A2A flow works through POST /v1/a2a/messages.

The request is authenticated using an agent-scoped API key.
The sender agent is derived from the authenticated API key rather than being accepted from the request body.
The recipient is looked up using both tenant_id and agent_id, so cross-tenant recipients are rejected.
An agent cannot send a message to itself.
Once validated, the message is persisted through the existing write_event() path as an a2a.message event.
session_id, correlation_id, and optional metadata are preserved.
The existing event pipeline can then handle embedding/indexing as it normally does.

I tested the implementation with 9 dedicated A2A tests and the related authorization/tenant-isolation tests (24 total), and all three CI checks are passing.

I'll add screenshots showing the successful request and the authorization/tenant-isolation behavior.

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