Menu
InfoQ Architecture·November 30, 2026

Microsoft Foundry's Optimization Loop for AI Agents: A System Design Perspective

Microsoft Foundry introduces an optimization loop for production AI agents, enabling continuous improvement through automated evaluation, candidate generation, and developer-approved deployment. This system integrates various components like evaluators, optimizers, and training mechanisms to refine agent behavior based on real-world performance. The architectural design emphasizes human-in-the-loop validation for critical changes.

Read original on InfoQ Architecture

Introduction to the Agent Optimization Loop

Microsoft Foundry's new feature provides a closed-loop system for improving AI agents in production. This system automates the process of identifying agent shortcomings, proposing fixes, and validating changes before deployment. It represents a sophisticated MLOps approach to ensure agents remain effective and reliable over time, directly addressing challenges of maintaining AI system performance in dynamic environments.

Four-Stage Continuous Improvement Process

  1. Establish Goals: Define what 'good' performance looks like for the agent.
  2. Identify Shortcomings: Group recurring failures and rank potential fixes using production insights and multi-turn evaluations.
  3. Optimize: Generate candidate configurations (system instructions, skills, tools, model choice) and rank them.
  4. Validate and Release: Human review and approval of proposed changes, followed by staged deployment with rollback paths.
ℹ️

Key Components in the Loop

The agent optimizer evaluates hosted agents against predefined criteria, generating and ranking candidate configurations. A crucial part of this is the reflector model, a separate AI that diagnoses why agents fail, influencing results more significantly than the agent's own model choice. This highlights an interesting architectural decision to externalize failure analysis.

Architectural Considerations and Trade-offs

The system leverages a model router for efficient model selection, claiming up to 65% cost savings by intelligently directing requests. For more complex fixes, Managed Training or Programmed Training can be employed, which involve changing model weights. Programmed Training allows customers to implement custom supervised fine-tuning or reinforcement learning, with Foundry handling the underlying GPU operations, offering flexibility while maintaining platform control.

bash
azd ai agent eval init # generate dataset & evaluator
azd ai agent eval run # score current version
azd ai agent optimize # search over candidates
azd ai agent optimize apply --candidate <id> # apply winner locally
azd deploy # ship as next version

A critical aspect emphasized by practitioners is the human-in-the-loop for approval before deploying optimized agents. This mitigates risks associated with self-modifying agents, especially for high-risk actions. Robust review processes, including diff inspection, analysis of improved/regressed examples, and staged rollouts with rollback capabilities, are essential for maintaining system stability and reliability.

  • Safety Tests: Essential for prompt injection and unauthorized tool use.
  • Golden Datasets: Small, high-quality datasets for critical actions.
  • Regression Sets: Broader datasets for ordinary requests to prevent unintended side effects.
AI AgentsMLOpsContinuous ImprovementAutomated TestingModel OptimizationHuman-in-the-LoopAzure FoundryProduction Systems

Comments

Loading comments...