Agents-for-net: Instructions file for GitHub Copilot

.github/copilot-instructions.md

Agents-for-net copilot-instructions.md is an instructions file for GitHub Copilot from microsoft/Agents-for-net. It costs 2,403 tokens per session, scanned A, original, MIT.

Repository instructions for the Microsoft 365 Agents SDK for .NET, a software framework for building conversational agents that work with Microsoft 365, Teams, and related services.

In plain words
What is it for?
Building the full SDK or one project, running all tests or a selected test, understanding its layered libraries, and packaging the libraries for distribution.
Why use it?
They give coding agents the project's structure and the commands needed to build, test, restore dependencies, and create NuGet packages. NuGet is .NET's package system.

Instructions file for GitHub Copilot ✓ vendor

Written for GitHub Copilot: a Copilot instructions file.

This is microsoft/Agents-for-net's own configuration. It tells GitHub Copilot how to work on Agents-for-net itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything Agents-for-net configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is dotnet test --no-build -c Debug ./src/.

About the project

Microsoft 365 Agents SDK is a C# and .NET software development kit for building agents that interact with users across Microsoft 365, Teams, Copilot Studio, Webchat, and selected third-party services. Developers use it to handle conversations, coordinate requests, generate responses, and enable collaboration between agents. The catalogue entries provide coding-agent instructions and agents for working with this SDK.

microsoft/Agents-for-net · 183 stars · on GitHub

Reuse

Borrowing it

Nothing to install: this file belongs to microsoft/Agents-for-net. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/microsoft/Agents-for-net/main/.github/copilot-instructions.md
Clone the repo
git clone --depth 1 https://github.com/microsoft/Agents-for-net

