A technician reviews an AI-powered security dashboard routing protected data between servers.
Every IT team running AI agents in production eventually hits the same wall: the dashboard is green, the API calls are returning HTTP 200, latency looks respectable, and yet the agent is quietly doing something maddening on every tenth customer interaction. Maybe it skips an eligibility check before promising an order modification, or it misinterprets a borderline request without throwing a single infrastructure exception. Spotting one bad conversation in a sea of logs is tedious enough; turning that recurring headache into a tested, non-regressive fix without breaking five other workflows is where most agent deployments stall.

Microsoft is taking direct aim at that "observability-to-action" gap with the Public Preview of Insights Optimization—officially documented as fixing insights with Agent Optimizer—inside Microsoft Foundry Agent Service. Rather than forcing developers and enterprise AI administrators to manually comb through telemetry, handcraft replay datasets, and play prompt-engineering roulette, the new workflow wires production trace insights straight into Foundry's automated Agent Optimizer. Think of it as moving from a smoke detector that merely shrieks when dinner burns to a system that points at the faulty burner, proposes a recipe adjustment, tests it in a separate pan, and asks you to taste-test before serving.

A technician reviews an AI-powered security dashboard routing protected data between servers. Closing the loop between trace insights and agent tuning​

At its core, Microsoft Foundry's Insights capability scans recorded production traces to surface recurring behavioral patterns—things like repeated task failures, hallucinations, and unexpected token spikes—while attaching representative conversations, affected agent versions, likely causes, and suggested next steps. Until now, those insights were essentially diagnostic reports: useful for pointing out where an agent stumbled, but still leaving engineers to assemble reproduction scenarios and iterate on prompts by hand.

Insights Optimization bridges those two worlds directly inside the Foundry portal. According to Microsoft's Foundry engineering team in a November 2026 technical walkthrough, the feature takes one or more confirmed issues from the Insights tab and launches a bounded optimization search against a pinned baseline version of the agent. Pinning the baseline version matters: it ensures the experiment measures candidate improvements against a static configuration rather than a moving target.

Behind the scenes, Foundry gathers the trace evidence tied to the selected insights, deduplicates conversations, samples within capacity limits, and converts those real-world interactions into replay scenarios driven by a simulated user. From there, an optimization model proposes candidate revisions, and an evaluation model scores both the baseline and the candidates around two competing questions:

  • Did the candidate resolve the targeted failure patterns?
  • Did its overall behavior stay within an acceptable quality tolerance?

The catch: what it changes—and what it refuses to touch​

Before anyone imagines an autonomous AI quietly rewriting entire enterprise backends overnight, Microsoft has placed tight guardrails around this Public Preview:

  • Supported agent types: The portal-based Insights Optimization flow currently supports prompt agents that do not use the Microsoft Copilot harness. Teams running hosted agents have to rely on separate Foundry Toolkit or Azure Developer CLI (azd) workflows instead.
  • Editable surfaces: Candidate fixes can modify agent instructions and function-calling tool descriptions. In this preview, Insights Optimization cannot swap out the underlying model or alter agent skills.
  • Human-in-the-loop promotion: Starting an optimization run never modifies the live, active agent. Candidates remain proposals until a human reviews the diffs and explicitly promotes one.
  • Preview status: Like all Azure public previews, the capability ships without a service-level agreement (SLA), carries constrained capabilities, and is not recommended for production workloads.

Section summary: Insights Optimization connects recurring trace anomalies directly to automated prompt and tool-description tuning for non-Copilot-harness prompt agents, using simulated user replays and keeping human approval firmly between candidate generation and production deployment.

How to run Insights Optimization in the Microsoft Foundry portal​

