Authors: José Santos, Vinutha Karanth, Luffy Chen and Morteza Ziyadi
What insight optimization does
A retail assistant can answer quickly, call its tools successfully, and still skip a step that matters. Perhaps it recommends an order change before checking eligibility. The request returns no infrastructure error, but the conversation does not meet the team's expectations. If that behavior keeps recurring, finding another example is not enough. The team needs a way to turn the pattern into a change it can evaluate.
Insights Optimization is a public preview feature in Microsoft Foundry that connects those two activities. Agent insights identifies recurring behaviors in recorded traces and links findings to supporting evidence. From the Insights tab, developers can select one or more confirmed issues and ask agent optimizer to propose and evaluate candidate changes in a single run. The workflow starts with the evidence behind the issues rather than requiring developers to assemble every replay scenario by hand.
The distinction between finding and fixing is important. An insight is an AI-generated finding to investigate, not proof that its diagnosis is correct. The owner should review the description, affected agent version, and linked conversations before choosing what to optimize. Some findings point to unclear instructions. Others point to an unavailable service, missing data, or a broken tool. Those dependencies need their own fixes; changing an agent's wording cannot repair them.
In the current public preview, optimization for supported prompt agents can propose changes to agent instructions and function-calling tool descriptions. The aim is to improve selected behaviors through changes to the agent's existing instructions and tool descriptions, then provide evidence for deciding whether to adopt a candidate.
The result is a reviewable proposal, not an automatic production deployment. Developers can inspect changes, compare evaluation results, and decide whether to promote a candidate. Keeping the current agent is a valid outcome when the run does not find a qualifying improvement.
There is a separate operational boundary to understand before starting: evaluation executes the agent's tools. A run can modify connected systems even if no candidate is ever promoted. Use read-only access or isolated test resources and permissions; isolating the execution environment alone does not isolate a production database. Evaluation can also incur tool charges and trigger rate limits. Manual promotion controls adoption of a candidate, not the side effects of testing candidates during optimization.
How it works
The insights optimization algorithm turns a selected set of recurring issues into a bounded search over candidate changes. Two questions guide that search: did the candidate address the selected failures, and did its broader behavior remain within the configured quality tolerance?
Figure 1. Evidence, candidate search, and adoption are separate stages. Evaluation calls tools; promotion remains a developer decision.
1. Prepare evidence that can be replayed
Preparation starts with the selected insights, their supporting traces, and a pinned agent version. The system gathers conversation evidence, removes duplicates, and samples within the available capacity. Keeping the agent version fixed makes the comparison meaningful: the baseline is a specific configuration, not an agent changing underneath the experiment.
The recorded conversations are converted into scenarios for a simulated user. A scenario captures what the user was trying to accomplish and the interaction needed to exercise that behavior. The agent then responds again, using its configured tools. This is a new execution grounded in historical evidence, not simply a rescore of the old answer.
Where sufficient evidence is available, failure conversations are separated into training and validation groups without sharing source conversations between them. Training examples provide feedback for proposing changes; validation examples test those changes. Broader conversation evidence supplies an additional quality check, so the search is not judged only on the failures it targets.
Evidence availability matters. If independent validation cohorts are unavailable, the implementation can use a shared failure-replay dataset and reports that limitation. Such a result is useful for inspecting behavior on those scenarios, but it is not evidence that the change generalizes to unseen conversations. Developers should not read “evaluated” as automatically meaning “independently tested.”
2. Establish what the unchanged agent does
Before proposing a fix, the optimizer evaluates the baseline. A historical failure may not reoccur: model outputs vary, tools or data may have changed, or the simulation may not reproduce the circumstances that caused the problem.
The baseline therefore establishes which selected failures are reproducible and scorable in the evaluation. The remediation comparison focuses on qualified failures rather than claiming credit simply because a historical issue disappears during an unchanged-agent replay. If no selected failure reproduces, there is no measured failure signal for this search to improve.
Evaluation uses two complementary signals. A remediation evaluator compares the replayed behavior with the source evidence for the selected insights. A generated quality rubric evaluates broader behavior against the agent's intended operation. The first asks whether the targeted issue was addressed; the second provides a regression check. Neither is automatically a business-outcome measurement or a substitute for an application's trusted task-success checker.
3. Propose a change from observed feedback
The optimizer uses sampled executions and evaluator feedback to propose revised instructions or function-tool descriptions. Rather than asking for a generally “better prompt,” it can work from a specific observed pattern: which step was missed, which action was inappropriate, or which instruction the agent did not apply consistently.
Consider a hypothetical order-change workflow. The agent should check eligibility before changing an order. Evidence shows that it sometimes calls the change tool first. A candidate might make the sequence explicit and clarify the tool description so that eligibility is a prerequisite. The proposed change is a hypothesis about behavior, not a guarantee that adding a sentence will solve every related problem.
Figure 2. A hypothetical illustration, not a measured benchmark result or a product demonstration: make the expected procedure explicit, then test whether the agent follows it without unacceptable trade-offs.
Candidate search is iterative. A proposal is exercised on sampled cases; promising candidates receive fuller validation. Feedback from evaluation informs subsequent proposals. The search stops when its candidate or evaluation budget is reached, or its stopping conditions are met. More candidates mean more opportunities to find a useful change, but also more executions to pay for and review.
4. Check targeted improvement and broader quality
A candidate needs more than a plausible system prompt rewrite. The recommendation policy requires measured remediation improvement and an acceptable quality result. Among qualifying candidates, remediation is the primary ranking signal, with quality used to distinguish otherwise comparable results.
The quality guard permits a limited decrease. We set a tolerance of 0.02 on the normalized quality-score scale (two points on a 0-100 presentation). Either way, the guard is not a promise of zero regression. A candidate can be useful on the selected issues while still making other conversations worse. The owner must decide whether those trade-offs are acceptable.
At a conceptual level, the loop looks like this:
Figure 3. Pseudo-code for the insights-optimization logicIndependent validation is preferable, but the loop must expose when evidence is shared or incomplete. Missing evaluator output is not a successful fix. Likewise, a per-insight improvement can mean that some associated cases improved, not that every instance of the issue is resolved.
5. Review the evidence before adoption
Review should connect the candidate's text changes to its measured behavior. Start with the selected insights, inspect representative baseline and candidate executions, and examine the broader quality results. A single aggregate score can hide both useful fixes and new regressions.
The run can also report remediation across the prepared failure scenarios, including training examples. That detail helps explain where a candidate worked, but it is not interchangeable with the validation objective used to recommend it. In particular, counting every replay that no longer shows an issue can overstate improvement if the baseline already handled that replay successfully.
After review, promotion is a deliberate action. Continue monitoring after adoption: replay evidence is bounded, production traffic changes, and evaluation models are imperfect. Optimization supplies evidence for an engineering decision; it does not remove responsibility for that decision.
Benchmarks
We examined an internal test snapshot across four test workloads: Tau3-bench-retail, Weather, a healthcare-themed agent built only for internal testing (labeled Healthcare below; it is not a medical product, does not provide medical advice, and its results are not clinical validation), and Retail-tools. None is a customer deployment. Rather than select individual runs, we averaged every completed optimization job in a seven-day window ending November 18, 2026, at 16:00 UTC. That gives 89 jobs: 27 for Tau3-bench-retail, 26 for Weather, and 18 each for Healthcare and Retail-tools. Fifteen of them kept the unchanged agent because no candidate qualified, and those jobs count in the averages.
All jobs used the same search settings: instructions-only optimization, up to two proposed candidates, and one concurrent agent evaluation, against a pinned agent version per workload. The service was evolving during the window so treat these results as a descriptive snapshot of a preview service, not a controlled comparison of fixed releases. The internal models and test setup also limit external reproducibility. Repeated jobs reuse the same prepared evidence, so they show run-to-run variation rather than 89 independent samples of production traffic.
Count improvements conservatively
"Selected insights" counts the findings submitted to optimization, not every finding a scan produced. "Problem conversations" counts distinct conversations in the prepared failure evidence; one conversation can support several insights.
We credit only improvements the unchanged agent did not already achieve. An improved insight has at least one case that still failed in the baseline replay and was remediated by the recommended candidate; it does not mean every case of that insight was fixed. A cleared conversation had at least one such new remediation and no remaining selected issue in the candidate's evidence. Incomplete judgments, which affected 40 observations across 36 jobs, earn no credit, so the counts are lower bounds on what the available observations confirm.
Figure 4. Internal seven-day test snapshot of a preview service; not production results. Bars show means per job across all 89 completed jobs, including 15 that kept the baseline. Each workload's improved insights and cleared conversations are shown next to its own totals of selected insights and prepared problem conversations, which are the denominators. Whiskers show observed minimum–maximum ranges across jobs, not confidence intervals. Outcomes are evaluator-assessed on prepared scenarios (training and held-out failure evidence), not results from deployed applications or success rates on unseen traffic. Healthcare is a test agent; its results are not clinical validation. Results are specific to this test setup and will vary.
Results differed across workloads in this snapshot, which is why we report them separately rather than as one headline rate. The workloads also differ in task structure, available evidence, and evaluation criteria, so these differences are not a controlled comparison between workloads. The Healthcare test agent and Retail-tools received a recommended change in all 18 jobs, with evaluator-assessed averages of 3.3 of 4 and 5.1 of 6 selected insights improved, and 17.3 of 19 and 12.5 of 21 problem conversations cleared. Weather's single selected insight was improved in 20 of 26 jobs, with 16.2 of 22 conversations cleared on average; per-job results ranged from 0 to 22 cleared conversations.
Tau3-bench-retail had the lowest measured improvement in this snapshot. On average 1.8 of 5 selected insights improved and 2.6 of 14 conversations cleared, and 9 of its 27 jobs kept the baseline. One measured factor is visible in the figure: baseline replay reproduced a mean of 10.4 of the 14 prepared historical failures, and failures that did not reproduce could not be credited as improved. We did not isolate other factors. These results do not establish whether more candidates, more evidence, or other change types would improve outcomes for this workload.
These counts describe evaluator-assessed behavior on prepared scenarios. They are not official Tau3 task-success scores, clinical validation, or evidence of equivalent improvement in a deployed application. The broader quality check is also not a promise of "no regression": Weather's mean broader-quality score decreased by about 0.003 on the normalized 0-1 scale, within the configured 0.02 acceptance tolerance. Review targeted outcomes and broader behavior together.
Account for the work required
Optimization consumes resources even when no candidate qualifies. In this internal test snapshot, mean recorded usage per completed job ranged from 3.1 million tokens for Weather to 10.9 million for Tau3-bench-retail, covering baseline evaluation, candidate search and evaluation, and failure reporting where recorded. These measurements reflect this test configuration and should not be read as expected customer usage or cost. Usage depends on scenario length, tool output, candidate budget, stopping conditions, and evaluation effort.
We report tokens rather than dollars on purpose. Pricing depends on the deployments and billing terms in use, so applying an assumed rate would be misleading. Preparation, insight discovery, external tool or infrastructure charges are not included in this token usage. A financial comparison requires complete usage coverage and the applicable prices.
What we took away
Three practical points follow from these internal test runs. First, reproducibility matters: a historical failure that does not reoccur in baseline replay cannot be measured as improved, so check how many selected failures reproduce before judging a run. Second, look at the spread, not only the mean: Weather jobs ranged from no cleared conversations to all 22, so a single run can mislead in either direction. Third, keeping the baseline is a legitimate result. A run that finds no qualifying candidate is a signal to revisit the evidence and the diagnosis before trying again.
Get started
Insights Optimization is in public preview. The portal workflow currently only supports prompt agents that do not use the Microsoft Copilot harness; hosted agents use separate toolkit or CLI workflows. This preview is provided without a service-level agreement, and Microsoft does not recommend it for production workloads.
Start with one confirmed issue and representative traces. Before running evaluation, ensure that tools have read-only access or isolated test resources and permissions. Review the candidate changes and both targeted and broader evaluation results before promotion.
- Start building in Microsoft Foundry: ai.azure.com
- Get the BRK251 session: Agents in production: Observe, evaluate, and optimize with Foundry
- Read the docs: Find recurring issues with insights and Fix insights with agent optimizer (preview)
- Join the community: Microsoft AI on Discord