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.
npx agentmods add skills/microsoft/agents/agents-sdk-dotnet-activityhandler-migrationnpx skills add microsoft/Agents --skill agents-sdk-dotnet-activityhandler-migrationgit clone --depth 1 https://github.com/microsoft/AgentsWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00076 | $0.09442 |
| Opus 5 | $0.00038 | $0.04721 |
| Sonnet 5 | $0.00015 | $0.01888 |
| Haiku 4.5 | $0.00008 | $0.00944 |
Grade A, and why
agents-sdk-dotnet-activityhandler-migration 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.
How it starts
The opening of the file, as written. The whole thing — 759 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Agents SDK ActivityHandler → AgentApplication Migration (.NET)
Overview
Upgrades a bot from the ActivityHandler compat layer to the modern AgentApplication routing pattern. This is ONLY for DotNet projects that already use Microsoft.Agents.* packages. If the project is still using Microsoft.Bot.* packages the bf-to-agents-sdk-dotnet-migration skill should be used first.
Two entry points:
- Standalone: The bot already uses
Microsoft.Agents.*packages, namespaces, and appsettings — focus is on the bot class, Program.cs, and endpoint mapping. - Second step after
bf-to-agents-sdk-dotnet-migration: Packages, namespaces, and appsettings were converted in that step — this skill handles the AgentApplication conversion.
What Does NOT Need to Change
Verify each of these is already correct — do not modify unless broken:
| Item | Expected State |
|---|---|
| Namespaces in bot class | Already Microsoft.Agents.* — only remove compat namespaces |
appsettings.json |
Already has Connections + TokenValidation sections |
builder.Services.AddAgentAspNetAuthentication(...) |
Already present — keep |
AspNetExtensions.cs (if present) |
Sample-provided auth helper — keep as-is |
| Custom DI in Program.cs | Preserve dialogs, adapters, custom services — but remove ConversationState and UserState (see Step 2) |
⚠️ If beta packages are required: Tell the user explicitly: "This migration uses pre-release (
-beta) Agents SDK packages, which are nightly builds and not suitable for production. Upgrade to a stable release before deploying."
Handler Mapping: ActivityHandler → AgentApplication
| ActivityHandler Override | AgentApplication Registration |
|---|---|
OnMessageActivityAsync(ITurnContext<IMessageActivity>, CT) |
OnActivity(ActivityTypes.Message, handler, rank: RouteRank.Last) |
OnMembersAddedAsync(IList<ChannelAccount>, ITurnContext<IConversationUpdateActivity>, CT) |
OnConversationUpdate(ConversationUpdateEvents.MembersAdded, handler) |
OnMembersRemovedAsync(...) |
OnConversationUpdate(ConversationUpdateEvents.MembersRemoved, handler) |
OnMessageUpdateActivityAsync(...) |
OnActivity(ActivityTypes.MessageUpdate, handler) |
OnMessageDeleteActivityAsync(...) |
OnActivity(ActivityTypes.MessageDelete, handler) |
OnReactionsAddedAsync(IList<MessageReaction>, ...) |
OnMessageReactionsAdded(handler) |
OnReactionsRemovedAsync(IList<MessageReaction>, ...) |
OnMessageReactionsRemoved(handler) |
OnEventAsync(ITurnContext<IEventActivity>, CT) |
OnEvent(eventName, handler) or OnActivity(ActivityTypes.Event, handler) |
OnInvokeActivityAsync(...) with adaptiveCard/action + verb switch |
AdaptiveCards.OnActionExecute(verb, handler) — one registration per verb (preferred) |
OnInvokeActivityAsync(...) with application/search |
AdaptiveCards.OnSearch(dataset, handler) — one registration per choices.data.dataset value |
OnInvokeActivityAsync(...) (other invoke types) |
OnActivity(ActivityTypes.Invoke, handler) |
OnTurnAsync(...) override (cross-cutting) |
OnBeforeTurn(handler) / OnAfterTurn(handler) |
OnInstallationUpdateActivityAsync(...) |
OnActivity(ActivityTypes.InstallationUpdate, handler) |
OnEndOfConversationActivityAsync(...) |
OnActivity(ActivityTypes.EndOfConversation, handler) |
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.
- 2d ago First seen · 759 lines · 76 tokens per session scan A db61a9a3eb35
agents-sdk-dotnet-activityhandler-migration is a skill published in the GitHub repository microsoft/Agents (1,050 stars, last pushed 5d ago), licensed MIT. It adds 76 tokens to every session and 9,442 once invoked, about $0.0004 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.
Other skills, from other repositories
m365-agents-dotnet
Microsoft 365 Agents SDK for .NET. Build multichannel agents for Teams/M365/Copilot Studio with ASP.NET Core hosting, AgentApplication routing, and MSAL-based auth. Triggers: "Microsoft 365 Agents SDK", "Microsoft.Agents", "AddAgentApplicationOptions", "AgentApplication", "AddAgentAspNetAuthentication", "Copilot…
azure-ai-agents-persistent-dotnet
Azure AI Agents Persistent SDK for .NET. Low-level SDK for creating and managing AI agents with threads, messages, runs, and tools. Use for agent CRUD, conversation threads, streaming responses, function calling, file search, and code interpreter. Triggers: "PersistentAgentsClient", "persistent agents", "agent…
azure-ai-openai-dotnet
Azure OpenAI SDK for .NET. Client library for Azure OpenAI and OpenAI services. Use for chat completions, embeddings, image generation, audio transcription, and assistants. Triggers: "Azure OpenAI", "AzureOpenAIClient", "ChatClient", "chat completions .NET", "GPT-4", "embeddings", "DALL-E", "Whisper", "OpenAI .NET".
azure-ai-projects-dotnet
Azure AI Projects SDK for .NET. High-level client for Azure AI Foundry projects including agents, connections, datasets, deployments, evaluations, and indexes. Use for AI Foundry project management, versioned agents, and orchestration. Triggers: "AI Projects", "AIProjectClient", "Foundry project", "versioned agents"…
azure-eventgrid-dotnet
Azure Event Grid SDK for .NET. Client library for publishing and consuming events with Azure Event Grid. Use for event-driven architectures, pub/sub messaging, CloudEvents, and EventGridEvents. Triggers: "Event Grid", "EventGridPublisherClient", "CloudEvent", "EventGridEvent", "publish events .NET", "event-driven"…
azure-mgmt-mongodbatlas-dotnet
Manage MongoDB Atlas Organizations as Azure ARM resources using Azure.ResourceManager.MongoDBAtlas SDK. Use when creating, updating, listing, or deleting MongoDB Atlas organizations through Azure Marketplace integration. This SDK manages the Azure-side organization resource, not Atlas clusters/databases directly.