Skip to main content
A2A (Agent-to-Agent) lets you expose an agent as a standards-compliant HTTP server or connect remote A2A agents as tool providers for your LLM. A2A vs sub-agents: sub-agents are in-process Go agents registered at build time — they share the same deployment and runtime. A2A connects agents that run in separate services, possibly in different languages or owned by different teams. The integration boundary is an HTTP JSON-RPC call, not a Go function call. When you connect a remote A2A agent, the SDK fetches its agent card at NewAgent, discovers its published skills, and registers each skill as a tool named a2a_<server>_<skillId>. The LLM sees these tools identically to native tools and can invoke them in any run.

A2A server

Any agent can be exposed as an A2A HTTP server. Call RunA2A(ctx) after NewAgent — the server blocks until the context is cancelled, then shuts down gracefully. Endpoints:
The server accepts JSON-RPC v2 only (PascalCase methods: SendMessage, SendStreamingMessage, GetTask). Legacy slash-style method strings and HTTP REST paths are not supported.

Custom server config

Currently supported auth scheme: static bearer token. OAuth 2.0 / OIDC, API key, and mTLS are planned but not yet implemented.
See A2A Server example.

A2A client

Remote A2A agents connect as tool providers. The SDK resolves the agent card at NewAgent, discovers published skills, applies any SkillFilter, and registers each as a tool named a2a_<server>_<skillId>. Setup fails fast if a server is unreachable.

WithA2AConfig

WithA2AClients

SkipTLSVerify is available on client config for local HTTPS development only — avoid using it in production.

Runtime changes

Add or remove A2A agents after NewAgent via a.A2ARegistry() — skills are re-discovered on each run using the current registry state, with no restart required.

Examples

A2A Server

Inbound agent card and JSON-RPC

A2A Config

Outbound WithA2AConfig

A2A Client

Outbound WithA2AClients

Sub-agents

In-process specialist delegation

Approvals

A2A skills follow the same approval policy