For Windows and cloud engineers already managing Foundry projects, Microsoft Learn outlines a straightforward set of prerequisites before kicking off a run: a Foundry project and eligible prompt agent configured for trace insights, previously generated insights from an insights scan, and both an optimization model and an evaluation model deployed inside the project. (If you haven't run an insights scan yet, you configure a supported Judge model, built-in or custom priority categories, and analysis instructions under Settings > Monitor settings > Insights.)

Once those pieces are in place, the portal workflow follows five steps:

  1. Navigate to your agent: Open your Foundry project, select Build > Agents, and choose the prompt agent you want to tune.
  2. Audit the evidence first: Open the Insights tab and inspect the insight descriptions, linked conversation traces, and suggested fixes before selecting anything.
  3. Queue the issues: Click Select insights, check the boxes next to the confirmed issues you want addressed, and select Fix insights.
  4. Configure the run: In the Create optimization run pane, verify the Agent and pinned baseline Version, pick your Optimization model (which drafts candidate edits), set Max candidates (the ceiling on how many variants get built and tested), and assign the Evaluation model (which grades baseline versus candidates).
  5. Launch and wait for results: Click Create to start the asynchronous run.

Reading the scorecard without getting fooled by averages​

Here is where seasoned IT skepticism pays dividends. Microsoft Learn notes a subtle detail about how Insights Optimization grades broader quality: the general evaluation acts as a regression check rather than a scoreboard of how many insights improved, and a candidate is permitted to pass that general-quality gate with up to a 2% regression if it successfully remedies the targeted issues.

Why does that matter? Because a single aggregate score can easily hide a nasty trade-off—fixing an edge-case refund flow while quietly degrading tone or accuracy elsewhere. Microsoft advises engineers to connect the exact text changes in a candidate's instructions or tool descriptions directly to measured baseline-versus-candidate replays across both the targeted insights and broader quality, latency, and cost metrics. Opening View overall score details exposes candidate performance across every stage of the optimization pipeline, often revealing multiple evaluated variants even when the summary view surfaces only a single top recommendation.

Section summary: Launching a run takes five clicks from the Insights tab, but responsible adoption requires inspecting text diffs, latency, cost, and stage-by-stage regression checks—especially given the preview's 2% general-quality regression allowance.

Critical operational warnings: tool side effects and false diagnoses​

If you take only one operational lesson away from Microsoft's documentation, make it this one: optimization runs execute real tool calls during evaluation.

It is dangerously easy to assume that because a run doesn't promote a candidate to production, nothing in production can be harmed. Microsoft explicitly warns against that assumption. If your prompt agent has access to a tool capable of mutating live systems—say, an order-deletion function wired to a production database—the evaluation harness can invoke that tool while replaying simulated conversations, causing unintended or irreversible damage even if you throw every candidate in the trash.

To keep an optimization experiment from turning into a resume-generating event, enforce these boundaries beforehand:

  • Isolate target resources and credentials: Do not rely solely on sandboxing the agent's compute environment. Restrict the connected tools themselves to read-only permissions or point them at isolated test environments and mock data.
  • Budget for token and API overhead: Because evaluation replays conversations and triggers live tool calls across multiple candidates, expect additional model token consumption, third-party API charges, and potential rate-limiting.
  • Verify the root cause before optimizing: Microsoft stresses that an insight is an AI-generated lead, not courtroom proof. If trace evidence shows a downstream API outage, a misconfigured MCP server, missing SharePoint data, or a Foundry platform fault, tweaking system prompts is like polishing the windshield on a car with no engine. Route infrastructure and dependency bugs to their respective owners instead of running prompt optimization.

Section summary: Because evaluation replays invoke connected tools and an AI-generated insight can misdiagnose an infrastructure fault as a prompt problem, teams must isolate tool permissions to read-only or test resources and verify root causes before tuning.

How Insights Optimization fits alongside Skill Optimization and Agent Optimizer​

If Microsoft Foundry's optimization lineup is starting to sound crowded, you are not imagining things. Alongside the general evaluation-driven Agent Optimizer (which reached general availability in October 2026), Microsoft also rolled out a preview of Skill Optimization from traces in November 2026. Each solves a slightly different operational problem, and knowing which lever to pull saves real engineering time:

CapabilityPrimary Trigger / InputSupported TargetsWhat It ModifiesKey Caveat
Agent Optimizer (GA)Structured evaluation dataset (traces, registered dataset, or JSONL)Prompt agents (without Copilot harness) & hosted agentsInstructions, tool descriptions, model selection, and (hosted) skillsRequires curated validation datasets and evaluators
Insights Optimization (Public Preview)Confirmed recurring issues from the portal Insights tabPrompt agents (without Copilot harness) in portalInstructions and function-calling tool descriptions onlyAllows up to 2% general-quality regression; invokes live tools during replay
Skill Optimization (Preview)Application Insights conversation traces & feedback (Optimize > Learn from past activity or azd CLI)Prompt, managed, hosted, external, or even agentless telemetryReusable Agent Skills (progressive-loading instruction files, versioned explicitly)Trace-derived validation isn't independent held-out evidence; skills aren't auto-attached

Notice the architectural distinction documented on Microsoft Learn between Insights Optimization and Skill Optimization. When an agent's core instructions or tool definitions are ambiguous, Insights Optimization edits those core definitions directly. By contrast, Microsoft Learn's preview guide for Skill Optimization focuses on distilling repeatable lessons from Application Insights traces into modular, versioned Agent Skills—plain instruction files that stay out of the main prompt until a matching task triggers them. Skill Optimization supports both the Foundry portal and an azd ai agent optimize CLI workflow (requiring unquoted integer Unix timestamps in seconds for fixed trace windows and strict project endpoint configuration), and even works in an agentless mode against raw telemetry or for hosted and external agents where full candidate promotion isn't available. Both preview workflows share the same core philosophy: publish explicit artifacts, surface rationale and validation outcomes, and leave final attachment or promotion strictly to the developer.

Section summary: Insights Optimization targets core prompt and tool-description fixes directly from detected trace anomalies, complementing evaluation-driven Agent Optimizer and trace-based Skill Optimization rather than replacing them.

Practical verdict for enterprise AI teams​

Is Insights Optimization ready to replace careful QA and human prompt review? Not even close—nor does Microsoft claim it is. Treating an AI-generated insight as infallible truth or blindly promoting whichever candidate clears a 2% regression threshold is a fast track to subtle production drift.

Where this Public Preview genuinely earns its keep is in cutting out the grunt work between noticing a pattern and testing a remedy. For Windows and Azure administrators supporting internal copilots, customer-service bots, or workflow agents in Microsoft Foundry, wiring production telemetry straight into simulated replay evaluations turns post-incident log triage into a repeatable, auditable engineering loop. Just lock down those tool permissions to a test sandbox before clicking Create—because an automated optimizer testing an order-deletion tool against live data will optimize your weekend right off the calendar.

 

References

  1. (In preview) Public Preview: Optimize agents from insights in Foundry Agent Service Azure Updates 2026-11-24T16:52:07Z
  2. microsoft.com techcommunity.microsoft.com
  3. Optimize skills in Microsoft Foundry (preview) - Microsoft Foundry | Microsoft Learn learn.microsoft.com