Agent-to-Agent (A2A)

7 min read

The Agent2Agent (A2A) protocol is an open standard for communication between independent agents. An agent publishes an Agent Card that describes what it can do, where to reach it and how to authenticate. Other agents send it messages over JSON-RPC and follow the resulting task until it is done. Agents stay opaque to each other. They share results, not internals.

Unique supports A2A 1.0 in both directions through an optional A2A gateway:

  • Way in. A Space Admin publishes a space as an A2A agent. External agents call it.

  • Way out. A Space Admin connects an external A2A agent as a space. Users chat with it, and other spaces use it as a sub-agent.

Availability. A2A requires the A2A gateway to be deployed for your environment and the feature flag FEATURE_FLAG_ENABLE_A2A to be enabled. Without it, no A2A settings appear in the admin interface and nothing else changes. Contact your Customer Success representative to get it enabled.

Way in: publish a space as an A2A agent

One published space is one A2A agent. Every Space Admin can publish the spaces they manage.

  1. Open the space in the admin interface and go to Advanced Settings.

  2. Open the A2A section and switch A2A publication to Enabled.

  3. Fill in the Agent Card. Only these fields are shown to callers. Internal names, models, prompts and tools stay private.

  4. Click Publish. The section now shows the Agent Card URL, the Agent URL and the state Published.

Field

Purpose

External name

Name of the agent as callers see it. Required.

External description

What the agent does, written for another agent. Required. Callers decide from this text when to use your agent, so be specific.

Documentation URL, Icon URL

Optional. HTTPS only.

Skills

Optional. One entry per capability with Identifier, Name, Description, Tags and Examples. Skills help callers pick the right agent for a request.

Share the Agent Card URL with the team that integrates the external agent. Everything they need is in the card.

To stop publishing, switch A2A publication to Disabled. New calls are rejected immediately. Tasks that are already running finish and stay readable for their owner. Deleting the space also retracts the publication.

Only native spaces can be published. An A2A External Agent space (see below) can never be published again over A2A.

Way out: connect an external A2A agent

An external agent is connected as a space of its own type. Nothing is discovered automatically. You enter the Agent Card URL, provide the credential the agent asks for, test the connection, and save.

  1. In the admin interface, click Create Space and choose A2A External Agent.

  2. Enter a Name and Description. These are shown to your users.

  3. Enter the Agent card URL of the external agent. HTTPS only. The host must be on the allowlist configured by your IT operator.

  4. Unique reads the Agent Card and shows the Authentication the agent requires. Enter the matching credential.

  5. Click Test connection. The Agent preview shows the agent's name, version, provider, skills, authentication and whether it supports streaming.

  6. Optionally enable Sub-Agent so other spaces can delegate to this agent.

  7. Click Create external space. Then grant users access as for any other space.

Authentication follows the Agent Card

The external agent declares in its Agent Card which security schemes it accepts. Unique supports every scheme defined by A2A 1.0 and uses the one the card requires. You only provide the credential.

Scheme in the Agent Card

What you enter

How Unique calls the agent

None

Nothing

Unauthenticated. The connection test warns if the card requires a scheme and none is configured.

API key

The key

Sent in the header, query parameter or cookie named by the card. Shared by all users of the space.

HTTP (Bearer, Basic or another HTTP scheme)

The token, or username and password

Sent in the Authorization header with the scheme named by the card. Shared by all users of the space.

OAuth 2.0

Client ID, client secret and, if required, scopes

Client credentials flow: Unique obtains one token for the space and refreshes it before it expires. Shared by all users.
Authorization code flow: each user signs in to the external agent once, from the chat. Unique stores the user's token and calls the agent on behalf of that user.

OpenID Connect

Client ID, client secret and, if required, scopes

Unique discovers the endpoints from the issuer declared in the card and proceeds as for OAuth 2.0, shared or on behalf of the user depending on the flow.

Mutual TLS

Client certificate and private key

Presented on every connection to the agent. Shared by all users of the space.

If the card offers several schemes, you pick one. If the card changes its requirements later, the connection test tells you what is missing.

Shared or on behalf of the user. With a shared credential, every user of the space calls the external agent with the same identity, and the external agent does not see individual Unique users. With a per-user flow, Unique calls the external agent on behalf of the signed-in user, exactly as external agents call Unique inbound. The external agent then applies that user's own permissions. Users who have not signed in yet are asked to do so in the chat the first time they use the space.

