Where should your AI agent live? Copilot Studio, Foundry or code
Choose between Copilot Chat, Agent Builder, Copilot Studio, Microsoft Foundry and custom code, with practical examples, cost comparisons and six questions to guide your decision.
In summary
Configure where you can, code where you must, and build the plug once. A practical guide to choosing between Copilot Chat, Agent Builder, Copilot Studio, Microsoft Foundry and your own application on Azure, with worked costs, six decision questions and reusable business tools.
Key takeaways
- Choose the simplest option that meets the functional, security and operational requirements.
- Use deterministic checks for hard business rules, whichever agent platform calls them.
- Compare licences, model use, hosting, engineering and support rather than token costs alone.
- Expose reusable business capabilities through secured MCP tools or APIs.
- Touches the customer? You may need code
Product details and illustrative costs reflect research dated 8 November 2026. Prices in the worked examples are US-dollar list prices before VAT; UK reseller pricing differs. Confirm current licensing, model availability and terms for your tenant.
Where should you build an AI agent?
The controls should match the job: answering a policy question, opening a ticket, validating an invoice and booking a repair have different requirements.
If your organisation runs on Microsoft 365 and Azure, you have probably been asked where its AI agents should be built. In Copilot? Copilot Studio? Microsoft Foundry? Or a Python application your developers write? Then someone mentions Fabric, Dataverse and Entra, and a fairly simple decision starts to sound like an exam.
There are five useful starting points, each with a different balance of control, cost and responsibility. This guide:
- explains the parts of an agent and how Microsoft’s services fit together;
- compares the five options, including their strengths, limits and charging models;
- sets out six questions to help you choose and recognise when to change approach;
- shows how hybrid systems work and who should run them;
- explains when custom code justifies its extra cost.
You should be able to take an agent idea, choose a sensible home for it, estimate the running costs and recognise when it needs to move.
I’ve written this for business and IT leaders who need to make that decision, and for developers who want a practical way to judge when custom code earns its cost.
Each option suits different jobs. A policy helper and a customer booking service need different controls, even if they use the same model.
My rule of thumb is simple: configure where you can, code where you must, and build the plug once.
If you read only this
- The harness is a major difference. It controls identity, permissions, rules, approvals, retries and logging around the model.
- Choose the simplest option that meets the requirements. Move up when a specific functional, security or operational need justifies it.
- Many internal agents can stay in Microsoft’s configured tools. External products, complex rules and high usage may justify more engineering.
- Compare the whole cost. Seats pay for people, credits meter agent usage and tokens meter model work. Tokens exclude the work of building and running the service.
- Check the model’s terms in the product you will use. Claude’s contract, processing location and subscription requirements differ between Copilot Studio and Foundry.
- Review permissions before launch. Agents can make existing oversharing easier to discover.
- Reuse business capabilities through secured MCP tools or APIs. This reduces the integration work if you change agent platforms.
- Use code where you need enforceable checks. You can place a single critical capability behind a tool without rebuilding the whole agent.
Part 1: The parts, in plain English
What an agent is
An AI agent combines a model with instructions, information and tools so it can carry out a particular job. It helps to think of it as six parts:
The model is one part of an agent. Instructions, knowledge, tools, runtime controls and a way to interact with it complete the system.
- A brain: the model, such as GPT or Claude, that reads, reasons and writes.
- A brief: instructions describing the job, expected behaviour and limits.
- Knowledge: documents and data the agent can consult.
- Hands: tools that let it look up records or take actions, such as opening a ticket or booking a slot.
- A harness: the runtime and controls around the model, including identity, permissions, validation, approvals, retries and logs.
- A front door: where people interact with it, such as Teams or your website. A background agent may start from an event instead.
Every option in this guide supplies those six parts. They differ in who builds each part, how much control you get over it, and how you pay. The harness matters more than people expect: in Microsoft's own internal tests of Copilot Studio, "changing models had little impact on pass rates, but changing harnesses made a substantial difference" (vendor evaluation, October 2026).
Microsoft groups agents by how independently they work: retrieval agents answer questions from information; task agents take specific actions when asked; and autonomous agents carry out multi-step work in response to an event. The Cloud Adoption Framework, Microsoft’s adoption guidance, also describes these as productivity, action and automation agents. As an agent gains more freedom to act, its harness needs tighter controls.
The map: five layers
Separate the architecture into five layers. They answer different questions: where people interact, where the agent runs, which model it uses, which systems it can reach, and who controls access.
The configured agent sits between its front door, model and business systems. Identity and governance apply across the architecture; this is a relationship map rather than a sequence of execution steps.
Layer | What sits there |
|---|---|
Front doors | Teams, Microsoft 365 Copilot, Outlook; your website or app; nothing (background work) |
Where an agent is configured | Copilot Chat, Agent Builder, Copilot Studio, Microsoft Foundry's Agent Service, your own code |
Models | Copilot's built-in models; Foundry's catalogue (GPT, Claude, Llama, Mistral, DeepSeek, Grok and Microsoft's own); or a provider's own API |
Tools and data | Connectors and MCP servers; SharePoint, Dataverse, Fabric, Azure AI Search, your line-of-business systems |
Identity and governance | Entra ID, Purview, Agent 365, the Power Platform admin centre |
This guide focuses on the second layer: where you configure or build the agent. Foundry also supplies models to applications hosted elsewhere, so using a Foundry model does not mean Foundry runs your agent.
The names you'll hear
Name | What it is, plainly |
|---|---|
Microsoft 365 tenant | Your organisation's Microsoft 365: its people, mail, files and Teams. Copilot works inside it. |
Azure subscription | A billing and access container for the Azure services you run. One tenant can have many. If your MSP resells Azure, it may be a CSP (Cloud Solution Provider) subscription, which matters later. |
Microsoft Entra ID | The company directory, formerly Azure Active Directory. Every person, app and agent has an account; every Microsoft service checks it before letting anything in. |
Entra Agent ID | Accounts for agents rather than people, so an agent can have its own permissions, be audited and be switched off. Available to all Entra customers; the extra security controls for agents need Agent 365. |
Microsoft Graph | The single doorway to Microsoft 365 data: mail, calendars, files, chats, people. Copilot reads through it. |
SharePoint and OneDrive | Where most of your documents live. |
Power Platform | Microsoft's low-code family: Power Apps, Power Automate, over 1,000 prebuilt connectors to other systems (Microsoft quotes 1,400–1,500), and Copilot Studio. Work is organised into environments, each tied to a region. |
Dataverse | The database inside a Power Platform environment. Dynamics 365 runs on it. |
Microsoft Fabric | The analytics platform: one data lake for the organisation (OneLake) and the agreed definitions of your numbers (semantic models, the same ones Power BI uses). |
Azure AI Search | The search engine that lets AI look things up in large or mixed sets of documents. Foundry IQ, Foundry's knowledge feature, is built on it. |
Copilot connectors | Formerly Graph connectors. They bring other systems' content (ServiceNow, Confluence, Salesforce) into Copilot's reach. |
Microsoft Foundry | Azure's platform for AI models and agents. Formerly Azure AI Foundry (renamed November 2025), before that Azure AI Studio. Azure OpenAI is now part of it. |
Purview | Data protection: sensitivity labels, data-loss rules and checks for oversharing. |
Agent 365 | A central register and control panel for agents, licensed per user (generally available for commercial customers since 1 May 2026; US$15 per user per month, or included in Microsoft 365 E7). |
MCP | Model Context Protocol: an open standard plug that lets any agent use a tool. Microsoft products now use and offer MCP almost everywhere. |
A2A | Agent-to-agent protocol: an open standard for one agent to hand a task to another. |
Two things every option leans on
Identity decides what an agent can see. An agent acting on behalf of a user should inherit that user’s access. This saves you from rebuilding permissions, but it also exposes existing mistakes: loose SharePoint permissions remain loose when an agent searches the files. In a 2024 Gartner survey of 132 IT leaders, 40% had delayed a Copilot rollout by three months or more because of oversharing. Agents running under their own identities need permissions designed for the job.
The shape of your data affects the work involved. SharePoint documents are a natural starting point for Microsoft’s configured agents, and Copilot Studio fits well with Dataverse records. Numbers in Fabric need a semantic model: agreed definitions of measures such as revenue or overdue jobs. When data spans several systems or arrives in inconsistent formats, you may need a search index you control, such as Azure AI Search, or custom code.
Part 2: The five places an agent can live
Think of the five options as a ladder of responsibility for the harness. On the lower rungs, Microsoft supplies most of the runtime and you configure its behaviour. Higher up, your team takes more responsibility and gains more control. Rungs 4 and 5 overlap because Foundry can host your code; the question is how much of the surrounding infrastructure you want it to manage.
Five options, from a personal Copilot prompt to an application you own. Choose by the requirements of the job.
Before climbing that ladder, consider two alternatives.
Before you build: don't, or buy
- Don't use an agent if the steps are fixed and follow strict rules. Microsoft's own guidance says to use "regular code or nongenerative AI" there, because it's "faster, cheaper, and more reliable". The same guidance says a plain FAQ over a fixed set of documents doesn't need an agent either; a simpler retrieval set-up will do.
- Buy one if it already exists. Once an agent is justified, the next question in Microsoft's own decision tree is whether a ready-made agent meets your requirements. Researcher and Analyst (part of Microsoft 365 Copilot), Fabric data agents, the agents inside Dynamics 365, GitHub Copilot and the Employee Self-Service agent all count. Check what your licences already include before you build.
Rung 1: Copilot Chat, with good prompts
What it looks like: Copilot in Teams, Outlook or the browser. People type; it answers. Notebooks let someone gather files and standing instructions in one place.
What it can see depends on the licence. Copilot Chat comes with eligible Microsoft 365 business and enterprise plans (E3 and E5 included). On its own it works from the web, the instructions and what the user gives it. With pay-as-you-go billing switched on by an admin (it's off by default), agents in Copilot Chat can also read SharePoint, Copilot connectors and Dataverse, metered per use. Only the full Microsoft 365 Copilot licence (being renamed Microsoft Copilot since August 2026; price lists still use the old name), US$30 per user per month on an annual commitment (US$21 for the Business edition, for organisations of up to 300 users, with a first-year promotion to US$18 until 31 December 2026), grounds answers in the user's own mail, chats and meetings, and puts Copilot inside Word, Excel and PowerPoint.
Good for: personal work such as drafting, summarising and finding information. Start with a good prompt before creating a dedicated agent.
What it can't do: share a configured behaviour reliably across a team, act in your systems, or run without someone asking.
Pro tips
- Point at the sources. Type
/in the prompt box and pick the exact files (and, with the full licence, people, meetings or emails) Copilot should use, rather than hoping it finds them. - A shared Notebook may be enough. Put the team's standing instructions in a Notebook, pin only the files it should answer from, and share it. New files can take a few minutes to become available.
- Schedule the weekly prompt (the Monday briefing, the project summary) instead of building an agent for it. It needs the full Copilot licence, and it quietly creates a Power Platform environment, so tell your MSP.
Rung 2: Agent Builder (a shared brief)
What it looks like: inside Copilot, someone creates an agent with a name, instructions, starter prompts and knowledge: up to 100 SharePoint files, 50 OneDrive files, 20 uploads, four websites and Copilot connectors. It can also use code interpreter, image generation and, since October 2026, skills. Microsoft calls these declarative agents: you declare the brief, Copilot supplies the brain and the harness.
Good for: an HR policy helper, a bid-writing assistant or an agent that explains how your team works. The business can maintain its instructions and knowledge within the controls Microsoft provides.
What it can't do: Agent Builder "doesn't support authoring actions that integrate external services", so no tools that change other systems, no workflows, no website front door, and it can't be used in Teams group or one-to-one chats. It can't stop the model using its general knowledge. Files uploaded straight into the agent are visible to anyone who can use it, whatever the file's original permissions.
That restriction applies to Agent Builder’s authoring experience. Developers can use the Microsoft 365 Agents Toolkit in Visual Studio Code to build declarative agents that call APIs or MCP servers while retaining Copilot’s model and runtime. You can also copy an Agent Builder agent into Copilot Studio when it needs more capability, although the copy has its own settings and maintenance needs.
Cost: for licensed Copilot users, nothing extra. For unlicensed users, agents grounded only in instructions or public websites are free; agents that read tenant data are billed in Copilot Credits.
Who can create and share agents: administrators set these permissions in the Microsoft 365 and Power Platform admin centres. Agree them before rolling agents out.
Pro tips
- Write instructions like a short spec, with headings, bullets for things in any order and numbered steps only for real sequences. Microsoft calls structure "one of the strongest signals" the model uses. Then test the agent against plain Copilot: if the answers are no better, the agent isn't earning its place.
- Keep the instructions in the agent. Don't get round the 8,000-character limit by moving them into a SharePoint file: Microsoft treats knowledge as untrusted, so its injection filters can strip instructions, and anyone who can edit the file can change the agent.
- "Only use specified sources" prioritises; it doesn't block. If the agent must never answer from general knowledge, that's a Copilot Studio job. And a SharePoint site doesn't include its lists: add each list's own address.
Rung 3: Copilot Studio (low code, real tools)
What it looks like: a web designer for agents. You add knowledge (SharePoint, Dataverse, Azure AI Search, websites), connected agents (including Fabric data agents, in preview), tools (Power Platform connectors, your own APIs, MCP servers), agent flows (fixed sequences of steps) or workflows (automations whose steps can include AI, on the Microsoft Copilot harness), and triggers that start an agent when something happens, with no person asking. It publishes to Teams and Copilot, a website or a contact centre.
Microsoft now uses the word harness for the runtime options inside Copilot Studio, as of November 2026:
- the standard harness (generally available), where you define topics (scripted conversations) and paths, predictable and on a fixed rate card;
- the Microsoft Copilot harness (generally available; called the GitHub Copilot harness until 28 October 2026, and still under that name on many Microsoft pages), which plans its own steps across tools, creates and edits Office files, and bills by usage from the moment you start building;
- the Customer Conversation harness (public preview since 21 October 2026), for customer-facing chat and voice with handover to people;
- and, in Microsoft's licensing and admin pages, a Copilot Chat harness for Copilot Chat agents.
Good for: staff-facing agents that do things (IT helpdesk triage that opens a ticket, a sales-prep agent that reads the CRM), customer chat on a website with handover to a person, and autonomous agents on simple triggers ("a new order arrived"). Its strengths are speed, the connector library, ownership by the people who know the process, and governance a large organisation already understands: environments, data-loss policies, Purview and Agent 365.
Copilot Studio also supports structured testing and releases. Agent Evaluation has been generally available since March 2026, with APIs since April. Teams can package agents as solutions and move them between development, test and production through Power Platform Pipelines, Azure DevOps or GitHub Actions, with native Git integration.
Where it strains: complex business logic, many interacting rules and high usage. A single hard rule can sit in a deterministic flow step; a larger rulebook often belongs in code. Some settings, including channels, web-chat security, sharing and Application Insights, still need manual steps after deployment. Evaluation runs on the Microsoft Copilot harness also consume credits. Teams should test retrieval quality, latency and behaviour in each intended channel. Microsoft’s documentation notes that an agent can withhold a correct answer when a citation is missing. In Microsoft’s Dunaway case study, the team improved retrieval by replacing Dataverse knowledge with an Azure AI Search index called from Copilot Studio. They changed the part causing the problem while retaining the platform.
Cost: Copilot Credits: US$0.01 each pay-as-you-go, or US$200 a month for 25,000 (unused credits don't roll over). A scripted answer is 1 credit, a generative answer 2, and grounding it in tenant data adds 10. Licensed Copilot users using an employee-facing agent as themselves aren't charged on the standard harness, within fair use; autonomous runs and computer use are billed regardless, and the Microsoft Copilot harness bills by usage. Two traps:
- Reasoning models (models that think in steps before answering, using many more tokens) bill by tokens. In Microsoft's own illustrative example, a public website agent on Claude Opus 4.7 spends 141 credits on one follow-up question and 461 if the question starts a new conversation: about US$1.41–4.61, before feature charges.
- The cap: at 125% of prepaid capacity, agents stop responding, mid-conversation, unless pay-as-you-go is linked.
Pro tips
- Descriptions do the routing now. With generative orchestration, each topic's, tool's and knowledge source's description is "the most important factor" in what gets used. Give each a distinct one- or two-sentence description, including what it doesn't do; two similar descriptions make the agent's choice unpredictable.
- Know what "Allow ungrounded responses: off" costs. It also blocks sensible follow-ups answered from the previous turn and the agent's own clarifying questions, and withholds correct answers that lack a citation. If you switch it off, tell the agent to cite every statement and retest your follow-up questions.
- Pick a reasoning model only where it's needed, and keep its instructions and knowledge tight. Every turn bills its tokens, which is why Microsoft's example costs more than three times as much at the start of a conversation.
Rung 4: Microsoft Foundry (Azure's agent platform)
What it looks like: Foundry holds Azure's model catalogue and its Agent Service. You can define a prompt agent in the portal with no code (instructions, model, tools), or deploy a hosted agent: your own code, in a container, running in Foundry's managed runtime with its own Entra identity, scaling, tracing and evaluations (generally available since mid-2026). Foundry agents can be published into Teams and Copilot. Hosted agents can run Anthropic's Claude Agent SDK as well as OpenAI's Agents SDK, LangGraph and Microsoft's Agent Framework. Changes go live like software: agents are versioned and immutable, deployed from a pipeline, and a bad version can be rolled back.
Good for: technical teams that want managed agent hosting, model choice and Azure’s identity, billing and monitoring. Foundry supports versioned agents and evaluations that can gate releases in a continuous integration pipeline, alongside automated security testing. Hosted agents can run familiar frameworks, which helps keep orchestration code portable. Check the networking support for each feature before committing to an isolated deployment.
Where it strains: churn and unfinished parts. The first Agent Service generation is now "classic" and retires on 31 March 2027; Foundry Workflows retire on 1 December 2026, with Microsoft pointing people to its Agent Framework instead. Microsoft's own status page still lists monitoring, memory, agent guardrails and the AI gateway as preview, and some features (traces among them) don't yet fully support network isolation. Tool support varies by model and region. The portal needs no code, but it's built for technical teams, not business users.
Cost: pay per token, plus compute for hosted-agent sessions. OpenAI's current family on Azure is GPT-6: for example GPT-6.1 sol at US$2 per million input tokens and US$10 per million output tokens, GPT-6.1 terra at US$1 and US$5, the top model GPT-6 astra at US$10 and US$50, and the smallest, GPT-6 luna, at US$0.10 and US$0.50 (Global Standard, short context). Claude Opus 5.5 is US$4 and US$20 (list prices, November 2026). Repeated input that's cached costs a tenth to a twentieth of the normal price for GPT models (a tenth for most Claude models, a twentieth for Claude Opus and Sonnet 5.5); writing to the cache costs a little more than normal input (1.25 times for Claude and for GPT-5.6 onwards, including the GPT-6 family). Flex processing, for work that isn't urgent, costs half on the GPT-6 family. Steady workloads can reserve capacity (provisioned throughput, from US$260 a month per Global unit on a monthly reservation, with a minimum number of units per model). Keeping processing inside a data zone (a group of regions, such as the EU) adds 10%.
Pro tips
- Start on Global Standard (new models first, the most quota, the lowest price) and move to a data zone or regional deployment for a named reason. When residency matters, use Azure Policy to block the deployment types you don't allow. A UK organisation wanting European processing needs an EU data zone in an EU region.
- Give the model router a short approved list, never the open pool. Its context window is the smallest of its models, and its list doubles as the failover set.
- Size hosted agents for one session. Each session gets its own sandbox and you pay for all active sessions, so oversizing multiplies cost by concurrency. Grant permissions to the agent's own identity, not the project's.
Models and terms: the small print, by surface
Check which models each product supports, who processes the data and which contract applies. A familiar model name does not settle those questions.
OpenAI's GPT models are the default almost everywhere. In Foundry they're sold by Microsoft under Microsoft's terms and can run in a US or EU data zone, or in a single chosen region (pay-per-token or reserved, depending on the model), so a UK or EU organisation can keep GPT processing in Europe; UK-only processing depends on which models the UK regions offer. New OpenAI models and API features often reach OpenAI's own API before Azure. In Copilot Studio, the default is a floating "GPT Chat Latest" that updates within a version silently and gives 30 days' notice of a move to a new major version (in the UK it's processed in-region); models you pin can retire quickly (three GPT models retired in October 2026 and five more retire on 12 November).
Anthropic's Claude models are available on both surfaces, under different terms:
Comparison | Copilot, Copilot Studio | Microsoft Foundry |
|---|---|---|
Whose contract | Anthropic is a Microsoft subprocessor: Microsoft's product terms and data protection addendum apply | Anthropic is the data processor, under Anthropic's terms and SLA, even when the model is hosted on Azure |
Where data is processed | Outside the EU Data Boundary (Microsoft's commitment to keep EU customers' data in the EU); marked "cross-geo" outside the US | Hosted-on-Azure version keeps prompts and outputs in Azure, except usage metadata and content Anthropic's safety systems flag; the Anthropic-hosted version may process data outside Azure. The only data-zone option is the US, so UK and EU customers get Global deployment |
Default | Off by default in the UK, EU and EFTA; an admin switches it on in the Microsoft 365 admin centre, and for Copilot Studio also per environment | Deployed through an Azure Marketplace subscription and billed in Claude Consumption Units, on your Azure invoice |
Models (Nov 2026) | Older generation: Sonnet 4.6, Opus 4.6–4.8 | Current generation: Opus and Sonnet 5.5, Haiku 5.5 and others |
Agents | Selectable as the agent's model | Not in Agent Service's model tables for portal-built prompt agents (6 November 2026), though the model router page says it can route prompt-agent calls to Claude: test before relying on it. Documented routes: code, or a hosted agent (including the Claude Agent SDK) |
Catches | Some newer "Anthropic models with Data Retention" revert to Anthropic's own terms, with data kept up to 30 days, and need a separate opt-in | Not available on CSP subscriptions; small default quotas on pay-as-you-go subscriptions (40 requests a minute for Opus 5.5); no batch processing or reserved capacity; file handling, code execution and Agent Skills need the Anthropic-hosted version; Foundry applies no content filter of its own (Anthropic's safety systems still apply) |
Approval to use Claude in Copilot Studio does not automatically cover Claude in Foundry. If your managed service provider (MSP) supplies Azure through a Cloud Solution Provider subscription, check the restriction on Claude in Foundry before designing around it.
Calling a provider directly. Code can also call OpenAI's or Anthropic's own API. That usually gets new models and features first (Claude's batch discount, for example) but moves the data processing onto the provider's terms and a separate bill, outside what Defender for AI and Purview's Foundry integration see. It's a legitimate choice, made deliberately, with its own sign-off. To bring it back under governance, route the calls through API Management (which can apply token limits and logging to Anthropic's and OpenAI's APIs) and register the agent in Agent 365 like any other.
Rung 5: Your own application on Azure
What it looks like: your developers write the agent in Python or TypeScript and host it on Azure Container Apps, App Service or Functions, behind your own React front end or inside Teams. The pieces they'll name:
- The agent's logic: a framework such as the OpenAI Agents SDK, Anthropic's Claude Agent SDK, LangGraph or Microsoft's Agent Framework (the successor to Semantic Kernel and AutoGen, generally available since April 2026, and model-neutral).
- The models: usually called through Foundry, so they sit on your Azure bill under your Entra identities, with no keys in the code.
- The front door: your own web app, or the Microsoft 365 Agents SDK, which is how code shows up in Teams and Copilot.
Good for:
- Hard rules. "Never offer more than 10% off" is a line of code that runs every time, not an instruction the model usually follows.
- Approvals, retries and preventing duplicate actions, built as ordinary software.
- High volume, once it's high enough to repay the build (see question 4).
- Product-grade experiences for customers, with your design and your behaviour.
- Software discipline as the default: pull requests, evaluation gates in CI, pinned model versions, controlled releases.
- Model freedom: route each step to the best or cheapest model, and change provider by swapping an adapter rather than the agent, provided the framework supports both and your tests prove the switch.
What you take on: security, hosting, monitoring, upgrades and operational support, alongside the agent itself. Your team needs the skills to maintain these, and the first release usually takes longer. You also need controls equivalent to the Power Platform governance your IT team already knows. Microsoft lists container packaging, web-server setup, security, memory persistence, scaling, instrumentation and version rollbacks among the responsibilities open-source frameworks leave to you. A Foundry hosted agent manages some of this infrastructure.
What you rebuild. On the lower rungs, Microsoft supplies sign-in, permission trimming, data-loss policies, audit logs and an agent register. In code you wire those up yourself: Entra sign-in and on-behalf-of for every data call, your own audit log and monitoring, content safety checks, and registration in Agent 365.
Cost: model tokens, hosting and engineering. A low token bill can still sit inside an expensive service, so include maintenance and support in the comparison.
Pro tips (for developers)
- Use managed identities where supported. Point the standard OpenAI client at Azure's v1 endpoint with an Entra token (Anthropic's Foundry client takes an Entra token the same way), and in production use the managed identity directly rather than the default credential chain, which is slow to fail and can silently pick up a different identity.
- Design every prompt for the cache. Stable content first (tools, instructions, reference text), changing content last, no timestamps in the prefix. Cache writes cost 1.25 times normal input on Claude and on GPT-5.6 onwards (including the GPT-6 family), so a prefix that changes on every request costs about a quarter more, and saves nothing.
- Strict outputs aren't rules. Azure's structured outputs can't enforce lengths, patterns or ranges, so "never more than 10% off" still needs a check in code.
More developer tips (reasoning effort, tracing, durable approvals) are in the appendix.
Part 3: Six questions that decide where an agent goes
Answer these questions about one agent doing one job. A platform that suits your helpdesk may be the wrong choice for a finance process.
Check users, rules, data, usage cost, model terms and ownership before choosing the platform.
1. Who meets it, and where?
- Your staff, inside Microsoft 365: start at rungs 1–3. They're signed in, permissions come free, and the front door exists.
- Customers or partners, on your website or app: Agent Builder can't do this. Copilot Studio can publish to a website, and its Customer Conversation harness (preview) is Microsoft's managed answer for customer service. A product-grade experience, with your own design and behaviour, usually means code.
- Nobody: it runs in the background: a Copilot Studio trigger and workflow for simple cases; a Foundry hosted agent or code when it's business-critical.
2. What must never go wrong?
Use the model for judgement and a deterministic check for rules that must hold. If an action changes a record, spends money or reaches a customer, validate it before it runs. A workflow step may be enough for a simple rule; complex or high-stakes rules usually justify code. Microsoft makes a similar distinction between declarative agents and custom engine agents, where developers control orchestration and model choice, using a loan-approval agent with specific business rules as an example.
3. Where does the data live, and what shape is it?
- Documents in SharePoint: rungs 1–3 handle these natively, with permissions intact.
- Records in Dataverse or Dynamics: Copilot Studio is at home here; Dataverse is also an MCP server any agent can use.
- Numbers in Fabric: build the semantic model first, then a Fabric data agent, which you can surface in Copilot, in Copilot Studio (preview), or in Foundry through the new Fabric IQ tool (preview; the old data-agent tool was deprecated on 6 November 2026). Without agreed definitions, no agent gives reliable figures.
- Spread across systems, or messy: an index you control (Azure AI Search) or code.
Seats pay for people, credits for agent usage and tokens for model work. Compare the total cost, including engineering and support.
4. How much will it run, and who pays?
The billing units describe different things, so compare them against the same workload:
- Seats pay for people using Copilot throughout their working day.
- Credits meter agent usage. Consumption depends on the features, model and work performed, rather than a single flat price per conversation.
- Tokens meter model input and output. The surrounding application still needs hosting, testing, engineering and support.
The following examples use the article’s dated US-dollar pricing assumptions. The everyday-model calculation uses Azure’s GPT-6.1 terra at US$1 per million input tokens and US$5 per million output tokens, without caching. The frontier-model calculation uses GPT-6 astra at US$10 and US$50 respectively, with three-quarters of each prompt cached. These assumptions matter: changing the model, prompt length or cache hit rate changes the result.
An HR policy agent for 1,000 staff, answering four questions each per month. Buying US$30 Copilot licences for everyone would cost US$30,000 a month, so that decision needs to account for their wider use of Copilot. If they already hold eligible licences, this agent may add no usage charge. Without them, the SharePoint-grounded agent in this example uses about 48,000 credits, or US$480 a month. The equivalent model calls cost about US$34 in everyday-model tokens, assuming 6,000 input and 500 output tokens per answer. That token figure excludes search, hosting and engineering. For a straightforward policy helper, configuring the agent is likely to be the more economical starting point.
A public support agent. Microsoft’s example assumes 900 conversations a day, or about 27,000 a month, each with four scripted and two generative answers. For the token comparison, we assume two to six model calls per conversation, each using about 4,000 input and 400 output tokens.
Comparison | Copilot Studio (credits) | Foundry prompt agent | Code on Azure |
|---|---|---|---|
Build | days of a maker's time | a few weeks: set-up plus a website chat front end (~US$10,000–20,000) | several weeks of engineering (~US$30,000–60,000) |
Running costs a month, before model use | included in the credits (admin time aside) | search index and monitoring, plus about a day's upkeep (~US$1,000–1,500) | hosting, index and monitoring (~US$500–1,000), plus 2–4 developer days' upkeep (~US$1,500–3,000) |
Model use, 27,000 conversations | US$1,800–2,160 (model included) | everyday model US$320–970; frontier US$1,800–5,300 | same as Foundry |
Model use, 200,000 conversations | US$12,800–16,000 | everyday model US$2,400–7,200; frontier US$13,200–39,600 | same as Foundry |
Change a wording | the business, same day | a tested release | a tested release |
Governance | inside Power Platform and Purview | Foundry's identity, tracing and evaluations | your own logging and monitoring, or a support contract |

The article’s illustrative monthly usage ranges, in US dollars before VAT. Both token routes use the same model assumptions. The two panels use different axis scales; build, hosting, search, upkeep and Agent 365 are excluded.
Build, running and upkeep figures are Scorchsoft's estimates, not Microsoft's; yours will differ. Microsoft's example assumes mostly scripted answers; an agent giving only generative answers would use half as many credits again. Agent 365, if you use it, costs the same whichever column you choose (US$15 per user per month for the people who manage, sponsor or use agents, which for 1,500 users would be up to US$22,500 a month; or included in Microsoft 365 E7, Microsoft's top bundle of E5, Copilot and Agent 365, at US$99 per user per month).
Read the usage figures alongside the build and maintenance estimates:
- At 27,000 conversations a month, the example puts Copilot Studio and a Foundry prompt agent in a similar running-cost range once upkeep is included. Custom code costs more. A configured agent is a sensible starting point unless another requirement justifies the engineering.
- At 200,000 conversations a month using an everyday model, token-based routes can offer substantial savings. Under these assumptions, custom code saves roughly US$2,000–12,000 a month, or about US$6,500 at the middle estimates. Its build could repay itself in roughly five to nine months at that midpoint, with a longer payback at higher build costs or lower savings. A Foundry prompt agent may achieve similar usage savings with a smaller build.
- With a frontier model, the token bill alone can equal or exceed the credit bill. Choose custom code for its capabilities and control, rather than assuming it will reduce costs.
Usage volume and model choice can change the economics. Engineering skill alone does not make custom code cheaper.
5. Which model do you need, and on what terms?
If the default model meets your tests, you have more options. If you need a particular model or processing region, check availability, deployment type and contract before choosing the platform. Model lists differ, versions retire, and the terms for the same model can vary between Copilot Studio and Foundry.
6. Who will own it, and how will a change be tested?
- A business team that wants to adjust the wording and knowledge itself: rungs 2–3, inside guardrails IT sets.
- A development team that will test, version and release it: rungs 4–5.
- Your MSP, in many Microsoft estates, which already runs the parts every agent depends on (see Part 5).
Agree how a change reaches production before launch:
- Agent Builder: the owner edits and republishes; there's no test stage, so keep these agents low-stakes.
- Copilot Studio: build in a development environment, test with Agent Evaluation, and move the agent to production as a solution through Power Platform Pipelines (or Azure DevOps or GitHub), with a checklist for the settings solutions don't carry.
- Foundry and code: the agent is defined in the repository, evaluations run in the pipeline, each version is deployed by the pipeline, and a bad version is rolled back.
An agent also needs an accountable owner. Microsoft’s list of Copilot Studio security risks includes agents without valid owners and agents that give every user access through the maker’s credentials.
The rule of thumb
Pick the lowest rung that meets the job on all six questions, and move up only when one of them forces you to. That matches Microsoft's own advice, which recommends a time-boxed bake-off of one to two weeks per option: "If a low-code solution meets functional and security requirements, proceed with that option."
Reasons to consider a different option include hard business rules, an external audience, high usage, a particular model or contract, and stricter release requirements. Each requirement narrows the choices; it does not automatically send you to custom code.
Reason | The lowest rung it needs |
|---|---|
A rule that must always hold | Copilot Studio, with the check as a flow step; code when the rules are complex or the stakes high |
Customers rather than staff | Copilot Studio; code for a product-grade experience |
Volume that makes credits expensive | Foundry, paying per token |
A model or contract you can't get lower down | Foundry |
Testing every change like software | Foundry, as a hosted agent running your own code |
What climbing feels like
These examples show what those limits feel like in practice. Pritchard Group and the people named below are fictional.
Boundary | The frustration | Climb when | Stay if |
|---|---|---|---|
1 → 2 | Shona, a housing supervisor: her twelve officers each keep their own copy of the lone-working prompt, and one copy has lost the line about ringing the duty manager after nine at night. Same question, twelve answers. | A team needs the same instructions and the same files, every time. | It's one person's habit, or a shared prompt or shared Notebook covers it. |
2 → 3 | Gareth, IT helpdesk lead: his Agent Builder agent sorts out "my laptop won't connect", then sends people to the portal to type it all again. Tickets still arrive without the site or asset number. | The agent must do something in another system, ask its questions in a set order, or start without being asked. | Most questions end in an answer, and a link is enough for the rest. |
3 → code | Pauline, finance director: auditors asked why one invoice was approved. The transcript showed what the agent did, but the price tolerance was a sentence in its instructions, so nobody could prove it was applied. At 6,000 invoices a month the credits were hard to forecast. | A rule that must always hold, a record an auditor can follow, and tests on every edge case: code, which Foundry can run as a hosted agent. | Only one step is hard: keep the conversation in Copilot Studio and put that step behind a tool (a hybrid). |
4 → 5 | Imran, digital manager: the tenants' repair booking as a Foundry prompt agent gave fine answers. The hard part was everything else: Pritchard's own pages, live slots from the repairs system, and a booking made exactly once when a tenant taps "confirm" three times. | The agent is one part of a service you build and run. | The agent is most of the job, and a tool your developers write makes the booking. |
5 → 2 (coming down) | Dean, a developer, built the lone-working helper in code because code is what he knows. Six months on it has its own security review, its own hosting bill and someone on call; every policy change waits for him; and staff still ask Copilot first. | The people are staff, the job is answers, and the rules are simple. | Climbing has a cost, so make each step earn it. |
Two other boundaries matter. Between Agent Builder and Copilot Studio, check licensing for staff who do not hold Copilot licences but need access to SharePoint-grounded agents. Between Copilot Studio and Foundry, discuss ownership: a business-built agent may now need IT to manage its environments, policies and support.
Part 4: The hybrids real systems use
An organisation can use several options at once. The useful question is which responsibilities each part of the system should own.
Several agent front doors can call one secured business capability. The service enforces its rules and records each action.
Build the plug once (MCP)
Expose a business capability, such as looking up a job or booking a repair, through a secured Model Context Protocol (MCP) server. On Azure, Entra can authenticate callers and API Management can provide the gateway. Copilot Studio, declarative agents built with the Agents Toolkit, Foundry agents and your own code can then call the same capability, subject to each platform’s support and policies. This gives you a reusable integration if you later change platforms. The code behind it can validate the rules and record the action, whichever agent makes the request.
Treat external tool descriptions and results as untrusted input. Check network access as well as authentication: an external service must be able to reach the endpoint you expose. For example, Claude’s hosted connectors need access from Anthropic’s published IP ranges, so a private service may need an approved gateway. Power Platform data-loss policies can also block a connector in Copilot Studio even when other clients can use it.
Pro tips
- Design tools around tasks, not endpoints:
book_repairandsearch_jobs, not one tool per API call. Return readable names rather than internal IDs, keep results short, and send errors back as messages the model can act on ("the date must be in the future"). - Keep the visible tool list short. OpenAI suggests fewer than 20; Anthropic finds selection degrades past 30 to 50. In Copilot Studio, switch off "Allow all" on an MCP server and enable only the tools you need, so a server update can't quietly widen what the agent can do.
- Make read-only a matter of credentials, not labels. Put write tools behind separate permissions, and show each caller only the tools their token allows. The specification says clients must treat a tool's labels, "read-only" included, as untrusted unless they come from trusted servers.
Microsoft front door, code behind it
Copilot Studio can manage the conversation and channel while an API, MCP tool or connected agent handles specialist work. This lets the business maintain the conversation while engineers maintain the rules. Check what crosses that boundary, including conversation history and credentials. Use authenticated connections, with on-behalf-of access where the operation should use the caller’s permissions. Two orchestrators also mean another place to debug and some extra latency. Direct connections to Foundry agents remain subject to the feature’s current availability.
Foundry for models and identity, code for the work
Your Python agent calls GPT and Claude through Foundry: one Azure bill, Entra sign-in with no keys in code, quotas and tracing. Orchestration stays in your framework, in a container you can move; a Foundry hosted agent formalises this and can bridge the agent into Teams and Copilot. Two details catch teams out: GPT and Claude arrive through different APIs (OpenAI's Responses API and Anthropic's Messages API), so the code needs an adapter for each; and the OpenAI Agents SDK uploads traces to OpenAI whenever an OpenAI API key is present, so replace its exporter with one pointed at Azure's Application Insights.
A code agent that shows up in Teams
Built with the Microsoft 365 Agents SDK, or published from a Foundry hosted agent, your own agent appears in Teams and Copilot like any other, running your logic and your model.
Start low, and usually stay there
For many staff-facing tasks, a Copilot Studio implementation can remain the production solution. When one part outgrows it, consider a hybrid: retain the conversation and channel, then move the demanding work behind an API, MCP server or specialist agent. A full move to code may require rebuilding the conversation, although you can retain your test cases, integrations, data preparation and search index.
Part 5: Who runs what
In many Microsoft organisations, the MSP already manages licences, Power Platform environments, data-loss policies, Purview and Azure billing. The business can own configured agents within those controls. Developers build the integrations and custom applications, then provide a runbook covering monitoring, support, recovery and releases. Agree those responsibilities explicitly; an Azure hosting contract does not necessarily include support for the application running on it.
Business ownership, platform administration and engineering support are separate responsibilities. Agree who is accountable for the whole service.
Questions to settle with your MSP before the first agent:
- Which environments can makers build in, with which connectors?
- Who can share an agent with the whole organisation?
- Which Azure subscription do pay-as-you-go agents bill to, who sees the budget alerts, and is it a CSP subscription (which rules out Claude in Foundry)?
- Who switches on partner models such as Claude, which are off by default in the UK?
- Who reviews the agent register for agents with no owner, and how often?
- Will you support an agent built in code, or only its Azure hosting?
- Who holds the Azure roles on the Foundry project, and who approves a new agent identity or app registration?
- What does our contract cover for agents (support hours, response times, who fixes a broken connector)?
- Are makers kept out of the Default environment (the one every user can build in), with a proper development, test and production set-up instead?
Part 6: One organisation, five agents
Consider Pritchard Group, a fictional company maintaining 40,000 rented homes for housing associations across the north of England. It has 1,200 staff, Microsoft 365 E3 with some Copilot licences, Azure supplied through its MSP, and Fabric for reporting. Hayley, its fictional head of operations, has five agent ideas.
The fictional housing company assigns different jobs to different platforms. Its helpdesk and tenant website can reuse a controlled booking service.
The job | Where it goes | Why | Owner |
|---|---|---|---|
Answer any member of staff's question on the lone-working policy | Agent Builder | Documents in SharePoint, staff inside Microsoft 365, no actions | HR |
IT helpdesk triage that asks the right questions and opens a ticket | Copilot Studio | Staff-facing, needs one tool (the ticket system's connector), modest volume | IT service desk, with the MSP |
"How many repairs are overdue in Leeds this month?" | Fabric data agent, surfaced in Copilot | The numbers live in Fabric; the semantic model defines "overdue" once. Buy before you build | Data team |
Check 6,000 supplier invoices a month against purchase orders, with approval above £5,000 | Code, run as a Foundry hosted agent | Hard rules and approvals in code; Foundry supplies its identity, tracing and evaluations; approvals land in Teams | Finance, with the developers |
Tenants reporting and booking repairs on the website | Code (React and Python) with an MCP server for the booking system | Customer-facing, high volume, must never double-book. The same MCP server lets the helpdesk agent look up a tenant's repair | Digital team, with the developers |
The five jobs use different platforms, with a shared booking capability where it helps. Straightforward internal questions stay close to the tools staff already use; the more demanding rules sit in controlled software.
Part 7: Things to get right wherever the agent lives
Check permissions, behaviour, actions and operations before release, then repeat the relevant checks when the system changes.
- Start with the simplest thing that works. A good prompt, then a single agent with a few tools, then a fixed workflow with one model step. Add more agents only when a measured failure calls for it.
- Use the smallest model that passes your tests, and move up only where the tests show it's needed.
- Design the tools carefully. A few well-named tools with clear descriptions, read-only by default, returning short, structured results.
- Write the test questions first. Collect 30–50 real questions or tasks with agreed answers before you build. Run them on every change of prompt, model or tool, and keep them in a file you own, so they move with the agent between platforms. Copilot Studio and Foundry both run them natively.
- Trace every run, and read real traces regularly. They show what the tests missed.
- Ask a person before anything that can't be undone: payments, record changes, messages to customers.
- Tidy permissions before launch. Agents surface what was always visible. Run Purview's oversharing checks first.
- Treat what agents read as untrusted. In 2025 a flaw called EchoLeak (CVE-2025-32711, fixed by Microsoft) showed that one crafted email could make Microsoft 365 Copilot leak data without anyone clicking anything. An agent that reads outside content, holds private data and can send things out needs all three limited.
- Give every agent an owner, an identity and a place in the register (Entra Agent ID, Agent 365), and decide who may create and share agents.
- Watch the bill. Budgets and alerts on credits and tokens; no reasoning models for simple questions.
- Measure value. Gartner forecasts that over 40% of agentic AI projects will be cancelled by the end of 2027 over cost, unclear value or weak risk controls. It's a forecast, not a measurement, but the remedy is the same: agree what success looks like before you build, and when you'll stop if it hasn't arrived.
Pro tips: governance
- Use Restricted Content Discovery as a stopgap on high-risk sites (finance, HR) while their owners fix permissions. It hides a site from Copilot without changing who can open it. Start with the biggest sites: on sites with more than 500,000 items a change can take more than a week to apply.
- Require sign-in, or sharing limits don't apply. Copilot Studio's sharing limits "only apply to agents that require authentication". Then run Microsoft Defender's ready-made hunting queries for risky agents each month.
- Budgets alert; limits stop. A Microsoft 365 pay-as-you-go budget only sends notifications; spending carries on. Set per-agent limits in the Power Platform admin centre as well.
Where code earns its place
Scorchsoft’s AI agent development and agent harness development work sits in this part of the decision.
Custom code earns its cost when you need direct control over the experience, rules, data or release process. These are the practical differences to look for:
A model can propose an action while the service checks permission, availability, approval and duplicate requests before it commits the change.
The pain | In code |
|---|---|
Hoping a rule ran | Proof it ran, every time: the rule is code that runs on every request, with a test for every edge case |
A chat window someone else designed | An experience that's yours: your pages, your journeys, your accessibility choices |
Logs and retention set by the platform | Your own environment: your logs, your retention, and permissions down to a single field |
One model, and a cost you can't see per conversation | Choose your model, swap it when a better one arrives, and see what each conversation costs |
Changes that go straight to live | Every change tested in a pipeline before anyone sees it |
Those benefits come with engineering and support costs. If your agent does not need them, a configured option may serve you better.
Part code: one business area behind one plug
You can put one business capability in code while keeping the agents in Microsoft’s tools. Take Pritchard’s repair scheduling: the service holds the jobs, validates trade and slot availability, prevents duplicate bookings and records the result. Expose it through an MCP server, and both the staff-facing agent and the tenants’ website can use it.
That service becomes the control point for the booking capability. Each request passes through the same permission checks, business rules and audit logging. You can change the agent’s conversation or platform without moving those rules into its prompt.
The answer
Put the agent where its users can reach it, enforce business rules at the point of action, and reuse the capabilities that several agents need.
- Configure where you can. For internal questions and straightforward actions, start with Microsoft’s existing tools and test them against the job.
- Code where the requirements justify it. Complex rules, a custom experience, model requirements or measured cost savings may warrant the additional engineering.
- Build shared capabilities once. Secured MCP tools or APIs can let several agents use the same controlled business service.
A practical next step: review SharePoint permissions, agree who may build and share agents, then choose two straightforward configured use cases and one candidate for custom code. Give the code candidate a one-to-two-week comparison against the simplest viable alternative. Microsoft Ignite runs from 17–20 November 2026, so recheck product announcements and pricing before committing to a design.
Want a hand? If you're working on the upper rungs (Foundry, your own code, or the MCP servers that join them), book a consultation call with Scorchsoft. If your team is finding its feet on the bottom rungs, much of the work is in the habits underneath, and that's what The AI Stairway™ teaches: turning good chats into shared skills, agreeing team rules, connecting AI to your files with controls you choose, and deciding which rules need code. It's tool-neutral, so it applies to Copilot and beyond, and the first module is free at aistairway.scorchsoft.com.
Appendix: more pro tips
Product details in these tips reflect the guide’s research dated 8 November 2026. Check the linked product documentation before implementation.
For makers, admins and architects
- Copying to Copilot Studio is a fork. Copilot connectors, uploaded files, and Teams and email knowledge don't carry over, and later edits to the original don't reach the copy.
- Build in a solution from day one, in a development environment, with environment variables for anything that differs between environments, and keep a written checklist of the settings solutions don't carry.
- Cap spend per agent. Set a monthly limit on each agent in the Power Platform admin centre, including in development environments, because the Microsoft Copilot harness bills while makers are still building. Limits aren't instant, so leave headroom.
- Ask for Claude quota at the start of a project if you're on a pay-as-you-go subscription. Increases are "evaluated individually and aren't guaranteed".
- Behind API Management, don't break streaming: if diagnostic logging is on for all APIs, set the logged response payload to zero bytes, or MCP responses fail.
For governance
- Know the edges of data-loss rules for Copilot. Labelled files can still appear in citations, though Copilot doesn't use their content; files a user uploads into a prompt aren't scanned; and changes take up to four hours. A new rule (preview) keeps external email out of what Copilot draws on, a cheap defence against EchoLeak-style attacks.
- Switch on document-attack detection in Foundry. The shield against instructions hidden in documents and emails is off by default; the one for direct user attacks is on.
For developers
- Set reasoning effort yourself. Low for classifying, routing and routine tool calls; higher only where your tests show a gain. Reasoning tokens bill as output, and on GPT-5.6 onwards (including the GPT-6 family) reasoning from earlier turns is carried forward by default, which raises token use on long conversations with no code change; set it to the current turn unless you've measured a benefit. Claude's equivalent control is the thinking budget.
- Keep traces in your tenant. When an OpenAI API key is present, the OpenAI Agents SDK sends traces, including prompts and tool inputs, to OpenAI. Replace its exporter using
set_trace_processors()with one pointed at Application Insights, and redact before sending. - Build approvals as a wait with a deadline: the workflow waits for a person's decision or a timer, whichever comes first, and uses no compute while it waits. Put side effects (payments, emails, the model call) in steps that run once and record their result.
Sources and product documentation
This guide accompanies the 29-minute Scorchsoft film. The examples at Pritchard Group and its named staff are invented to explain the decisions. Build and upkeep costs are Scorchsoft estimates, rather than vendor quotes.
The article’s detailed figures reflect research dated 8 November 2026. Confirm current pricing, regional availability and contractual terms for your tenant before purchasing or implementing.
- Microsoft: Agent Builder and Copilot Studio comparison
- Microsoft: Foundry Agent Service overview
- Microsoft: Copilot Studio plans and UK pricing
- Microsoft: Copilot Studio billing rates and management
- Microsoft: Claude hosting options and subscription requirements
- Anthropic: Claude in Microsoft Foundry
- Microsoft: technology planning for AI agents
Decide where your AI agent belongs
Talk through your use case, integration needs and business rules with Scorchsoft.
Want to talk about your project?
Tell us what you’re trying to achieve and we’ll map the fastest credible path.
