Enable A2A communication with a Copilot Studio agent

Configure an A2A proxy so A2A callers can communicate with a Microsoft Copilot Studio agent through the gateway, with the gateway handling Direct Line protocol translation.

By the end of this guide, A2A callers will be able to communicate with a Microsoft Copilot Studio agent through the gateway, with the gateway handling Direct Line protocol translation transparently.

An A2A proxy bridges a Copilot Studio agent, which communicates over the Microsoft Direct Line polling protocol, into the gateway’s A2A pipeline. The proxy synthesises an A2A agent card for the Copilot Studio agent and translates message/send calls into Direct Line activities transparently. For background on how the gateway processes A2A traffic, see A2A protocol.

Without an A2A proxy, a Copilot Studio agent cannot be addressed by A2A callers through the gateway. Callers must implement the Direct Line polling protocol directly, and the gateway cannot apply policy or observability to those interactions.

Use this guide when:

  • You have a Copilot Studio agent published to a Direct Line channel.
  • You want A2A callers to reach the agent through a governed gateway surface.

Prerequisites

  • A running Agent Gateway instance with the dashboard accessible.
  • Administrator role on the gateway.
  • The copilot_integration feature flag enabled (on by default). Confirm it is toggled on under Settings → Admin → Feature Flags if the Proxies screen or the via A2A Proxy endpoint type is not visible.
  • A Copilot Studio agent published to the Direct Line channel, with the Direct Line channel secret available. The agent must respond correctly in the Test your agent chat panel before proceeding. See Microsoft Copilot Studio documentation for setup guidance.
  • An existing A2A surface, or permission to create one. See A2A surface starter.

Steps

Store the Direct Line secret

The proxy authenticates to Copilot Studio over the Direct Line channel. Before storing the secret in the gateway, configure authentication in Copilot Studio and retrieve the channel secret.

In Copilot Studio:

  1. Open your agent and go to Settings → Security.
  2. Under Authentication, select No Authentication and save.
  3. On the same page, locate the Web Channel Security section, enable the Require secured access toggle, and copy the channel secret shown there.

In the Agent Gateway dashboard:

A2A Proxy Copilot DL
  1. Navigate to Management → Secrets.
  2. Select New Secret.
  3. Fill in the fields:
    • Secret Name: a descriptive label, for example Copilot Direct Line Secret.
    • Secret Type: select Token.
    • Secret Value: paste the Direct Line channel secret you copied from Copilot Studio.
  4. Select Save.

For details on secret types and storage, see Secrets reference.

Create the A2A proxy

  1. Navigate to Proxies in the sidebar.
  2. Select Add A2A Proxy.

The editor opens with three tabs: Overview, Backend, and Agent Card.

A2A Proxy Copilot DL

Overview tab

Fill in the proxy identity:

  • Name: A descriptive label, for example Copilot HR Agent.
  • Description: Optional context for other administrators.
  • Status: Leave as Active.

Backend tab

The backend type is Copilot Direct Line and cannot be changed. Configure the connection fields:

FieldWhat to enter
Direct Line SecretSelect the secret you stored in Step 2.
Credential ModeSelect Generate Direct Line token to exchange the secret for a short-lived token on each request. Use Direct Line secret only when token generation is unavailable.
Direct Line Base URLLeave blank to use the default Microsoft Direct Line endpoint.
Timeout secondsIncrease above the default if the Copilot Studio agent takes longer to produce a first activity. Accepts values from 1 to 120.
Poll interval msHow often the proxy polls Direct Line for activity responses. The default is acceptable for most deployments. Accepts values from 100 to 5,000.
Max poll attemptsMaximum polling retries before the proxy returns a timeout. Accepts values from 1 to 240.

Agent Card tab

The proxy synthesises an A2A agent card for the Copilot Studio agent. By default, the card inherits the name and description of the exposing surface. Use the Card name override and Card description override fields only if the published card needs a different identity from the surface.

Under Verifiable identity, configure the Identity source:

  • Set Identity source to Microsoft Entra agent identity and fill in:

    • Entra Agent ID: the agent ID from your Copilot Studio agent. Find it in Advanced → Metadata in Copilot Studio.
    • Client Tenant ID: the client tenant ID from the same Advanced → Metadata page in Copilot Studio.

    When these values match what Copilot Studio sends, the synthesised agent card and inbound Copilot calls both resolve to the same agent DID.

Select Create to save the proxy.

Attach the proxy to an A2A surface

The proxy is reachable to A2A callers only when targeted by a surface.

A2A Proxy Copilot DL
  1. Open the A2A surface canvas for the surface that should route to the Copilot Studio agent.
  2. Select the Managed Agent node to open its configuration panel.
  3. Under Endpoint, set Endpoint Type to via A2A Proxy.
  4. From the A2A Proxy dropdown, select the proxy you created in Step 3.
  5. Select the save button (blue disk icon in the toolbar) or press Cmd+S / Ctrl+S.

The via A2A Proxy option appears in the Endpoint Type dropdown only when the copilot_integration feature flag is enabled and the surface protocol is A2A or AP2.

Confirm

Test 1: agent card is returned at the surface route

Replace GATEWAY_HOST and SURFACE_ROUTE with the values shown in the Channel Route banner of the Access Point panel.

curl -k https://GATEWAY_HOST/SURFACE_ROUTE/.well-known/agent-card.json

The -k flag disables TLS certificate verification. Use this for local testing only; remove it in production.

Expected: a JSON document containing the agent name, description, and at least one capability entry. The name should match the proxy name (or the Card name override if set).

Test 2: a message/send request returns an agent response

curl -k -X POST https://GATEWAY_HOST/SURFACE_ROUTE/message/send \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "message/send",
    "id": 1,
    "params": {
      "message": {
        "messageId": "test-1",
        "role": "user",
        "parts": [{"kind": "text", "text": "Hello"}]
      }
    }
  }'

Expected: a JSON-RPC response where result.kind is message, result.role is agent, and result.parts contains the agent’s reply text. For example:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "kind": "message",
    "messageId": "20e9d3d1-fa14-430f-8267-ebdf7f547c54",
    "role": "agent",
    "parts": [{"kind": "text", "text": "Hello, how can I help you today?"}]
  }
}

If the surface has authentication configured, include the required credentials in the request headers.

Troubleshooting

SymptomLikely causeFix
via A2A Proxy option not shown in Endpoint Type.copilot_integration flag is off, or the surface protocol is not A2A.Enable the flag in Settings → Admin → Feature Flags. Confirm the surface protocol is A2A or AP2.
No A2A Proxies section on the Proxies screen.copilot_integration flag is off.Enable the flag in Settings → Admin → Feature Flags.
Agent card returns 404.The surface is not saved, or the proxy is not attached.Save the surface and confirm Endpoint Type is via A2A Proxy with the correct proxy selected.
message/send returns a timeout.Direct Line polling is taking too long.Increase Timeout seconds and Max poll attempts in the proxy Backend tab.
message/send returns a response with LatestPublishedVersionNotFound.The Copilot Studio agent has not been published.In Copilot Studio, select Publish to publish the agent, then retry.
message/send returns 401 or 403.The Direct Line secret is incorrect, revoked, or expired.Rotate the secret in Management → Secrets. The proxy picks up the updated value without reconfiguration.
DID changes between calls or mismatches the surface identity.The Entra Agent ID or Client Tenant ID in the Agent Card tab does not match what Copilot Studio sends.Compare the values in the proxy Agent Card tab against the x-ms-entra-agent-id and x-ms-client-tenant-id headers Copilot sends. They must match exactly.

Next steps