Secrets are write-only and encrypted. Use Rotate credential to replace a client secret, key or certificate without recreating the space. Per-user tokens are refreshed automatically and revoked when the user's access to the space is removed.

Model, tools and instructions of an external space are managed by the external provider. The space therefore has no module, prompt, model or knowledge settings, and it cannot be duplicated, exported or imported.

Using an external agent

  • Direct chat. Users with access open the space and chat as usual. Answers stream in. Structured data is shown as JSON, files are attached to the chat, and Stop cancels the remote task.

  • As a sub-agent. Enable Sub-Agent on the external space and add it in the parent space under Sources & Tools → Sub-agents, exactly like a native sub-agent. See Sub Agent.

  • Clarifications. If the external agent needs input, the user gets a form in the chat. If it needs a login, the user gets a link. Nothing is approved automatically.

Identity and permissions

Way in (published space)

Way out (external agent)

Who calls

An external agent acting for a human user of your Unique tenant.

A Unique user, directly or through a parent space.

How it authenticates

The user signs in to Unique IAM (Zitadel) through the external client. The client sends the user's access token with every call. No machine-to-machine clients.

With the scheme the external Agent Card requires: a shared credential of the space, or the user's own token when the card offers a per-user OAuth flow.

Whose rights apply

The signed-in user's. Space access and knowledge base permissions are checked on every call, like in the chat UI.

Space access decides who may use the external agent. With a per-user flow, the external agent additionally applies that user's rights on its side.

What is visible to the other side

Only the published Agent Card fields, the answer, references and generated files. Never prompts, tool traces, model names or other users' tasks.

The message text, selected chat files if the agent accepts them, and answers to its clarifications. With a shared credential, no Unique identity. With a per-user flow, the identity the user signed in with.

Audit

Every call creates a chat in the space and is logged like any other interaction. Publication and connection changes are recorded by the gateway.

For developers: calling a published space

A published space behaves like any A2A 1.0 agent with the JSON-RPC binding. Use the official A2A SDK of your framework or plain HTTPS.

Endpoint

Auth

Purpose

GET {Agent Card URL}

None

Agent Card. Lists skills, the JSON-RPC URL and the OpenID Connect security scheme.

POST {Agent URL}

Bearer token

JSON-RPC endpoint. Send header A2A-Version: 1.0.

GET {gateway}/a2a/agents

Bearer token

Catalog of all published spaces the signed-in user may use. Unique-specific convenience, not part of A2A.

Authentication. Let the user sign in to your Unique tenant with the standard OpenID Connect authorization code flow with PKCE. Send the resulting access token as Authorization: Bearer. Each request needs a valid token for the same user. A running task continues when the token expires. You need a fresh token to read it again.

Mapping.

A2A

Unique

contextId

One chat. Reuse it for follow-up messages to keep the conversation.

taskId

One user message and its answer. A follow-up creates a new task in the same context. One active task per context at a time.

TASK_STATE_INPUT_REQUIRED

The space asks a question. The schema arrives as a data part. Answer with SendMessage on the same task.

TASK_STATE_AUTH_REQUIRED

The space needs the user to complete a login. The link arrives in the status message.

Artifacts

Answer text (text), references (data part with metadata.kind = "unique.references") and generated files (file with a download URL on the gateway).

Supported operations. SendMessage, SendStreamingMessage, GetTask, ListTasks, CancelTask, SubscribeToTask, push notification configuration and GetExtendedAgentCard. Streaming uses server-sent events. A non-streaming SendMessage waits up to 30 seconds and then returns the task in state WORKING for polling.

Inputs. text parts, data parts and file parts with inline bytes. File parts by URI are rejected.

json
POST {Agent URL}
Authorization: Bearer {access token}
A2A-Version: 1.0
Content-Type: application/json

{
  "jsonrpc": "2.0",
  "id": "1",
  "method": "SendMessage",
  "params": {
    "message": {
      "role": "ROLE_USER",
      "parts": [{ "text": "Summarise the Q3 risk report." }]
    }
  }
}

Limitations

  • A2A 1.0 with the JSON-RPC binding only. No 0.3, no REST or gRPC bindings, no protocol extensions, no signed Agent Cards.

  • Inbound calls require a signed-in human user. Machine-to-machine clients are not supported.

  • Per-user authentication to an external agent requires the agent to offer an OAuth 2.0 or OpenID Connect flow with user sign-in. API keys, HTTP schemes and client credentials are always shared.

  • Unique does not use push notifications as a client. It streams or polls the external agent.

  • Streaming is limited to 20 concurrent streams per user.

Last updated