GitHub Copilot agents in C#: setup and permissions
Connect GitHub Copilot to Microsoft Agent Framework in C#, stream pull request analysis, and request permission before listing files.
Player not loading? Watch on YouTube
Bruno demonstrates how to use GitHub Copilot with Microsoft Agent Framework in a C# application. He creates a Copilot client and session, then turns the session into an AI agent with instructions and tools. He describes the integration dependency as a 1.0 preview without specifying its exact build. He mentions CLI authentication and a GitHub token, leaving the details to the documentation.
The first example asks the agent to analyze a pull request. Streaming output reports that it is fetching files and the request description. The transcript does not establish the quality or completeness of the final review. Bruno also discusses orchestrating Copilot agents alongside other framework agents, but does not demonstrate that arrangement.
The second example asks a console agent to list files in its current directory. Bruno explains a session permission callback that asks the user to approve or deny access. He approves the request and reports that the agent lists files in the console application's output folder. The denial path is explained but not demonstrated.
The example runs through a C# application using the Copilot integration; it does not demonstrate local model inference. Bruno points viewers to Microsoft's documentation for the sample code and says he will not publish a separate repository.