{"id":5607,"date":"2026-07-30T10:18:53","date_gmt":"2026-07-30T17:18:53","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/agent-framework\/?p=5607"},"modified":"2026-07-30T10:18:53","modified_gmt":"2026-07-30T17:18:53","slug":"building-agent-teams-with-agent-framework-github-copilot-cli-and-squad","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/agent-framework\/building-agent-teams-with-agent-framework-github-copilot-cli-and-squad\/","title":{"rendered":"Building agent teams with Agent Framework, GitHub Copilot CLI and Squad"},"content":{"rendered":"<p>Microsoft Agent Framework supports creating agents that use the\u00a0<a href=\"https:\/\/github.com\/github\/copilot-sdk\" data-linktype=\"external\">GitHub Copilot SDK<\/a> as their backend. GitHub Copilot agents provide access to powerful coding-oriented AI capabilities, including shell command execution, file operations, URL fetching, Model Context Protocol (MCP) server integration, and can be integrated into your existing development pipeline.<\/p>\n<pre class=\"prettyprint language-cs language-csharp\"><code class=\"language-cs language-csharp\">using GitHub.Copilot;\r\nusing Microsoft.Agents.AI;\r\nusing Microsoft.Extensions.AI;\r\n\r\nAIFunction weatherTool = AIFunctionFactory.Create((string location) =&gt;\r\n{\r\n    return $\"The weather in {location} is sunny with a high of 25C.\";\r\n}, \"GetWeather\", \"Get the weather for a given location.\");\r\n\r\nawait using CopilotClient copilotClient = new();\r\nawait copilotClient.StartAsync();\r\n\r\nAIAgent agent = copilotClient.AsAIAgent(\r\n    tools: [weatherTool],\r\n    instructions: \"You are a helpful weather agent.\");\r\n\r\nConsole.WriteLine(await agent.RunAsync(\"What's the weather like in Seattle?\"));<\/code><\/pre>\n<p>We recently shipped this integration to v1.0 in C# and Python &#8211; fully supported and stable. Find out more here: <a href=\"https:\/\/learn.microsoft.com\/en-us\/agent-framework\/agents\/providers\/github-copilot\">MS Learn | Agent Framework | GitHub Copilot Agents <\/a>and check out the samples here:<a href=\"https:\/\/github.com\/microsoft\/agent-framework\/tree\/main\/dotnet\/samples\/02-agents\/AgentProviders\/github-copilot\/Agent_With_GitHubCopilot\"> .NET<\/a> | <a href=\"https:\/\/github.com\/microsoft\/agent-framework\/tree\/main\/python\/samples\/02-agents\/providers\/github_copilot\">Python<\/a><\/p>\n<p>A great example of using MAF and GitHub Copilot together is Squad. <strong>Squad<\/strong> is an open-source multi-agent framework that runs on top of the GitHub Copilot CLI\/SDK \u2014 you describe a small team (a coordinator plus a few specialists, each with a charter), and the coordinator dispatches the work, lets the specialists argue, and ships a result. (<a href=\"https:\/\/aka.ms\/copilot-squad\">aka.ms\/copilot-squad<\/a>). What gets interesting is the <strong>combination <\/strong>of MAF and Squad: MAF gives you the agent runtime, model abstraction, hosting, and telemetry; the GitHub Copilot CLI\/SDK gives you a coding agent that already knows how to read repos, edit files, and run shells. Wire them together in one .NET app and you get to enjoy both worlds in the same IServiceCollection.<\/p>\n<p>Because Squad already runs on the Copilot CLI\/SDK and MAF has a first-party adapter for it, the bridge between them is almost free. <strong>Squad.Agents.AI<\/strong> is a small NuGet that wraps a Squad team as a regular MAF AIAgent. You wire it into your IServiceCollection like any other agent, MAF treats it as a peer, and Squad keeps orchestrating underneath.<\/p>\n<h3>The integration in C#<\/h3>\n<pre class=\"prettyprint language-cs language-csharp\"><code class=\"language-cs language-csharp\">using Microsoft.Agents.AI;\r\nusing Microsoft.Extensions.DependencyInjection;\r\nusing Microsoft.Extensions.Hosting;\r\nusing Squad.Agents.AI;\r\n\r\nvar builder = Host.CreateApplicationBuilder(args);\r\nbuilder.Services.AddSquadAgent(o =&gt;\r\n{\r\n    o.SquadFolderPath = @\"C:\\path\\to\\your\\team-root\";\r\n});\r\n\r\nusing var host = builder.Build();\r\nvar squad = host.Services.GetRequiredService&lt;AIAgent&gt;();\r\nvar session = await squad.CreateSessionAsync();\r\nvar response = await squad.RunAsync(\"What can this Squad team do?\", session);\r\nConsole.WriteLine(response.Text);<\/code><\/pre>\n<p><span style=\"font-family: georgia, palatino, serif;\">That&#8217;s the whole integration. AddSquadAgent() registers your Squad team as both AIAgent (so MAF sees it through the standard abstraction) and SquadAgent (so callers that want Squad-specific knobs can drop down).<\/span><\/p>\n<h3>Under the hood<\/h3>\n<p>SquadAgent is a thin composition of the two pieces Shawn just announced. The Copilot SDK already knows how to talk to copilot.exe; Squad.Agents.AI just points it at a Squad team folder, sets up a session, and hands the result to MAF as a regular AIAgent. The whole class is essentially this:<\/p>\n<pre class=\"prettyprint language-cs language-csharp\"><code class=\"language-cs language-csharp\">public sealed class SquadAgent : DelegatingAIAgent\r\n\r\n{\r\n    public SquadAgent(SquadAgentOptions options) \r\n        : base(BuildInnerAgent(options))\u00a0\u00a0\u00a0 \/\/ \u2190 inner AIAgent passed to DelegatingAIAgent\r\n    {\r\n    }\r\n    \/\/ DelegatingAIAgent forwards RunAsync, RunStreamingAsync, CreateSessionAsync\r\n    \/\/ to whatever inner AIAgent we hand the base ctor. SquadAgent doesn't override\r\n    \/\/ any of that \u2014 the Copilot-backed agent does the work; we just expose the seam.\r\n    private static AIAgent BuildInnerAgent(SquadAgentOptions options)\r\n    {\r\n        \/\/ 1. Copilot SDK client, pointed at the Squad team root\r\n        var client = new CopilotClient(\/* CLI path, env, token, etc. *\/);\r\n        \/\/ 2. Tell the CLI to auto-discover the .squad\/ folder so it picks up\r\n        \/\/\u00a0\u00a0\u00a0 team agents, skills, instructions, and MCP servers at session start.\r\n        var teamRoot\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = options.SquadFolderPath;\r\n        var squadConfigDir = Path.Combine(teamRoot, \".squad\");\r\n\r\n        var sessionConfig = new SessionConfig\r\n        {\r\n             WorkingDirectory\u00a0\u00a0\u00a0\u00a0\u00a0 = teamRoot,\r\n             ConfigDirectory\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 = squadConfigDir,\r\n             EnableConfigDiscovery = true,\r\n             OnPermissionRequest\u00a0\u00a0 = PermissionHandler.ApproveAll,\r\n        };\r\n\r\n        \/\/ 3. Lift the Copilot client into a MAF AIAgent \u2014 this is the inner\r\n        \/\/\u00a0\u00a0\u00a0 agent that DelegatingAIAgent will forward every call to.\r\n        return client.AsAIAgent(sessionConfig, name: options.AgentName ?? \"Squad\");\r\n    }\r\n}<\/code><\/pre>\n<p>The constructor chain is the part that ties it together. <span style=\"font-family: 'courier new', courier, monospace;\">BuildInnerAgent<\/span> produces a Copilot-backed <span style=\"font-family: 'courier new', courier, monospace;\">AIAgent<\/span>; the public ctor passes that straight to <span style=\"font-family: 'courier new', courier, monospace;\">: base(&#8230;)<\/span>, and <span style=\"font-family: 'courier new', courier, monospace;\">DelegatingAIAgent<\/span> forwards every <span style=\"font-family: 'courier new', courier, monospace;\">RunAsync<\/span>, <span style=\"font-family: 'courier new', courier, monospace;\">RunStreamingAsync<\/span>, and <span style=\"font-family: 'courier new', courier, monospace;\">CreateSessionAsync<\/span> call to it. No protocol, no extra runtime, no overrides \u2014 just inheritance plus delegation. Three lines do the work that matters: build a <span style=\"font-family: 'courier new', courier, monospace;\">CopilotClient<\/span> (Copilot SDK), describe a <span style=\"font-family: 'courier new', courier, monospace;\">SessionConfig<\/span> that aims it at your team&#8217;s .squad\/ folder, then call <span style=\"font-family: 'courier new', courier, monospace;\">client.AsAIAgent(&#8230;)<\/span> \u2014 the extension from <span style=\"font-family: 'courier new', courier, monospace;\">Microsoft.Agents.AI.GitHub.Copilot<\/span> that turns it into a MAF agent.<\/p>\n<p>The <span style=\"font-family: 'courier new', courier, monospace;\">EnableConfigDiscovery<\/span> flag is what makes the CLI auto-load your team&#8217;s charters, skills, and MCP servers at session start instead of forcing the agent to re-read them via runtime file tools every turn. That&#8217;s the part you&#8217;d otherwise have to rebuild by hand. (<a href=\"https:\/\/github.com\/bradygaster\/squad\/blob\/dev\/src\/Squad.Agents.AI\/SquadAgent.cs\">SquadAgent.cs<\/a>)<\/p>\n<p>Streaming uses the same surface \u2014 <span style=\"font-family: 'courier new', courier, monospace;\">await foreach (var update in squad.RunStreamingAsync(prompt, session))<\/span> does what you&#8217;d expect. The depth \u2014 keyed multi-team registration, BYOK token delegates, security defaults \u2014 lives in the <a href=\"https:\/\/github.com\/bradygaster\/squad\/blob\/dev\/src\/Squad.Agents.AI\/README.md\">README<\/a>.<\/p>\n<h3>Why Squad inside MAF?<\/h3>\n<p>A MAF workflow already lets you mix deterministic steps, stateless AI calls, and targeted agents you&#8217;ve prompt-engineered. Each of those resets to zero on every invocation \u2014 they know exactly what their prompt tells them, nothing more.<\/p>\n<p>A Squad is different. It&#8217;s a <strong>self-learning team<\/strong> that accumulates domain knowledge with use:<\/p>\n<ol>\n<li><strong>It remembers decisions.<\/strong> &#8220;We chose Postgres over Cosmos for this service&#8221; \u2014 logged once, respected by every specialist on every future call. You don&#8217;t re-explain your architecture each invocation.<\/li>\n<li><strong>It extracts skills.<\/strong> The first time an agent figures out your deployment flow, it writes a skill file. The tenth time, it just reads the skill and executes. Patterns compound instead of being rediscovered.<\/li>\n<li><strong>It respects your corrections.<\/strong> Say &#8220;we never use that library&#8221; once. The directive is captured. The team won&#8217;t suggest it again \u2014 not because you hardcoded a blocklist, but because the team <em>learned<\/em>.<\/li>\n<li><strong>It onboards new specialists instantly.<\/strong> Add a security reviewer to the team next month. They inherit the full decision ledger and skill library on their first session \u2014 same way a new hire reads the team wiki.<\/li>\n<\/ol>\n<p>That self-learning nature changes what the Squad-as-AIAgent slot means inside a MAF pipeline:<\/p>\n<ul>\n<li><strong>Content pipeline<\/strong> \u2014 Your Squad team doesn&#8217;t just research-draft-review. After ten runs it <em>knows<\/em> your tone guide, remembers which sources you rejected last time, and skips the style arguments it already resolved. A stateless fan-out would relearn all of that every call.<\/li>\n<li><strong>Code review bot<\/strong> \u2014 The Squad remembers your codebase conventions, past review decisions (&#8220;we don&#8217;t flag this pattern&#8221;), and which reviewer concerns carry more weight. Each review is sharper than the last.<\/li>\n<li><strong>Customer support escalation<\/strong> \u2014 The Squad team has seen your product&#8217;s failure modes before. It knows that &#8220;sync error&#8221; usually means a token expiry, not a network issue, because it logged that three weeks ago. Stateless agents would chase the wrong root cause every time.<\/li>\n<li><strong>Release readiness gate<\/strong> \u2014 The Squad knows what &#8220;ready&#8221; means for <em>your<\/em> project specifically \u2014 because it captured your release criteria as decisions over time, not because someone hardcoded them in a prompt.<\/li>\n<\/ul>\n<p>The result: inside your MAF pipeline, the Squad slot isn&#8217;t just &#8220;call an LLM.&#8221; It&#8217;s &#8220;call the team that&#8217;s been learning your project for the past six weeks.&#8221; The host sees one AIAgent. Underneath, a coordinator dispatches to specialists who carry institutional memory \u2014 and get better at your specific domain every time they run. A targeted agent gives you repeatability. A Squad gives you <strong>repeatability that improves over time.<\/strong><\/p>\n<p>The subagent observability is the part I underestimated and now lean on hardest. By default the package emits one OpenTelemetry span per dispatched specialist (<span style=\"font-family: 'courier new', courier, monospace;\">squad.subagent {Name}<\/span>, with lifecycle events on the live span), so any host that&#8217;s already wired into Aspire, Jaeger, or Application Insights sees the full multi-agent fan-out without extra plumbing. You see who got asked, what they said, and how long they took, on the same trace as the rest of your request.<\/p>\n<p>If you&#8217;re already building on MAF and you want multi-agent orchestration that <strong>learns your domain over time<\/strong> without you rewriting prompts, this is the cheap path. The MAF team did the agent-framework work; we did the team-of-agents work; the seam is one DI call.<\/p>\n<h3>Try it today<\/h3>\n<pre class=\"prettyprint language-default\"><code class=\"language-default\">dotnet add package Squad.Agents.AI --prerelease<\/code><\/pre>\n<p>Full README: <a href=\"https:\/\/github.com\/bradygaster\/squad\/blob\/dev\/src\/Squad.Agents.AI\/README.md\">github.com\/bradygaster\/squad\/src\/Squad.Agents.AI<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Microsoft Agent Framework supports creating agents that use the\u00a0GitHub Copilot SDK as their backend. GitHub Copilot agents provide access to powerful coding-oriented AI capabilities, including shell command execution, file operations, URL fetching, Model Context Protocol (MCP) server integration, and can be integrated into your existing development pipeline. using GitHub.Copilot; using Microsoft.Agents.AI; using Microsoft.Extensions.AI; AIFunction weatherTool [&hellip;]<\/p>\n","protected":false},"author":173663,"featured_media":5732,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[143],"tags":[],"class_list":["post-5607","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-agent-framework"],"acf":[],"blog_post_summary":"<p>Microsoft Agent Framework supports creating agents that use the\u00a0GitHub Copilot SDK as their backend. GitHub Copilot agents provide access to powerful coding-oriented AI capabilities, including shell command execution, file operations, URL fetching, Model Context Protocol (MCP) server integration, and can be integrated into your existing development pipeline. using GitHub.Copilot; using Microsoft.Agents.AI; using Microsoft.Extensions.AI; AIFunction weatherTool [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/posts\/5607","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/users\/173663"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/comments?post=5607"}],"version-history":[{"count":2,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/posts\/5607\/revisions"}],"predecessor-version":[{"id":5617,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/posts\/5607\/revisions\/5617"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/media\/5732"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/media?parent=5607"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/categories?post=5607"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/tags?post=5607"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}