M365Con 2027 – free online conference · 11–22 Jan 2027 · 120 sessions m365con.net

Blog · Mirko Peters

How to Build AI Agents in Microsoft 365: 3 Ways Compared

By · · Updated

How to build AI agents in Microsoft 365: Agent Builder, Copilot Studio or pro code with Foundry and the Agents SDK, compared by cost, hosting and governance.

How to build AI agents in Microsoft 365 comes down to three paths: Agent Builder (no code), Copilot Studio (low code) and a pro-code route with Microsoft Foundry, the Microsoft 365 Agents SDK and the Agents Toolkit. The detailed choice between the first two is in Copilot Agent Builder vs Copilot Studio.

Key points

  • A chatbot answers inside a conversation. An agent combines knowledge with actions, triggers and workflows that change things in other systems.
  • Agent Builder configures declarative agents in plain language. It runs on Copilot's model and orchestrator and cannot author actions against external services.
  • Copilot Studio is the low-code studio for connectors, workflows, topics, external channels and separate environments. Its harness affects capabilities and billing.
  • Pro code uses Foundry, the Agents SDK and Agents Toolkit for your own model and orchestration; the Toolkit also builds declarative agents with API plugins.
  • Declarative agents inherit Microsoft 365 compliance and security. With custom engine agents, compliance, hosting and cost become your job.
  • Start with the simplest path that meets the scenario. An Agent Builder agent can be copied to Copilot Studio later as a separate snapshot, not a synchronized upgrade.

AI agent vs chatbot

A chatbot waits for a question and answers inside the conversation. Microsoft Learn describes agents as specialized assistants with two building blocks: knowledge (instructions and data sources) and actions (actions, triggers and workflows that automate business processes). If the idea only needs answers from documents, it's a grounded Q&A assistant, which is the cheapest case.

Declarative vs custom engine agents

Pick the agent type before the tool. Learn defines two:

  • Declarative agents use Copilot's orchestrator and foundation models. No additional hosting is required, and they inherit Microsoft 365 compliance, Responsible AI and security standards. They rely on user-initiated interactions.
  • Custom engine agents bring their own orchestration and AI models. They can trigger actions without direct user input. They need hosting outside Microsoft 365, typically on Azure at extra cost, and compliance and security are on you.

My rule of thumb: every step from declarative to custom engine moves work from Microsoft to your team. Take that step only for a requirement you can name.

Path 1: Agent Builder (no code)

Agent Builder lives inside Microsoft 365 Copilot on the web and in the Teams desktop and web clients, not on mobile. You describe the agent in natural language, add knowledge such as SharePoint content and Copilot connectors, test it and share it. The result is a declarative agent.

Learn states the limits: Agent Builder cannot author actions that integrate external services, Customer Managed Keys aren't supported, and its agents can't be used in Teams group or 1:1 chats.

Path 2: Copilot Studio (low code)

Copilot Studio is a separate web app at copilotstudio.microsoft.com. You get prebuilt and custom connectors, topics (designed conversation paths), agent flows and analytics. Agents can reach employees and customers across Teams, Microsoft Copilot, websites, mobile apps and other channels. Some agents can get their own account to work proactively on tasks.

Copilot Studio uses three harnesses: the Microsoft Copilot harness for reasoning-heavy, multi-step work, the Customer Conversation harness for customer service over voice and chat, and the standard harness for rule-based, structured conversations. The harness affects capabilities and billing.

Billing runs on Copilot Credits, which replaced messages on September 1, 2025. You pay through prepaid packs, pay-as-you-go via an Azure subscription, or a one-year prepurchase plan. For agents on the standard harness there's an exception: for Microsoft 365 Copilot license holders, classic answers, generative answers and Graph grounding in Copilot Chat, Teams or SharePoint aren't charged when the agent runs with the user's identity.

Path 3: Foundry, Agents SDK and Agents Toolkit (pro code)

Foundry bills per call for inference and tools, hosted agents add container compute, and voice agents add speech and telephony charges. See the Foundry portal walkthrough.

How to build AI agents in Microsoft 365: comparison

