Microsoft Foundry now tunes your agents' prompts, skills and models from production traces
Microsoft Foundry adds a four-step loop that scores agents, finds recurring failures and tests fixes. Many parts are in preview; your team picks what ships.

TL;DR
- Foundry's agent optimizer generates candidate instructions, skills, tool descriptions and model choices, tests them against your evaluations, and ranks them [1][2].
- Insights, which groups recurring failures, is generally available; trace annotations, golden datasets, skill and cost optimization are in preview [1].
- Suggested changes ship only when your team applies them, but tools called during test runs can still change connected systems [1][2].
Microsoft announced at Ignite that Microsoft Foundry now supports what it calls continuous improvement: agents feed their traces and expert feedback back into the platform, which looks for fixes and tests them before anything ships [1]. Microsoft describes the loop in four steps: establish what good looks like, identify where the agent falls short, optimize, then validate and repeat [1].
Why it matters
Microsoft describes hand-tuning an agent as a slow loop: deploy, test, find weaknesses, revise the prompt and repeat. The agent optimizer automates that cycle by running the agent against a dataset, scoring the answers, generating alternative configurations and ranking them [2]. Microsoft says the system shows how each candidate trades off quality, speed and cost, and your team decides what ships [1].
How the loop works
- Establish: rubric evaluators let you write your own scoring criteria and now also cover safety (preview). Experts can annotate traces (preview), annotated traces become evaluation datasets (preview), and the best test cases can be locked in as a golden dataset (preview) [1].
- Identify: Insights groups recurring problems, shows the evidence and points to a likely cause. It is generally available, as is the same visibility for agents built with LangGraph, LangChain and CrewAI [1].
- Optimize: the optimizer improves instructions, skills and model choice. Sending an insight straight to the optimizer, skill optimization and cost optimization are in preview [1]. Programmed Training (preview) lets engineers write training recipes in Python that Foundry runs on serverless GPUs, and Managed Training is the new name for managed fine-tuning [1].
- Validate: Foundry runs statistical tests when comparing a new agent version with the current one, and teams can add the same check to GitHub Actions or Azure DevOps [1].
Each candidate gets a composite score from 0.0 to 1.0, and the best one is marked [2]. A run uses two models deployed in your Foundry project: one scores responses and one generates the optimizations [2].
Microsoft also says its model router can save up to 65% compared with sending every request to a frontier model, based on its own testing [1]. In a customer example, Alaska Airlines saw MAI-Code-2-Flash score 81.2% on its maintenance-report classification test out of the box and 91.1% after fine-tuning [1].
Limits
Prompt agents can be optimized from the Foundry portal; it improves their instructions, function-calling tool descriptions and model choice, but the portal flow does not yet support agents that use the Microsoft Copilot harness [2]. Hosted agents need the optimization package and a baseline config in code [2]. Microsoft’s hosted-agent quickstart also says your Azure subscription must be on the allow list for the agent optimizer, which you request through your Microsoft representative [3]. Microsoft warns that if an agent’s tools can change production systems, an optimization run can make real and irreversible changes, so tools should use read-only access or isolated test resources [2].
What builders can do now
- Prompt agents: open the agent’s Optimize tab in the Foundry portal, pick a dataset and evaluators, and promote the winning candidate to a new version, with no code changes [2].
- Hosted agents: once your subscription is on the allow list, install azd 1.37.0 or later with
azd ext install microsoft.foundry(forazd ai agent optimize) andazd ext install azure.ai.evaluations(for theazd ai evalcommands that set up the dataset and evaluators) [3]. - Hosted-agent optimization needs the Responses protocol and runs in every region that offers hosted agents except Norway East [2].
Sources
Written and checked by AI from the sources below
- Continuous improvement comes to Microsoft Foundry
- What is the agent optimizer?
- Quickstart: Optimize a hosted agent
Fact-checked by gpt-6.1-sol on · Editorial policy



