Connecting external agents
Connect an external agent to your Runtype A2A Surface so it can discover and invoke your Capabilities through the Agent-to-Agent (A2A) protocol.
Before you begin
Before you connect an external agent, prepare the following:
- An active A2A Surface in Runtype.
- The Agent Card URL from the Endpoints tab.
- An API key with the
a2a_prefix. - Access to the external agent platform.
Choose a connection method
Choose the method that matches the external agent platform:
Connect through an A2A-compatible platform
For a platform with native A2A support, follow these steps:
-
Create an agent connection in the external platform.
-
Select A2A or Agent-to-Agent as the connection type.
-
Enter the Agent Card URL:
Replace
YOUR_PRODUCT_IDwith your Product ID andYOUR_SURFACE_IDwith your Surface ID. -
Configure the connection to use a Bearer token.
-
Enter the API key from the Keys tab as the token.
-
Save the connection and run its test.
The platform reads your skills from the Agent Card after it connects.
Build a custom integration
For a platform without native A2A support, fetch the Agent Card and send a JSON-RPC request with the following Python code:
Replace the placeholders in the sample as follows:
YOUR_PRODUCT_ID: your Product ID.YOUR_SURFACE_ID: your Surface ID.YOUR_SKILL_NAME: a skill name from the Agent Card.a2a_YOUR_API_KEY: the key from the Keys tab.
In Managed mode, remove the metadata object so Runtype routes the request to a Capability.
Runtype also accepts the legacy v0.3 message/send method alias and typed
message parts. Use the v1.0 method names and member-presence parts for new
integrations.
Provide authentication
The Agent Card discovery endpoint is public, but the JSON-RPC invocation endpoint requires a valid A2A key.
To create a key, follow these steps:
- On your A2A Surface, open the Keys tab.
- Click Create Key.
- Enter a name for the key and click Create Key.
- Share the generated key with the external agent operator.
For each invocation, the external agent can send the key in an
Authorization: Bearer header or an X-API-Key header. Create a separate API
key for each external agent or organization to track usage and revoke access
independently.
Test the connection
To verify that the external agent can invoke your Capabilities, follow these steps:
- Fetch the Agent Card from the external agent platform.
- Confirm that the Agent Card lists your skills.
- Invoke a skill with the
SendMessagemethod. - Open the execution logs in Runtype and confirm that the invocation appears.
- Confirm that the external agent receives the response.
Use a fallback agent
Use a fallback when a local agent cannot handle a request. This example treats
responses with confidence less than 0.5 as fallback cases:
Pass an asynchronous local agent function, the A2A endpoint URL, and the A2A
API key to handleCustomerQuery.
Next steps
- How A2A works: A2A protocol format and task lifecycle
- Setting up an A2A Surface: A2A Surface creation and authentication
- What are Surfaces?: Surface types and use cases