0:02If you want to build an agent that you trust to run against your company's data, apps and resources, it increasingly comes down to one thing, the harness. That said, not all harnesses are equal, and today we'll look at how the Microsoft Copilot harness works together with your controls in Microsoft Foundry to provide the right production environment for your agents. We're going to start with a simple, fully managed prompt agent and how you can then move it up to the Microsoft Copilot harness to give it more skills, capabilities, and controls. Then I'll show you how you can also bring your own harness
0:35and run it when you build your own hosted agents in the Microsoft Foundry Agent Service, so they have enterprise controls around them too. And what you can also do in Microsoft Foundry to continuously optimize your agents. And joining me to demonstrate everything is our resident AI lead and long-time developer, Jeff Hollan, who leads the AI Agentic Platform team. Welcome back to the show. - Thanks so much. Great to be here. - So, why don't we start with the basics? So, what is a harness and why do we actually need one? - So, the harness is the environment that wraps your model and your agent.
1:07The idea behind a harness is that you give each agent what it needs to run effectively and with token efficiency, but also with the right level of constraints to make sure it doesn't do things that you don't want it to. These components are all built into the harness so that you don't have to build them yourself. First, there's the agent loop, where the agent reasons over each step, acts, observes the result, and keeps iterating, until it either hits a limit that you've set or it's satisfied with the final result. Then there's context management. This keeps the most relevant information in the model's working context,
1:39compressing information or prioritizing information as that context grows. Skills and tools give the agent instructions for how to approach a task and the ability to actually do things, whether it's reading and writing files, calling tools like MCP servers, running commands or executing code. With sub-agents, a harness can connect or delegate pieces of a larger problem to other agents. This lets it run work in parallel and then eventually bring all those results back together. And with memory, the agent can maintain useful state
2:11across both individual turns or, where appropriate, across sessions. Now, these are components that you'd expect from any harness, but with the Microsoft Copilot harness, this is a model-agnostic harness that's optimized for enterprise task completion. It's actually what we use behind the scenes for Microsoft services, like GitHub and Microsoft 365. And if you use any harness inside of Microsoft Foundry, we'll respect all of your permissions and controls. Microsoft Foundry utilizes our full security stack.
2:41We can help you give each agent its own unique identity so that you can control what information it can access, not having to move that data around or duplicating it, all while respecting your existing data protection controls. And you can determine which actions an agent can take. So, this way agents have enough access and tools to get real work done, but with the right constraints. And in Foundry, we also make sure that each agent has its own sandbox so that different agent instances are fully isolated from each other. A close analogy here to a harness
3:12is a reinforcement learning environment. You're really looking for a balance. You need to give it enough flexibility that the agent isn't useless, but you don't want to give it so much that it's able to do things you never wanted it to. - Right, so it's clear that harnesses do quite a bit of work and there's a lot in there, so can you make it real with an example? - Yeah, let's go ahead and show this in action now. And I'm going to start here by building an agent with no harness at all so you can see where it actually starts to fall down. So, this is an agent that's going to look at our business finances: revenue, spend, and forecast questions that my team is asking constantly.
3:44I built this as a prompt agent on the Foundry Responses API. Now, it's got a model. You can see I've defined instructions, under tools I've configured Fabric IQ to retrieve information from our business analytics platform. What's great is there's no code I've had to deploy and no infrastructure to operate. And I can start with a simple question. Let's see, "Spend by category for September." And it takes a second to respond. You're seeing it's able to look up information. It's even able to do basic calculations. But when I try a more complex question,
4:15in this case, I'm going to ask it to, "Generate a forecast of projected spend over the next quarter, and let's even compare it with previous quarters and prepare an executive PDF report." Now, it takes a little longer to respond than the last time, but it just stops. It's actually suggesting alternative things that it could try. In fact, if I scroll up, you can see it gave up before it even started. It says, "Hey, it can help me structure, but it can't actually generate a forecast." Now, every one of the reasons it falls apart here reflects why you might need a harness.
4:46There's no real agent loop. There's no persistence. It took one pass at a complex problem and stopped instead of working on the problem. It's got no skills or sub-agents to help it out. And there's good news though, right? Prompt agents in Foundry support two loops. This Responses API simple loop that I just used, but now you can bring in the Microsoft Copilot harness. So, in fact, here's the same agent definition. It's got the same managed runtime, but now I'm using the Microsoft Copilot harness. So, I can ask that same question,
5:17"Let's generate that forecast and do that comparison." And this time you'll see it's planning what it needs to do, it's pulling the data that it needs, it's running an analysis and then looping through the skills that it has to fetch more data when it needs, or even bringing in sub-agents. It can even work round issues on the fly that it might hit so that it eventually produces the results that you want. Now, what's important to note is this is all running in a secure sandbox. Now, once this completes, I can already see that this response is way more comprehensive than the last one,
5:47even before I scroll up, I can see some attachments here as artifacts, a PDF file and a separate forecast file. Let's go ahead and open up the PDF report. I can see here's my projected spend. This is what I asked for. I see it year over year. It's even giving details about what's changed. - So, we saw so it's pretty powerful, it's also self-sufficient, and it was even able to find everything it needed and work through any issues that it encountered. - Yeah, this is powerful, but I don't want that power to be unchecked. We want to make sure that we're able to block potentially harmful actions at an infrastructure level
6:19to make sure that agents don't go off the rails. So, here we have guardrails across the harness. This is my agent trace, it shows the different actions that it took. And here you can see at the bottom, it attempted to access an unauthorized web endpoint, but was denied before it ever reached it. Now, often these agents aren't intentionally behaving badly, they're just being resourceful. So, some of these things are expected, but I still need the controls to be able to make sure I can steer it towards the right behavior. - Right, so in your case, you're using traces for your Foundry-developed agent.
6:50And if you wanted to do this more at scale, what you can do there is actually use Agent 365 and in the registry, you're going to see all your agents wherever they've been built. And if you're using the Microsoft Security stack, you can also more easily identify and also respond to security incidents. And the good thing is in the example that you showed is that the agent is still able to do its job within the constraints of the guardrails that you set. - Right, Microsoft Foundry lets you bring those protections to your harness and enable you to preserve those permissions as well.
7:20So, here, capabilities across Microsoft's full security stack provide the guardrails so that your agent is able to run safely across an enterprise. It really comes down to three things: who the agent is, what it can and can't do, and visibility into everything that it does. So, first, "The who" is enforced by Entra Agent ID, where every agent gets its own unique enterprise identity the moment it's deployed. Beyond that, "What it can do" is also explicit. For example, this agent,
7:51I don't want it to call out to the web at all unless it's a path that I've allowed, so I'm able to add that egress rule. Now, as you saw in the trace before, every one of those decisions is logged so that you and your security team can investigate anything that the agent did. - So, the Microsoft Copilot harness covers you when you want the platform to run the loop for you, but what if you want to run your own code? - So, this is a great use for using hosted agents inside of Microsoft Foundry. This actually lets you bring your own harness as well. So, here, I'll actually show the same finance agent,
8:23but you notice here I've actually written this myself against the Claude Agent SDK, so I'm controlling the loop, the tools, and the middleware. In this case, I'm going to use the Visual Studio Code Toolkit for Foundry to deploy and manage this runtime. Even though I'm writing the code, in Foundry every session still gets its own VM isolated sandbox with a persistent file system, fast startup, auto scaling, and zero idle cost when nobody's using it. This SDK now becomes a choice, not a requirement. I'm able to bring my own flavor,
8:53including Claude, Hermes, or OpenClaw, or a completely custom harness. We'll host all of them for you as first-class citizens with the same Entra identity, telemetry, guardrails, and the same scaling behavior. So, there's a set of enterprise governance capabilities that we've also added to hosted agents recently that I want to call out because they're a direct answer to some of the things you saw go wrong a minute ago. So, like I showed before with my agent's egress control, I can bring my own virtual network and allow it no public egress
9:24so that only the agent can reach endpoints that I've approved and set up specific networking routes for. That way, whether your agent is doing something it shouldn't have access to or if it's gotten access to some malicious code or skills, it will never be able to do work outside of what you've allowed. Now, beyond that, when you create your projects, you'll see that we've even expanded hosted agents into more regions, including North Central US, East US, Japan East, Southeast Asia, and Sweden Central. This way you can bring your agents to where the data is. Now, hosted agents can also now run container images
9:56using your own registry, so your approved base images and scanning pipelines are possible, not just the pipeline provided through Microsoft Azure. And a single agent can now serve substantially more sessions in parallel with increased concurrent sessions, so if you need to scale out usage more broadly. - Now, the agent that you showed in both your examples only had a few tools configured, but in real deployment, there might be hundreds and every team wires them up slightly differently, and that can really leave you with multiple versions of the same tool, sometimes with different security models,
10:27and a lot of duplicated integration work. - Yeah, tool sprawl is a real consideration for every enterprise team, and this is exactly what we're trying to help with, with toolbox inside of Microsoft Foundry. So, instead of me having to wire each tool into an agent, you're able to curate the tools once and attach it to a toolbox. So, here you can see a toolbox puts all of my tools behind a single managed, MCP-compatible endpoint that brings centralized authentication, versioning and governance. So, you'll see here for our finance toolbox,
10:58I've been able to attach it to a knowledge source so that the agent can do the integration it needs to across Fabric IQ, reports, web, Work IQ. All of my Microsoft 365 workloads can now all be called through this single endpoint as a toolbox. Now, another obvious worry is context. As I'm adding thousands of tool definitions, I don't want to flood the model every single turn with those descriptions. So, to avoid that, the tool search retrieval only surfaces the tool descriptions based on the task that I actually need.
11:30So, in our recently published ToolRet evaluation, we showed that you were able to reduce token use by more than 60% if you had 50 tools and more than 97% with 1,000 tools versus me having to send the full catalog of tools upfront to the agent. Now, one caveat we're saying out loud, those savings come from tool search, not just simply from bringing in a toolbox. - Okay, so at this point, your agent's built, it's governed, it's in production, but now having done deployment for so many years, I'd say now the work really starts.
12:01- Yeah, you're 100% right. Deployment is just the starting line, it is not the finish line. And this is where I really need to set up a loop after I deploy around continuous improvement. So, I want to show you how that works with our agent. It's going to start with measuring the quality and efficiency of your agent so that you define and test against your own benchmark and not a generic one. So, here I've started by creating my own private benchmark from a dataset of the real tasks that our agent gets asked to do. Now, notice it doesn't leave me staring at a blank page, this is giving me a lot of measurements here about my agent.
12:33We even include built-in evaluators like latency, relevance, intent resolution, or task adherence, but I've also brought in my own sample prompts so I can test and evaluate this agent against my specific use case. Now, every evaluation result links back to the trace that produced it, so a bad score is just one click away from understanding the run that caused it. Now, Agent Optimizer can take all of this evidence and do automatic tuning. Behind the scenes, it generates other candidates with instructions,
13:03skills, maybe improved tool descriptions or a different model selection, and it runs all of those candidates against my private dataset, and then it ranks them. So, you can see here in this example, I've actually been able to move my benchmark up a few points and improve my agent based on the goals that I set for my agent around quality and latency, or even token reduction. And if I click the candidate details, I can see the changes that it proposed. So, instead of me having to hand tune all of these different prompts and knobs, I can simply find
13:33and then deploy the candidate version that scored best. - It's impressive that it was able to take your agent's base configuration, then optimize its instructions and the text around it, in your case to massively improve latency without impacting the quality. Now we've taken that chat agent, we've made it more capable using the harness and more accountable using Foundry controls, so how can everybody who's watching right now learn more? - So, this is the fun part. You can get hands on right now and start building. If you head to Microsoft Foundry at ai.azure.com, you can get started building your first project.
14:06You can try one of those agents using the Microsoft Copilot harness. And be sure to check out github.com/foundry-samples, which have a ton of different templates using various agent SDKs so you can get started coding right away. - Thanks, Jeff, for coming on and showing the full tour of the Foundry Agent Platform. And also thank you for joining us. And as always, keep watching Microsoft Mechanics, and we'll see you again soon.