Lesson 2 of 4 Build Decisions for Agents and Models

Choosing Between Declarative and Custom Engine Agents

This lesson explains when to extend Microsoft 365 Copilot and when to build a custom engine agent.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe declarative agents and their tools.
  • Describe custom engine agents and what they add.
  • Choose an approach from audience, licensing and behaviour.

Declarative agents

A declarative agent extends Microsoft 365 Copilot with configuration: instructions, conversation starters, knowledge (such as SharePoint sites, Copilot connectors and other Microsoft 365 content), capabilities such as code interpreter, and actions from MCP servers or REST APIs. It runs on Copilot's own orchestrator and models, so it needs no separate hosting, and it inherits Microsoft 365 security, compliance and responsible AI controls. Declarative agents can be built in Agent Builder inside Microsoft 365 Copilot (the simplest, low-code option), in Copilot Studio, or with the Microsoft 365 Agents Toolkit in Visual Studio Code for professional developers.

Declarative agents suit work that happens inside Microsoft 365 apps, for individual users, where Copilot's reasoning is adequate and the main need is to focus Copilot on a domain and give it the organization's knowledge and actions.

Custom engine agents

A custom engine agent brings its own orchestrator and models. It can be built in Copilot Studio (whose agents have their own orchestration) or with code using the Microsoft 365 Agents SDK or Microsoft Foundry, and it can be published to Microsoft 365 Copilot, Teams and other channels. Custom engine agents need hosting, often in Azure at extra cost, and their builders take responsibility for compliance, responsible AI and security controls that a declarative agent would inherit. In return, they support custom orchestration logic, specific or fine-tuned models, group conversations, proactive messages triggered by events, agent-to-agent communication, and channels outside Microsoft 365, such as a public website.

The following table compares the two approaches on the factors that most often decide exam scenarios.

FactorDeclarative agentCustom engine agent
Orchestrator and modelMicrosoft 365 Copilot'sYour own choice
HostingNone neededRequired, often Azure
Compliance and responsible AIInherited from Microsoft 365Builder's responsibility
Proactive or event-driven behaviourNot supportedSupported
Channels outside Microsoft 365NoYes, such as websites
Typical buildersBusiness users, makersMakers and professional developers

Licensing and audience

Licensing often decides the choice. Users with a Microsoft 365 Copilot licence can use declarative agents as part of that licence. Users without it can use agents in Microsoft 365 Copilot Chat, but agents that work with organizational data are billed through Copilot Studio capacity, so the cost should be estimated. Custom engine agents built in Copilot Studio consume Copilot Credits whoever the user is. For an audience of customers or partners, Microsoft 365 Copilot is not available at all, so a custom engine agent on an external channel is required.

A practical decision sequence is: if the experience belongs in Microsoft 365 for employees and Copilot's reasoning is enough, extend Microsoft 365 Copilot with a declarative agent; if the agent must act proactively, use a specific model, serve external users or implement custom orchestration, build a custom engine agent.

Worked example

Choosing the agent type

A consultancy wants two agents. The first helps consultants draft proposals in Word using the firm's proposal library in SharePoint; all consultants have Microsoft 365 Copilot licences. The second must message a project manager in Teams automatically whenever a project's budget burn exceeds 80 percent, and suggest corrective actions. Which approach suits each agent?

The proposal agent works inside Microsoft 365 for licensed employees and needs SharePoint knowledge and focused instructions, so a declarative agent is the simplest and cheapest choice; it could be built in Agent Builder or Copilot Studio. The budget agent must act proactively when an event occurs, which declarative agents do not support, so it should be a custom engine agent, for example a Copilot Studio agent with an event trigger and a tool that reads project budgets, published to Teams.

Check yourself

An agent must serve customers on a public website. Can it be a declarative agent?

Show answer

No. Declarative agents run inside Microsoft 365 Copilot, which customers cannot use; a custom engine agent is needed for external channels.

Exam Tips

Remember for the exam

  • Declarative agents reuse Copilot's orchestrator and models and need no hosting.
  • Custom engine agents bring their own orchestration and support proactive, event-driven and external scenarios.
  • External users cannot use Microsoft 365 Copilot, so they need a custom engine agent.
  • Builders of custom engine agents own their compliance and responsible AI controls.