Agents-for-net copilot-instructions.md

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

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/microsoft/agents-for-net/copilot-instructions
Clone the repo
git clone --depth 1 https://github.com/microsoft/Agents-for-net

Made for: GitHub Copilot.

Per session 2,253 This file is loaded in full into every session.
When invoked 2,253 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.02253 $0.02253
Opus 5 $0.01126 $0.01126
Sonnet 5 $0.00451 $0.00451
Haiku 4.5 $0.00225 $0.00225

Measured 2d ago against content hash 72d5dde1b2b3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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 · 170 lines

How it starts

The opening of the file, as written. The whole thing — 170 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.sln

# 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.sln

Architecture

The SDK is organized into layered libraries under src/libraries/. See doc/architecture.md for a 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.Services.AddAgentAspNetAuthentication(builder.Configuration);
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 / TeamsTurnContextSendTargetedActivityAsync() 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 · 170 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. 2d 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 (177 stars, last pushed 4d ago), licensed MIT. It adds 2,253 tokens to every session, about $0.0113 per session on Opus 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

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

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 · 6,785 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 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,345 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, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

next.js 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,296 tokens