How to build an AI agent on Microsoft comes down to three choices: what job the agent does, which Microsoft tool you build it with, and which controls you put around it before it touches real work. This guide walks through the steps we follow when we build agents for our own business and for clients, from picking one process to approvals, cost caps and audit logs, and explains when to use Copilot Studio, when to use Microsoft Foundry, and when a custom build is the better route.
The 3 ways to build an AI agent on Microsoft
Before you decide how to build an AI agent, know the three routes Microsoft gives you. They are not competitors; many businesses use more than one.
| Copilot Studio | Microsoft Foundry | Custom build on your stack | |
|---|---|---|---|
| What it is | Low-code agent builder | Azure platform for models and agents | An agent built in code for one process |
| Best for | Defined tasks in Teams and Microsoft 365 | Developers building agents with model choice | Whole processes across many systems |
| Who builds it | Power users or a partner | Developers | A development partner or your engineers |
| Connects to | Power Platform connectors and flows | Tools and APIs you define | Any system with an API |
| Controls | Power Platform admin settings | Azure security and monitoring | Whatever the process needs, by design |
Microsoft’s quickstart for creating an agent in Copilot Studio is a good way to see the low-code route in an hour. For the developer route, see what Microsoft Foundry is.
Step 1: Pick one process
The most important step in how to build an AI agent is choosing the right first job. A good first process is:
- High volume: it happens many times a week;
- Rule-based: a new hire could learn it from a written checklist;
- Measurable: you can count how long it takes today;
- Low risk to start: mistakes can be caught before a customer sees them.
Answering inbound inquiries, sorting a shared inbox, matching bank activity to invoices and preparing routine documents are common first agents. Avoid “an agent that does everything for sales”. Pick one job.
Step 2: Write down the rules
Before any build, write the rules the agent will follow, in plain words:
- What it may read, and from which systems.
- What it may do on its own.
- What must wait for a person, and who that person is.
- What it must never do.
- How much it may spend in a day on model usage.
This document becomes the agent’s instructions and its test plan. In our own agents, the rule “anything that affects a customer, money, a bid or a candidate is approved by a person” is written down before a single line of code.
Step 3: Choose the build route
Use the rules to pick the route:
- Copilot Studio when the task lives in Teams and Microsoft 365, the systems have a Power Platform connector, and the steps are a defined conversation or flow.
- Microsoft Foundry when developers need model choice, their own tools and Azure-level security and monitoring.
- A custom build on your stack when the process crosses several non-Microsoft systems, writes to them, and needs approvals, cost caps and an audit trail designed for that process.
Our own agents are custom builds: they run on Azure, use the model that fits each task and talk to staff in Microsoft Teams, while they act in our ERP, CRM and helpdesk.
Step 4: Connect the tools
An agent is only as useful as the tools it can use. Each tool is one action with clear limits: “read this ticket”, “draft a reply”, “create a lead”, “check an invoice”. Keep each tool narrow and give the agent only the tools its job needs.
Access matters as much as the tools. The agent should reach your systems through a governed gateway with least-privilege permissions, and never hold passwords itself. Secrets belong in a vault such as Azure Key Vault.
Step 5: Add approvals, cost caps and logs
This is the step most guides on how to build an AI agent skip, and the one that decides whether you can trust it:
- Approvals: steps that need a person post an approval card in Teams with the exact action, and the person approves, modifies or rejects it.
- A pinned model and a daily cost cap: so behavior and spend stay predictable.
- An audit log: every run, tool call and approval recorded.
- An off switch: for each agent, and one for all of them.
We run all of this for our own agents from one place, our AI Command Center, where each agent is switched on, budgeted and audited.
Step 6: Run it in shadow mode
Anyone learning how to build an AI agent safely should treat this step as non-negotiable. Before an agent does real work, let it propose while people still do the job. Compare its proposals with what people actually did, fix the rules and tools where it was wrong, and repeat until its results hold up. Only then switch the first low-risk steps on.
Step 7: Go live and measure
Go live one step at a time and measure what matters: actions taken, approvals given, mistakes caught, cost and time saved. Review the numbers monthly and move a step to “runs alone” only when the record shows it is safe.
A worked example: how to build an AI agent for a shared inbox
Here is how the seven steps look for one of the first agents most businesses build: sorting a shared sales or support inbox.
- Process: every new email to the shared inbox, many times a day.
- Rules: sort each email into spam, newsletter, sales inquiry, order, support or other; never reply, never delete; archive spam so it can be restored.
- Route: rules first for the obvious cases, a small low-cost model for the rest, built to run inside your own Azure tenant.
- Tools: read the email, read the sender history, apply a tag, archive spam. Nothing else.
- Controls: a daily cost cap, a log of every decision and its reason, and an off switch.
- Shadow mode: the agent proposes a tag while people still sort; compare the two until they agree.
- Live: the agent tags; people review a sample each week and every case where it was unsure.
That is the pattern behind every agent we run: a narrow job, written rules, narrow tools, controls from day one and proof before trust. Once this works, the same inbox agent becomes the front door that hands each email to the agent that owns it.
Common mistakes when building an AI agent
- Starting too big. An agent for a whole department rarely ships. One process does.
- Skipping the rules. Without written rules there is nothing to test against.
- Too much access. Give the agent the narrowest access that does the job.
- No approvals. Customer-facing and money steps need a person until proven safe.
- No cost cap. A loop that calls a large model all night is an expensive surprise.
What it costs to build an AI agent
Cost depends on the route and the number of systems involved. A Copilot Studio proof of concept is a small project; a production agent with several integrations and approval steps is a larger one, followed by model usage and monitoring. We publish our own price ranges for AI agent development services, from a free readiness assessment to managed operations, so you can see the range before you talk to anyone.
Frequently asked questions
What is the first step in how to build an AI agent?
Choosing one process and writing down its rules: what the agent may read, what it may do alone, what waits for a person and what it must never do. Everything else follows from that.
Do I need developers to build an AI agent on Microsoft?
Not for a simple Copilot Studio agent; a skilled power user can build one. For agents that write to several systems with approvals and cost control, you need developers or a partner.
How long does it take to build an AI agent?
A Copilot Studio proof of concept can take a week or two. A production agent for one process, with integrations, approvals and shadow mode, usually takes several weeks.
Which AI model should the agent use?
The one that fits the task. Routine sorting can run on a small, low-cost model; drafting and reasoning may need a larger one. Pin the model so behavior and cost stay predictable.
Can I build an AI agent without Copilot licenses?
Yes. A custom agent on Azure does not need Microsoft 365 Copilot licenses for the people it serves; staff can work with it in Teams. Copilot Studio has its own licensing.
Where should we start?
The simplest answer to how to build an AI agent is to start with one process and its written rules. Our free AI readiness assessment finds the process worth an agent first and gives a fixed price for building it.



Leave a Reply
You must be logged in to post a comment.