Both agentic AI and Copilot tools are changing how .NET developers work, but in different ways and for different jobs. This article breaks down what each one actually does, how they fit into typical .NET workflows, and how to use them together without losing control of your codebase.
What Is Agentic AI?
An AI agent is software that can reason about a goal, decide which tools or APIs to call, and carry out multi-step tasks without needing a human to direct each step. You give it an objective; it figures out how to get there.
Microsoft describes agents as "autonomous software components" that set their own sub-goals, use tools, and can even collaborate with other agents. In .NET terms, you might build one using Semantic Kernel's Agent Framework, Azure OpenAI with function calling, or Microsoft's AutoGen. A typical use case: the agent receives a natural-language requirement, queries a documentation store, calls a REST API, and writes a structured response back to your system, all in one run.
What Is a Copilot?
Copilot tools (GitHub Copilot, Visual Studio IntelliCode) sit inside your IDE and respond to what you are doing. They autocomplete methods, generate unit tests, explain code, fix syntax, and suggest refactors, but only when you ask or when their inline completion kicks in. Every suggestion requires a developer to accept or reject it. Nothing happens autonomously.
GitHub also offers a Copilot Coding Agent (cloud-based), which you can assign to a GitHub Issue by mentioning @copilot. It will open a pull request with the requested change. That PR still requires human review before merging, so the developer stays in control throughout.
The core difference: agents drive workflows forward on their own; Copilot tools wait for you and respond to you.
How They Fit Into .NET Workflows
Copilot in the IDE
Install GitHub Copilot or Copilot Chat in Visual Studio or VS Code. From that point it is part of your daily coding, suggesting completions as you type. You can define project conventions via a .github/copilot-instructions.md file so that suggestions match your team's code style. The .NET MAUI team uses this approach to keep AI suggestions consistent with their project structure.
Copilot Cloud Agent
For more repetitive work, assign GitHub Issues directly to the Copilot agent. It analyses your solution and opens a PR with the changes. For example, you can ask it to identify missing unit tests in an ASP.NET project and generate them as a separate PR. By default, Copilot agent pushes to a copilot/ branch and requires sign-off before anything merges, which keeps your main branch protected.
Custom Agents in .NET
For bespoke workflows, Semantic Kernel gives you a .NET SDK with an Agent Framework. You define skills (functions the agent can call), register them on a Kernel backed by an AzureOpenAIClient or OpenAI Chat API, and let the LLM decide which tools to invoke based on the current goal.
Below is a simplified example using Azure.AI.OpenAI to build a single-turn tool-calling agent:
using Azure.AI.OpenAI;
var client = new AzureOpenAIClient(endpoint, new AzureKeyCredential(apiKey));
var chat = client.GetChatCompletionsClient(deploymentName);
var searchFunction = new ChatFunction(
"SearchKnowledgeBase",
"Retrieve relevant info from knowledge base",
new() {
new FunctionParameter("query", "text", "The user's question")
});
var messages = new List<ChatMessage> {
ChatMessage.CreateSystemMessage("You are an AI assistant. Use the function to find data."),
ChatMessage.CreateUserMessage("What is the latest price for product X?")
};
var options = new ChatCompletionsOptions {
Messages = { messages[0], messages[1] },
Functions = { searchFunction }
};
var response = await chat.GetChatCompletionsAsync(options);
var choice = response.Value.Choices[0];
if (choice.FunctionCall != null)
{
var fnName = choice.FunctionCall.Name;
var fnArgs = choice.FunctionCall.Arguments;
var query = JsonDocument.Parse(fnArgs)
.RootElement.GetProperty("query").GetString();
string resultText = SearchKnowledgeBase(query);
messages.Add(ChatMessage.CreateFunctionMessage(fnName, resultText));
var finalResponse = await chat.GetChatCompletionsAsync(
new ChatCompletionsOptions {
Messages = { messages[0], messages[1], messages[2] }
});
Console.WriteLine(finalResponse.Value.Choices[0].Message.Content);
}
In production, SearchKnowledgeBase would call Azure Cognitive Search or a SQL database. Semantic Kernel wraps this kind of pattern in higher-level abstractions and supports multiple tools, memory, and multi-agent orchestration.
Deployment and Architecture
Copilot in the IDE needs no infrastructure changes, just install the extension and configure GitHub access. The Copilot agent runs on GitHub's infrastructure; you enable it in your repo settings.
Custom agents are a different story. They typically run as Azure Functions or ASP.NET Web APIs. Store API keys in Azure Key Vault or .NET user secrets, never hardcoded. Connect agents to your data sources (Cognitive Search, SQL, Cosmos DB) within private network boundaries where possible. For Azure OpenAI, use private endpoints to keep traffic off the public internet.
Observability
For custom agents, log everything: prompts, tool calls, responses, token counts, and latency. Application Insights and Azure Monitor work well here. Set up alerts on error rates and cost metrics since LLM token usage can grow quickly if something is misbehaving.
For Copilot, GitHub Enterprise provides usage dashboards showing completions per user and acceptance rates. Track merge rates for Copilot agent PRs: Microsoft's own .NET runtime data showed agent PRs merged at around 68% success versus 87% for human PRs, which underlines why review steps matter.
Security
Agents carry more risk than inline Copilot because they can take actions, not just suggest them. A few things to get right: restrict which external endpoints agents can reach (GitHub's Copilot agent includes a built-in firewall for this; custom agents need equivalent controls); do not send PII or proprietary code to third-party LLMs unless you are covered by a data processing agreement; use retrieval-augmented generation to ground agents in real data rather than relying on model memory; and run static analysis and security scanners on all AI-generated code before merging. GitHub's Copilot Code Review can flag vulnerabilities including secret scanning and CodeQL issues.

Join the conversation! Your thoughts help the community grow.