Orchard Core A2A Host
The A2A Host feature makes every AI profile of type Agent discoverable and callable by external A2A clients, including another Orchard Core site running the A2A Client feature (orchardcore-ai-a2a-client).
Guidelines
- Feature ID
CrestApps.OrchardCore.AI.A2A.Host, in theCrestApps.OrchardCore.AI.A2Apackage (install it in the web/startup project). It depends only onCrestApps.OrchardCore.AI. - Only profiles whose
TypeisAgentare exposed. TheirNameidentifies the agent and theirDescriptionbecomes the card and skill description. - Cards follow A2A 1.0: each card publishes its endpoint in
supportedInterfaces(protocol binding JSON-RPC). The deprecated top-levelurlis no longer emitted. - The discovery endpoint is always anonymous so clients can read the authentication requirements. The
/a2aendpoint is protected by theA2AHostPolicypolicy. - Options come from shell configuration only (no admin settings page). Default authentication is
OpenId. - Use
Noneonly for local development.
Enable the feature
{
"steps": [
{
"name": "Feature",
"enable": [
"CrestApps.OrchardCore.AI",
"CrestApps.OrchardCore.AI.A2A.Host"
],
"disable": []
}
]
}
Create agent profiles
Create an AI profile with Profile type set to Agent in the admin, or import one. Bind deployments by technical name; see orchardcore-ai for the full profile contract.
{
"steps": [
{
"name": "AIProfile",
"profiles": [
{
"Name": "research-agent",
"DisplayText": "Research Agent",
"Description": "Researches topics and returns sourced summaries.",
"Type": "Agent",
"ChatDeploymentName": "research-chat",
"Properties": {
"AIProfileMetadata": {
"SystemMessage": "You are a research assistant.",
"Temperature": 0.2,
"MaxTokens": 4096
},
"AgentMetadata": {
"Availability": "OnDemand"
}
}
}
]
}
]
}
Endpoints
| Endpoint | Purpose |
|---|---|
| GET /.well-known/agent-card.json | Discovery. A JSON array of cards in multi-agent mode, one combined card in skill mode. |
| /a2a | A2A JSON-RPC endpoint. |
| /a2a?agent={agentName} | Targets one agent in multi-agent mode. |
Messages are routed by the agent query parameter first, then by an agentName entry in the message metadata, and otherwise to the first agent profile. The host supports streaming; task subscription and push notifications are not supported.
Exposure modes
| Mode | Setting | Card shape |
|---|---|---|
| Multi-agent (default) | ExposeAgentsAsSkill: false | One card per agent; each supportedInterfaces entry points to /a2a?agent={agentName} |
| Skill | ExposeAgentsAsSkill: true | One card whose skills are the agents; clients route with agentName metadata |
A multi-agent card looks like this (trimmed):
[
{
"name": "Research Agent",
"description": "Researches topics and returns sourced summaries.",
"supportedInterfaces": [
{ "url": "https://example.com/a2a?agent=research-agent", "protocolBinding": "JSONRPC" }
],
"capabilities": { "streaming": true }
}
]
Configuration
{
"OrchardCore": {
"CrestApps": {
"AI": {
"A2AHost": {
"AuthenticationType": "ApiKey",
"ApiKey": "{{A2AHostApiKey}}",
"RequireAccessPermission": true,
"ExposeAgentsAsSkill": false
}
}
}
}
}
| Setting | Default | Description |
|---|---|---|
| AuthenticationType | OpenId | OpenId, ApiKey, or None |
| ApiKey | | Key required in ApiKey mode |
| RequireAccessPermission | true | Authenticated callers also need AccessA2AHost |
| ExposeAgentsAsSkill | false | Combine all agents into one card |
The older OrchardCore:CrestApps:A2AHost section is still read first for backward compatibility; prefer OrchardCore:CrestApps:AI:A2AHost. Configuration changes need an app restart.
Authentication on the card
| Mode | Advertised security scheme | Client sends |
|---|---|---|
| OpenId | openId, with {host}/.well-known/openid-configuration | Authorization: Bearer <token> from the Orchard Core OpenID server (Api scheme) |
| ApiKey | apiKey in the Authorization header | Authorization: Bearer <key> or Authorization: ApiKey <key> |
| None | none | nothing |
AccessA2AHost is security critical and is not granted to any role by default; grant it to the role or OpenID application that calls the host.
Usage analytics
Completions run for A2A requests are labelled with the A2A usage category, so they appear under that category in AI Usage Analytics (orchardcore-ai-usage-analytics).
Upgrading from 2.x
- Cards no longer contain the top-level
url. Clients must read the endpoint fromsupportedInterfaces. The CrestApps A2A client already does. - Multi-agent mode still points each interface at
/a2a?agent={agentName}. - Move configuration from
OrchardCore:CrestApps:A2AHosttoOrchardCore:CrestApps:AI:A2AHost.
Troubleshooting
| Symptom | Check |
|---|---|
| The card array is empty | No AI profile has type Agent. |
| A client reports a missing endpoint | It still reads url; update it to A2A 1.0 supportedInterfaces. |
| 401 or 403 on /a2a | Credentials do not match AuthenticationType, or the caller lacks AccessA2AHost. |
| Card URLs miss the tenant prefix | Card URLs are built from the request scheme and host. Verify the advertised interface URL on prefixed tenants and behind reverse proxies. |
| The wrong agent answers | Send ?agent={name} (multi-agent) or agentName metadata (skill mode); otherwise the first agent answers. |