Made for: GitHub Copilot.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Agents-for-net copilot-instructions.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/microsoft/agents-for-net/copilot-instructions/github.svg)](https://agentmods.dev/instructions/microsoft/agents-for-net/copilot-instructions)
Your own site
<a href="https://agentmods.dev/instructions/microsoft/agents-for-net/copilot-instructions"><img src="https://agentmods.dev/badge/instructions/microsoft/agents-for-net/copilot-instructions/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for Agents-for-net copilot-instructions.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/microsoft/agents-for-net/copilot-instructions"><img src="https://agentmods.dev/badge/instructions/microsoft/agents-for-net/copilot-instructions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,403 This file is loaded in full into every session.
When invoked 2,403 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.02403 $0.02403
Opus 5.5 $0.00961 $0.00961
Sonnet 5.5 $0.00481 $0.00481
Haiku 4.5 $0.00240 $0.00240

Measured 20d ago against content hash ce14caaed0db, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

Agents-for-net copilot-instructions.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 20d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/copilot-instructions.md · 181 lines

How it starts

The opening of the file, as written. The whole thing — 181 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Copilot Instructions for Agents-for-net

Project Overview

This is the Microsoft 365 Agents SDK for .NET — a framework for building enterprise-grade conversational agents that work across M365, Teams, Copilot Studio, and other platforms.

Current State: Generally Available (GA)
Documentation: https://learn.microsoft.com/en-us/microsoft-365/agents-sdk/

Build and Test

# Build entire solution
dotnet build src/Microsoft.Agents.SDK.slnx

# Build via top-level project (includes all libraries)
dotnet build AgentSdk.proj

# Restore dependencies
dotnet restore AgentSdk.proj

# Run all tests
dotnet test --no-build -c Debug ./src/

# Run tests for a single project
dotnet test src/tests/Microsoft.Agents.Core.Tests/

# Run a single test
dotnet test --filter "FullyQualifiedName~Namespace.ClassName.MethodName"

# Create NuGet packages
dotnet pack --no-build -c Debug src/Microsoft.Agents.SDK.slnx

Architecture

The SDK is organized into layered libraries under src/libraries/. See docs/architecture.md for an architecture overview.

Agent Pattern

public class MyAgent : AgentApplication
{
    public MyAgent(AgentApplicationOptions options) : base(options)
    {
        OnConversationUpdate(ConversationUpdateEvents.MembersAdded, WelcomeMessageAsync);
        OnActivity(ActivityTypes.Message, OnMessageAsync, rank: RouteRank.Last);
    }
}

ASP.NET Core Startup

builder.AddAgent<MyAgent>();
builder.Services.AddSingleton<IStorage, MemoryStorage>();
builder.AddAgentAuthorization(ConfigureAuthentication);
app.MapAgentApplicationEndpoints(requireAuth: !app.Environment.IsDevelopment());

See src/samples/EmptyAgent/Program.cs for the canonical minimal example.

Extensions

Microsoft.Agents.Extensions.MSTeams (src/libraries/Extensions/Microsoft.Agents.Extensions.MSTeams/)

  • Full Microsoft Teams extensibility: message extensions, task modules, meeting events, channel/team lifecycle, and file consent
  • Aligns its models and public feature surface with the Teams SDK. When the Teams SDK removes a feature, MSTeams removes the corresponding feature rather than maintaining a compatibility implementation. These removals are breaking changes for MSTeams users and may occur in minor or patch releases.
  • Depends on teams.net's Microsoft.Teams.Apps NuGet package for Teams schema, API clients, and feature types (e.g. Microsoft.Teams.Apps.Schema.TeamsChannelData, Microsoft.Teams.Apps.Clients.ApiClient, Microsoft.Teams.Apps.MessageExtensions.*); it reimplements only routing on AgentApplication
  • Agent 365 lifecycle events are not handled by the Agents SDK or the MSTeams extension. Use the A365 Agent Extension (Microsoft.Agents.A365.Notifications) for these events.
  • Enable with [TeamsExtension] attribute on a partial AgentApplication subclass — source generator creates a Teams property of type TeamsAgentExtension
  • Two routing styles: fluent builders (Teams.MessageExtensions.OnQuery(...)) or declarative attributes ([TeamsQueryRoute("cmdId")])
  • Feature areas exposed as properties on TeamsAgentExtension (accessed via the generated Teams property):
    • Teams.MessageExtensions — search queries, link unfurling, anonymous link unfurling, action commands, compose previews, card button clicks, settings
    • Teams.TaskModules — modal dialogs (fetch + submit), supports string or Regex key matching
    • Teams.Meetings — start/end, participants join/leave
    • Teams.Channels — created/deleted/renamed/restored/shared/unshared; member add/remove
    • Teams.Teams — archived/unarchived/renamed/deleted/restored
    • Teams.FileConsent — file upload consent accept/decline
  • TeamsAgentExtension also provides Graph helpers: GetTeamsClient() (teams.net Microsoft.Teams.Apps.Clients.ApiClient), GetGraphClient() (user token), GetAppGraphClient() / GetAppGraphClientForConnection() (app-only)
  • App-level Teams route extension methods on AgentApplication (in TeamsAppExtensions): OnTeamsHandoff() (Copilot handoff), OnTeamsFeedbackLoop(), OnTeamsMessageReactionsAdded() / OnTeamsMessageReactionsRemoved(), plus generic OnTeamsActivity() / OnTeamsMessage() / OnTeamsConversationUpdate() / OnTeamsEvent()
  • ITeamsTurnContext / TeamsTurnContext — SendTargetedActivityAsync() for sending to specific recipients
  • TeamsActivityExtensions — activity helpers: TeamsGetChannelId(), TeamsGetMeetingInfo(), TeamsGetTeamInfo(), TeamsEnableFeedbackLoop(), etc.
  • Route builders accept autoSignInHandlers and route attributes accept signInHandlers parameter for per-route OAuth/SSO flows; Teams SSO and OBO via Azure Bot Token Service are supported
  • Feedback is the FeedbackLoop feature in AgentApplication; use AgentApplication.OnFeedbackLoop() or [FeedbackLoopRoute] rather than treating it as an MSTeams-specific feature.
  • Adaptive Cards support is handled by AgentApplication.AdaptiveCards

Read the full file on GitHub · 181 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 20d ago Changed · +2 tokens per session ce14caaed0db
  2. 27d ago Changed · +7 lines · +79 tokens per session 8df57a3e26d2
  3. 1mo ago Changed · +5 lines · +100 tokens per session 59a8e46ee8f5
  4. 1mo ago Changed · -1 lines · -31 tokens per session 9e0aded84d20
  5. 2mo ago First seen · 170 lines · 2,253 tokens per session scan A 72d5dde1b2b3

Subscribe to this mod's changes

Agents-for-net copilot-instructions.md is an instructions file published in the GitHub repository microsoft/Agents-for-net (183 stars, last pushed today), licensed MIT. It adds 2,403 tokens to every session, about $0.0096 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 9,715 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,461 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,750 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 4,261 tokens