AreaAgent BuilderCopilot StudioFoundry + Agents SDK + Toolkit
Who buildsBusiness users, no codeMakers and IT, low codeDevelopers, pro code
Agent typeDeclarativeDeclarative or custom engineMostly custom engine (Toolkit also builds declarative)
Model and orchestrationCopilot'sManaged by the selected harnessYour choice
HostingNone neededManaged SaaSFoundry-managed or your own Azure hosting
Licensing and billingDepends on tenant licensesCopilot Credits, harness-dependentAzure consumption: inference, tools, compute
KnowledgeMicrosoft 365 content, Copilot connectors, webConnected knowledge sources and connectorsAny source you wire up, e.g. file search
ActionsNo external-service actionsConnectors, tools, workflowsFunctions, OpenAPI, MCP, your code
GovernanceMicrosoft 365 agent controls, data-source permissionsPower Platform environment and connector controls plus Microsoft 365 controlsEntra identity, RBAC, network isolation, your own compliance
PublishingShare in the org, org catalogTeams, Microsoft Copilot, websites, mobile and moreMicrosoft 365 Copilot, Teams; other channels via the SDK

Decision guide

Answer in order and stop at the first yes:

  1. Do you need your own model, your own orchestration or multi-agent logic in code? Go pro code. Plan hosting and compliance first.
  2. Do you need an external channel, actions against external systems, workflows or separate dev, test and production environments? Use Copilot Studio and choose the harness first. Copilot Studio ALM covers the environment part.
  3. Do instructions plus Microsoft 365 knowledge cover the scenario? Use Agent Builder.

My recommendation: prototype in Agent Builder even if you expect to need more. You learn quickly whether the knowledge is good enough, and you can copy the agent to Copilot Studio later. The copy is a separate snapshot, and some knowledge sources and capabilities need reconfiguration.

Common pitfalls

  • Picking the Copilot Studio harness after the design.
  • Treating license checks as one question. Learn says to confirm maker access separately from end-user access and consumption.
  • Ignoring identity. An agent with its own account or Entra identity needs an owner and a permissions review.
  • Expecting Agent Builder's SharePoint auto-sharing to reach everyone. It works only with specific security groups.

Related

Sources

Follow the showApple PodcastsSpotify

FAQ

What are the three ways to build AI agents in Microsoft 365?

Agent Builder inside Microsoft 365 Copilot for no-code declarative agents, Copilot Studio for low-code agents with connectors and workflows, and a pro-code route with Microsoft Foundry, the Microsoft 365 Agents SDK and the Microsoft 365 Agents Toolkit, mainly for custom engine agents.

What is the difference between an AI agent and a chatbot?

A chatbot reacts to questions within one conversation. Microsoft Learn describes agents as specialized assistants built from knowledge plus actions, triggers and workflows that automate business processes. Custom engine agents can also act proactively without direct user input.

Do declarative agents need their own hosting?

No. Declarative agents use Copilot's orchestrator and foundation models, so no additional hosting is required. Custom engine agents need hosting outside Microsoft 365, typically on Azure, at additional cost.

How is Copilot Studio billed?

In Copilot Credits, through prepaid packs, pay-as-you-go via an Azure subscription, or a prepurchase plan. On the standard harness, for Microsoft 365 Copilot license holders, classic answers, generative answers and Graph grounding in Copilot Chat, Teams or SharePoint aren't charged when the agent runs with the user's identity.

Which languages does the Microsoft 365 Agents SDK support?

C# on .NET 8.0, JavaScript on Node.js 18 and later, and Python 3.9 to 3.11. The SDK is AI-agnostic: you plug in the AI services and orchestration libraries you prefer.

Entities in this article

Topics of this article:

AI agent – Narrower topic of AI assistant Agent Builder (Microsoft 365 Copilot) – Part of Microsoft 365 Copilot Copilot Studio – Low-code tool by Microsoft Microsoft Foundry – Developer tool by Microsoft Microsoft 365 Agents SDK – Part of Microsoft 365 Chatbot – Concept

Related articles

More articles on AI agent:

RSS