{"meta":{"title":"Microsoft agent framework integration","intro":"Use the Copilot SDK as an agent provider inside the Microsoft Agent Framework (MAF) to compose multi-agent workflows alongside Azure OpenAI, Anthropic, and other providers.","product":"GitHub Copilot","breadcrumbs":[{"href":"/en/enterprise-cloud@latest/copilot","title":"GitHub Copilot"},{"href":"/en/enterprise-cloud@latest/copilot/how-tos","title":"How-tos"},{"href":"/en/enterprise-cloud@latest/copilot/how-tos/copilot-sdk","title":"Copilot SDK"},{"href":"/en/enterprise-cloud@latest/copilot/how-tos/copilot-sdk/integrations","title":"Integrations"},{"href":"/en/enterprise-cloud@latest/copilot/how-tos/copilot-sdk/integrations/microsoft-agent-framework","title":"Microsoft Agent Framework"}],"documentType":"article"},"body":"# Microsoft agent framework integration\n\nUse the Copilot SDK as an agent provider inside the Microsoft Agent Framework (MAF) to compose multi-agent workflows alongside Azure OpenAI, Anthropic, and other providers.\n\n<!-- markdownlint-disable GHD046 GHD005 -->\n\n<!-- Suppressed: GHD046 (outdated release terminology), GHD005 (hardcoded data variable) -->\n\n## Overview\n\nThe Microsoft Agent Framework is the unified successor to Semantic Kernel and AutoGen. It provides a standard interface for building, orchestrating, and deploying AI agents. Dedicated integration packages let you wrap a Copilot SDK client as a first-class MAF agent—interchangeable with any other agent provider in the framework.\n\n| Concept                       | Description                                                                             |\n| ----------------------------- | --------------------------------------------------------------------------------------- |\n| **Microsoft Agent Framework** | Open-source framework for single- and multi-agent orchestration in .NET and Python      |\n| **Agent provider**            | A backend that powers an agent (Copilot, Azure OpenAI, Anthropic, etc.)                 |\n| **Orchestrator**              | A MAF component that coordinates agents in sequential, concurrent, or handoff workflows |\n| **A2A protocol**              | Agent-to-Agent communication standard supported by the framework                        |\n\n> \\[!NOTE]\n> MAF integration packages are available for **.NET** and **Python**. For TypeScript, Go, Java, and Rust, use the Copilot SDK directly—the standard SDK APIs already provide tool calling, streaming, and custom agents.\n\n## Prerequisites\n\nBefore you begin, ensure you have:\n\n* A working [Build your first Copilot-powered app](/en/enterprise-cloud@latest/copilot/how-tos/copilot-sdk/getting-started) in your language of choice\n* A GitHub Copilot subscription (Individual, Business, or Enterprise)\n* The Copilot CLI installed or available via the SDK's bundled CLI\n\n## Installation\n\nInstall the Copilot SDK alongside the MAF integration package for your language:\n\n<div class=\"ghd-codetabs\">\n<div class=\"ghd-codetab\" data-lang=\"dotnet\" data-label=\".NET\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">.NET</div>\n\n```shell\ndotnet add package GitHub.Copilot.SDK\ndotnet add package Microsoft.Agents.AI.GitHub.Copilot --prerelease\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"python\" data-label=\"Python\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Python</div>\n\n```shell\npip install copilot-sdk agent-framework-github-copilot\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"java\" data-label=\"Java\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Java</div>\n\n> \\[!NOTE]\n> The Java SDK does not have a dedicated MAF integration package. Use the standard Copilot SDK directly—it provides tool calling, streaming, and custom agents out of the box.\n\n```xml\n<!-- Maven -->\n<!-- Set copilot.sdk.version to the version published in java/README.md / Maven Central -->\n<dependency>\n    <groupId>com.github</groupId>\n    <artifactId>copilot-sdk-java</artifactId>\n    <version>${copilot.sdk.version}</version>\n</dependency>\n```\n\n</div>\n\n</div>\n\n## Basic usage\n\nWrap the Copilot SDK client as a MAF agent with a single method call. The resulting agent conforms to the framework's standard interface and can be used anywhere a MAF agent is expected.\n\n<div class=\"ghd-codetabs\">\n<div class=\"ghd-codetab\" data-lang=\"dotnet\" data-label=\".NET\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">.NET</div>\n\n<!-- docs-validate: skip -->\n\n```csharp\nusing GitHub.Copilot;\nusing Microsoft.Agents.AI;\n\nawait using var copilotClient = new CopilotClient();\nawait copilotClient.StartAsync();\n\n// Wrap as a MAF agent\nAIAgent agent = copilotClient.AsAIAgent();\n\n// Use the standard MAF interface\nstring response = await agent.RunAsync(\"Explain how dependency injection works in ASP.NET Core\");\nConsole.WriteLine(response);\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"python\" data-label=\"Python\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Python</div>\n\n<!-- docs-validate: skip -->\n\n```python\nfrom agent_framework.github import GitHubCopilotAgent\n\nasync def main():\n    agent = GitHubCopilotAgent(\n        default_options={\n            \"instructions\": \"You are a helpful coding assistant.\",\n        }\n    )\n\n    async with agent:\n        result = await agent.run(\"Explain how dependency injection works in FastAPI\")\n        print(result)\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"java\" data-label=\"Java\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Java</div>\n\n<!-- docs-validate: skip -->\n\n```java\nimport com.github.copilot.CopilotClient;\nimport com.github.copilot.rpc.*;\n\nvar client = new CopilotClient();\nclient.start().get();\n\nvar session = client.createSession(new SessionConfig()\n    .setModel(\"gpt-5.4\")\n    .setOnPermissionRequest(PermissionHandler.APPROVE_ALL)\n).get();\n\nvar response = session.sendAndWait(new MessageOptions()\n    .setPrompt(\"Explain how dependency injection works in Spring Boot\")).get();\nSystem.out.println(response.getData().content());\n\nclient.stop().get();\n```\n\n</div>\n\n</div>\n\n## Adding custom tools\n\nExtend your Copilot agent with custom function tools. Tools defined through the standard Copilot SDK are automatically available when the agent runs inside MAF.\n\n<div class=\"ghd-codetabs\">\n<div class=\"ghd-codetab\" data-lang=\"dotnet\" data-label=\".NET\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">.NET</div>\n\n<!-- docs-validate: skip -->\n\n```csharp\nusing GitHub.Copilot;\nusing Microsoft.Extensions.AI;\nusing Microsoft.Agents.AI;\n\n// Define a custom tool\nAIFunction weatherTool = CopilotTool.DefineTool(\n    (string location) => $\"The weather in {location} is sunny with a high of 25°C.\",\n    factoryOptions: new AIFunctionFactoryOptions\n    {\n        Name = \"GetWeather\",\n        Description = \"Get the current weather for a given location.\",\n    }\n);\n\nawait using var copilotClient = new CopilotClient();\nawait copilotClient.StartAsync();\n\n// Create agent with tools\nAIAgent agent = copilotClient.AsAIAgent(new AIAgentOptions\n{\n    Tools = new[] { weatherTool },\n});\n\nstring response = await agent.RunAsync(\"What's the weather like in Seattle?\");\nConsole.WriteLine(response);\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"python\" data-label=\"Python\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Python</div>\n\n<!-- docs-validate: skip -->\n\n```python\nfrom agent_framework.github import GitHubCopilotAgent\n\ndef get_weather(location: str) -> str:\n    \"\"\"Get the current weather for a given location.\"\"\"\n    return f\"The weather in {location} is sunny with a high of 25°C.\"\n\nasync def main():\n    agent = GitHubCopilotAgent(\n        default_options={\n            \"instructions\": \"You are a helpful assistant with access to weather data.\",\n        },\n        tools=[get_weather],\n    )\n\n    async with agent:\n        result = await agent.run(\"What's the weather like in Seattle?\")\n        print(result)\n```\n\n</div>\n\n</div>\n\nYou can also use Copilot SDK's native tool definition alongside MAF tools:\n\n<div class=\"ghd-codetabs\">\n<div class=\"ghd-codetab\" data-lang=\"typescript\" data-label=\"TypeScript\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">TypeScript</div>\n\n```typescript\nimport { CopilotClient, defineTool } from \"@github/copilot-sdk\";\n\nconst getWeather = defineTool(\"GetWeather\", {\n    description: \"Get the current weather for a given location.\",\n    parameters: {\n        type: \"object\",\n        properties: {\n            location: { type: \"string\", description: \"City name\" },\n        },\n        required: [\"location\"],\n    },\n    handler: async ({ location }: { location: string }) =>\n        `The weather in ${location} is sunny, 25°C.`,\n});\n\nconst client = new CopilotClient();\nconst session = await client.createSession({\n    model: \"gpt-5.4\",\n    tools: [getWeather],\n    onPermissionRequest: async () => ({ kind: \"approve-once\" }),\n});\n\nawait session.sendAndWait({ prompt: \"What's the weather like in Seattle?\" });\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"java\" data-label=\"Java\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Java</div>\n\n```java\nimport com.github.copilot.CopilotClient;\nimport com.github.copilot.rpc.*;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.concurrent.CompletableFuture;\n\nvar getWeather = ToolDefinition.create(\n    \"GetWeather\",\n    \"Get the current weather for a given location.\",\n    Map.of(\n        \"type\", \"object\",\n        \"properties\", Map.of(\n            \"location\", Map.of(\"type\", \"string\", \"description\", \"City name\")),\n        \"required\", List.of(\"location\")),\n    invocation -> {\n        var location = (String) invocation.getArguments().get(\"location\");\n        return CompletableFuture.completedFuture(\n            \"The weather in \" + location + \" is sunny, 25°C.\");\n    });\n\ntry (var client = new CopilotClient()) {\n    client.start().get();\n\n    var session = client.createSession(new SessionConfig()\n        .setModel(\"gpt-5.4\")\n        .setTools(List.of(getWeather))\n        .setOnPermissionRequest(PermissionHandler.APPROVE_ALL)\n    ).get();\n\n    session.sendAndWait(new MessageOptions()\n        .setPrompt(\"What's the weather like in Seattle?\")).get();\n}\n```\n\n</div>\n\n</div>\n\n## Multi-agent workflows\n\nThe primary benefit of MAF integration is composing Copilot alongside other agent providers in orchestrated workflows. Use the framework's built-in orchestrators to create pipelines where different agents handle different steps.\n\n### Sequential workflow\n\nRun agents one after another, passing output from one to the next:\n\n<div class=\"ghd-codetabs\">\n<div class=\"ghd-codetab\" data-lang=\"dotnet\" data-label=\".NET\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">.NET</div>\n\n<!-- docs-validate: skip -->\n\n```csharp\nusing GitHub.Copilot;\nusing Microsoft.Agents.AI;\nusing Microsoft.Agents.AI.Orchestration;\n\nawait using var copilotClient = new CopilotClient();\nawait copilotClient.StartAsync();\n\n// Copilot agent for code review\nAIAgent reviewer = copilotClient.AsAIAgent(new AIAgentOptions\n{\n    Instructions = \"You review code for bugs, security issues, and best practices. Be thorough.\",\n});\n\n// Azure OpenAI agent for generating documentation\nAIAgent documentor = AIAgent.FromOpenAI(new OpenAIAgentOptions\n{\n    Model = \"gpt-5.4\",\n    Instructions = \"You write clear, concise documentation for code changes.\",\n});\n\n// Compose in a sequential pipeline\nvar pipeline = new SequentialOrchestrator(new[] { reviewer, documentor });\n\nstring result = await pipeline.RunAsync(\n    \"Review and document this pull request: added retry logic to the HTTP client\"\n);\nConsole.WriteLine(result);\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"python\" data-label=\"Python\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Python</div>\n\n<!-- docs-validate: skip -->\n\n```python\nfrom agent_framework.github import GitHubCopilotAgent\nfrom agent_framework.openai import OpenAIAgent\nfrom agent_framework.orchestration import SequentialOrchestrator\n\nasync def main():\n    # Copilot agent for code review\n    reviewer = GitHubCopilotAgent(\n        default_options={\n            \"instructions\": \"You review code for bugs, security issues, and best practices.\",\n        }\n    )\n\n    # OpenAI agent for documentation\n    documentor = OpenAIAgent(\n        model=\"gpt-5.4\",\n        instructions=\"You write clear, concise documentation for code changes.\",\n    )\n\n    # Compose in a sequential pipeline\n    pipeline = SequentialOrchestrator(agents=[reviewer, documentor])\n\n    async with pipeline:\n        result = await pipeline.run(\n            \"Review and document this PR: added retry logic to the HTTP client\"\n        )\n        print(result)\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"java\" data-label=\"Java\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Java</div>\n\n<!-- docs-validate: skip -->\n\n```java\nimport com.github.copilot.CopilotClient;\nimport com.github.copilot.rpc.*;\n\n// Java uses the standard SDK directly — no MAF orchestrator needed\nvar client = new CopilotClient();\nclient.start().get();\n\n// Step 1: Code review session\nvar reviewer = client.createSession(new SessionConfig()\n    .setModel(\"gpt-5.4\")\n    .setOnPermissionRequest(PermissionHandler.APPROVE_ALL)\n).get();\n\nvar review = reviewer.sendAndWait(new MessageOptions()\n    .setPrompt(\"Review this PR for bugs, security issues, and best practices: \"\n        + \"added retry logic to the HTTP client\")).get();\n\n// Step 2: Documentation session using review output\nvar documentor = client.createSession(new SessionConfig()\n    .setModel(\"gpt-5.4\")\n    .setOnPermissionRequest(PermissionHandler.APPROVE_ALL)\n).get();\n\nvar docs = documentor.sendAndWait(new MessageOptions()\n    .setPrompt(\"Write documentation for these changes: \" + review.getData().content())).get();\nSystem.out.println(docs.getData().content());\n\nclient.stop().get();\n```\n\n</div>\n\n</div>\n\n### Concurrent workflow\n\nRun multiple agents in parallel and aggregate their results:\n\n<div class=\"ghd-codetabs\">\n<div class=\"ghd-codetab\" data-lang=\"dotnet\" data-label=\".NET\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">.NET</div>\n\n<!-- docs-validate: skip -->\n\n```csharp\nusing GitHub.Copilot;\nusing Microsoft.Agents.AI;\nusing Microsoft.Agents.AI.Orchestration;\n\nawait using var copilotClient = new CopilotClient();\nawait copilotClient.StartAsync();\n\nAIAgent securityReviewer = copilotClient.AsAIAgent(new AIAgentOptions\n{\n    Instructions = \"Focus exclusively on security vulnerabilities and risks.\",\n});\n\nAIAgent performanceReviewer = copilotClient.AsAIAgent(new AIAgentOptions\n{\n    Instructions = \"Focus exclusively on performance bottlenecks and optimization opportunities.\",\n});\n\n// Run both reviews concurrently\nvar concurrent = new ConcurrentOrchestrator(new[] { securityReviewer, performanceReviewer });\n\nstring combinedResult = await concurrent.RunAsync(\n    \"Analyze this database query module for issues\"\n);\nConsole.WriteLine(combinedResult);\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"java\" data-label=\"Java\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Java</div>\n\n<!-- docs-validate: skip -->\n\n```java\nimport com.github.copilot.CopilotClient;\nimport com.github.copilot.rpc.*;\nimport java.util.concurrent.CompletableFuture;\n\n// Java uses CompletableFuture for concurrent execution\nvar client = new CopilotClient();\nclient.start().get();\n\nvar securitySession = client.createSession(new SessionConfig()\n    .setModel(\"gpt-5.4\")\n    .setOnPermissionRequest(PermissionHandler.APPROVE_ALL)\n).get();\n\nvar perfSession = client.createSession(new SessionConfig()\n    .setModel(\"gpt-5.4\")\n    .setOnPermissionRequest(PermissionHandler.APPROVE_ALL)\n).get();\n\n// Run both reviews concurrently\nvar securityFuture = securitySession.sendAndWait(new MessageOptions()\n    .setPrompt(\"Focus on security vulnerabilities in this database query module\"));\nvar perfFuture = perfSession.sendAndWait(new MessageOptions()\n    .setPrompt(\"Focus on performance bottlenecks in this database query module\"));\n\nCompletableFuture.allOf(securityFuture, perfFuture).get();\n\nSystem.out.println(\"Security: \" + securityFuture.get().getData().content());\nSystem.out.println(\"Performance: \" + perfFuture.get().getData().content());\n\nclient.stop().get();\n```\n\n</div>\n\n</div>\n\n## Streaming responses\n\nWhen building interactive applications, stream agent responses to show real-time output. The MAF integration preserves the Copilot SDK's streaming capabilities.\n\n<div class=\"ghd-codetabs\">\n<div class=\"ghd-codetab\" data-lang=\"dotnet\" data-label=\".NET\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">.NET</div>\n\n<!-- docs-validate: skip -->\n\n```csharp\nusing GitHub.Copilot;\nusing Microsoft.Agents.AI;\n\nawait using var copilotClient = new CopilotClient();\nawait copilotClient.StartAsync();\n\nAIAgent agent = copilotClient.AsAIAgent(new AIAgentOptions\n{\n    Streaming = true,\n});\n\nawait foreach (var chunk in agent.RunStreamingAsync(\"Write a quicksort implementation in C#\"))\n{\n    Console.Write(chunk);\n}\nConsole.WriteLine();\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"python\" data-label=\"Python\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Python</div>\n\n<!-- docs-validate: skip -->\n\n```python\nfrom agent_framework.github import GitHubCopilotAgent\n\nasync def main():\n    agent = GitHubCopilotAgent(\n        default_options={\"streaming\": True}\n    )\n\n    async with agent:\n        async for chunk in agent.run_streaming(\"Write a quicksort in Python\"):\n            print(chunk, end=\"\", flush=True)\n        print()\n```\n\n</div>\n\n</div>\n\nYou can also stream directly through the Copilot SDK without MAF:\n\n<div class=\"ghd-codetabs\">\n<div class=\"ghd-codetab\" data-lang=\"typescript\" data-label=\"TypeScript\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">TypeScript</div>\n\n```typescript\nimport { CopilotClient } from \"@github/copilot-sdk\";\n\nconst client = new CopilotClient();\nconst session = await client.createSession({\n    model: \"gpt-5.4\",\n    streaming: true,\n    onPermissionRequest: async () => ({ kind: \"approve-once\" }),\n});\n\nsession.on(\"assistant.message_delta\", (event) => {\n    process.stdout.write(event.data.deltaContent ?? \"\");\n});\n\nawait session.sendAndWait({ prompt: \"Write a quicksort implementation in TypeScript\" });\n```\n\n</div>\n\n<div class=\"ghd-codetab\" data-lang=\"java\" data-label=\"Java\"><div class=\"ghd-codetab-fallback-label\" role=\"heading\" aria-level=\"3\">Java</div>\n\n<!-- docs-validate: skip -->\n\n```java\nimport com.github.copilot.CopilotClient;\nimport com.github.copilot.rpc.*;\n\nvar client = new CopilotClient();\nclient.start().get();\n\nvar session = client.createSession(new SessionConfig()\n    .setModel(\"gpt-5.4\")\n    .setStreaming(true)\n    .setOnPermissionRequest(PermissionHandler.APPROVE_ALL)\n).get();\n\nsession.on(AssistantMessageDeltaEvent.class, event -> {\n    System.out.print(event.getData().deltaContent());\n});\n\nsession.sendAndWait(new MessageOptions()\n    .setPrompt(\"Write a quicksort implementation in Java\")).get();\nSystem.out.println();\n\nclient.stop().get();\n```\n\n</div>\n\n</div>\n\n## Configuration reference\n\n### MAF agent options\n\n| Property                        | Type                    | Description                                  |\n| ------------------------------- | ----------------------- | -------------------------------------------- |\n| `Instructions` / `instructions` | `string`                | System prompt for the agent                  |\n| `Tools` / `tools`               | `AIFunction[]` / `list` | Custom function tools available to the agent |\n| `Streaming` / `streaming`       | `bool`                  | Enable streaming responses                   |\n| `Model` / `model`               | `string`                | Override the default model                   |\n\n### Copilot SDK options (passed through)\n\nAll standard [Build your first Copilot-powered app](/en/enterprise-cloud@latest/copilot/how-tos/copilot-sdk/getting-started) options are still available when creating the underlying Copilot client. The MAF wrapper delegates to the SDK under the hood:\n\n| SDK Feature                                       | MAF Support                          |\n| ------------------------------------------------- | ------------------------------------ |\n| Custom tools (`DefineTool` / `AIFunctionFactory`) | ✅ Merged with MAF tools              |\n| MCP servers                                       | ✅ Configured on the SDK client       |\n| Custom agents / sub-agents                        | ✅ Available within the Copilot agent |\n| Infinite sessions                                 | ✅ Configured on the SDK client       |\n| Model selection                                   | ✅ Overridable per agent or per call  |\n| Streaming                                         | ✅ Full delta event support           |\n\n## Best practices\n\n### Choose the right level of integration\n\nUse the MAF wrapper when you need to compose Copilot with other providers in orchestrated workflows. If your application only uses Copilot, the standalone SDK is simpler and gives you full control:\n\n```typescript\n// Standalone SDK — full control, simpler setup\nimport { CopilotClient } from \"@github/copilot-sdk\";\n\nconst client = new CopilotClient();\nconst session = await client.createSession({\n    model: \"gpt-5.4\",\n    onPermissionRequest: async () => ({ kind: \"approve-once\" }),\n});\nconst response = await session.sendAndWait({ prompt: \"Explain this code\" });\n```\n\n### Keep agents focused\n\nWhen building multi-agent workflows, give each agent a specific role with clear instructions. Avoid overlapping responsibilities:\n\n```typescript\n// ❌ Too vague — overlapping roles\nconst agents = [\n    { instructions: \"Help with code\" },\n    { instructions: \"Assist with programming\" },\n];\n\n// ✅ Focused — clear separation of concerns\nconst agents = [\n    { instructions: \"Review code for security vulnerabilities. Flag SQL injection, XSS, and auth issues.\" },\n    { instructions: \"Optimize code performance. Focus on algorithmic complexity and memory usage.\" },\n];\n```\n\n### Handle errors at the orchestration level\n\nWrap agent calls in error handling, especially in multi-agent workflows where one agent's failure shouldn't block the entire pipeline:\n\n<!-- docs-validate: skip -->\n\n```csharp\ntry\n{\n    string result = await pipeline.RunAsync(\"Analyze this module\");\n    Console.WriteLine(result);\n}\ncatch (AgentException ex)\n{\n    Console.Error.WriteLine($\"Agent {ex.AgentName} failed: {ex.Message}\");\n    // Fall back to single-agent mode or retry\n}\n```\n\n## See also\n\n* [Build your first Copilot-powered app](/en/enterprise-cloud@latest/copilot/how-tos/copilot-sdk/getting-started): initial Copilot SDK setup\n* [Custom agents and sub-agent orchestration](/en/enterprise-cloud@latest/copilot/how-tos/copilot-sdk/features/custom-agents): define specialized sub-agents within the SDK\n* [Custom skills](/en/enterprise-cloud@latest/copilot/how-tos/copilot-sdk/features/skills): reusable prompt modules\n* [Microsoft Agent Framework documentation](https://learn.microsoft.com/en-us/agent-framework/agents/providers/github-copilot): official MAF docs for the Copilot provider\n* [Blog: Build AI Agents with GitHub Copilot SDK and Microsoft Agent Framework](https://devblogs.microsoft.com/semantic-kernel/build-ai-agents-with-github-copilot-sdk-and-microsoft-agent-framework/)"}