responsible ai
25 TopicsAutonomous AI Cyberattacks: Architecting Cyber Defense with Azure
Attackers do not need a new vulnerability to change the economics of cyber defense. They can use AI agents to compare patches, identify likely weaknesses, generate candidate exploits, test them, and repeat the loop at machine speed. A recent NDTV report highlighted Google Threat Intelligence Group’s (GTIG) November 2026 finding that threat actors were using large language model (LLM) frameworks to automate vulnerability discovery and exploitation without a human in the loop [1][2]. GTIG also identified an important limitation: many autonomous offensive frameworks currently trade stealth for velocity, producing forensic traffic and recognizable traces [1]. That combination changes the defender’s job. The patch window gets shorter, alert volume rises, and an incident can move from reconnaissance to impact before a manual queue catches up. But speed is not the same as invincibility. Noisy automation creates behavior that defenders can correlate, prioritize, and contain — if the defensive system is designed to reason and act safely at the same tempo. This article proposes an Autonomous Cyber Defense Framework (ACDF): a conceptual, human-governed architecture that combines Microsoft Sentinel, Microsoft Defender XDR, Microsoft Security Copilot, Microsoft Entra, Azure-native automation, and optional custom agents built with Microsoft Foundry Agent Service. ACDF is not a Microsoft product or an official Microsoft framework. It is a reference pattern for deciding where autonomy helps, where deterministic policy must take control, and where a human must approve the next step. Key takeaways Use agents to accelerate investigation and recommendation, not to grant open-ended production authority. Keep authorization and high-impact decisions outside the language model. Separate read, reason, decide, and act into independently governed stages. Start with simulated telemetry and measure both security value and unsafe-action risk. Why autonomous attacks require a different control loop Traditional security operations often follow a human-paced sequence: collect an alert, enrich it, assign it, investigate it, decide on containment, and execute a playbook. An autonomous attacker can run an Observe-Orient-Decide-Act loop continuously across many targets. It can branch, retry, and adapt based on tool output. The underlying techniques are often familiar: stolen credentials, exposed services, unpatched software, weak authorization, and lateral movement. The change is operational compression. GTIG describes automated patch-differential analysis and n-day exploitation pipelines that reduce the time between disclosure and weaponization. It also cautions that AI-generated exploit claims can fail, creating extra verification work for defenders [1]. A useful defensive response is therefore not “let an AI fight an AI.” It is a faster, evidence-driven control loop: Observe: collect endpoint, identity, cloud, network, application, and threat-intelligence signals. Orient: correlate events into an incident and establish asset, identity, and business context. Decide: score risk through deterministic policy, supported by agent-generated analysis and evidence. Act: execute only an allowlisted, least-privileged response appropriate to the risk tier. Learn: record the decision, approval, action, outcome, and analyst feedback for evaluation. The architecture must assume that telemetry, retrieved documents, emails, web content, and even messages from another agent can be hostile. A prompt injection hidden inside a log field should never become an instruction to isolate a device or disable an identity. ACDF: a governed autonomous-defense architecture Figure 1. Proposed ACDF reference architecture. AI can enrich and recommend, while a deterministic policy decision point and human approval gates control consequential actions. 1. Signal and context plane The first layer collects normalized security signals. Microsoft Defender XDR can contribute cross-domain endpoint, identity, email, application, and cloud-app evidence. Microsoft Sentinel can add broader SIEM data, analytics, incidents, and threat hunting. Microsoft Defender for Cloud can contribute cloud workload posture and alerts; Microsoft Entra supplies identity and access context; Azure Monitor and application telemetry add service-level evidence. Coverage matters more than model sophistication. Missing identity logs, stale asset ownership, or incomplete endpoint onboarding can cause a sophisticated agent to produce a precise answer to the wrong question. Before adding agents, validate data freshness, retention, entity mapping, and the ownership of critical assets. 2. Correlation and detection plane Use native detections, behavioral analytics, advanced hunting, and incident correlation to reduce raw events into evidence-backed cases. Microsoft Sentinel data can be used with Security Copilot, and unified incidents in the Microsoft Defender portal can bring Sentinel and Defender XDR context together [3][10]. The Microsoft Sentinel and natural-language-to-KQL plugins described in the Security Copilot integration documentation are in preview, and not all Microsoft Sentinel tables are supported. Advanced hunting with Microsoft Sentinel data also has documented limitations, so generated queries and coverage must be validated before operational use [3][10]. This layer should retain deterministic detections for conditions that must be explainable and repeatable. Agents can propose hunts, summarize evidence, and identify gaps, but a model output is not itself a detection verdict. 3. Agentic analysis plane Use the most managed capability that fits the task. Microsoft Security Copilot and its agents in Microsoft Defender support security workflows such as alert triage, threat intelligence, hunting, and risk analysis [4][5]. Check the current product documentation before deployment: the broader Security Alert Triage Agent coverage includes preview capabilities, and the Security Analyst Agent documentation contains a prerelease notice. For a custom scenario that is not covered by an existing security agent, Microsoft Foundry Agent Service can provide Microsoft Entra identity, managed tools and toolboxes, tracing, and evaluation capabilities [6]. A practical separation of duties is: Intelligence agent: summarizes public advisories and maps them to the organization’s technology inventory. Investigation agent: gathers read-only evidence for an incident and identifies competing hypotheses. Risk agent: proposes a score with citations to the evidence it used. Response planner: selects only from an allowlisted catalog of playbooks and explains prerequisites. These agents should not share a single broad identity. Give each agent the minimum data scope and tools it needs. Treat every inter-agent message as untrusted input and preserve provenance. 4. Policy decision point The policy decision point is deliberately outside the LLM. It combines stable facts — incident severity, asset criticality, identity privilege, confidence, blast radius, action reversibility, change window, and regulatory constraints — into an action tier. A simple policy can be expressed as four levels: Table 1. Proposed ACDF action tiers and execution rules Tier Example outcome Execution rule 0 - Observe Add context, open an incident, notify an analyst May run automatically 1 - Low-impact Increase logging, collect a diagnostic package, add a temporary tag Automatic only when allowlisted and reversible 2 - Contain Isolate one endpoint, revoke one session, block one indicator temporarily Named analyst approval; consider two-person approval for privileged assets 3 - High-impact Disable a privileged identity, remove production access, modify a firewall broadly, delete data No autonomous execution; follow incident command and change-control procedures Risk thresholds must be versioned configuration, not prompt text. The policy engine should fail closed when evidence is missing, conflicting, stale, or outside the evaluated operating range. 5. Controlled action plane Microsoft Sentinel automation rules and playbooks based on Azure Logic Apps can provide a governed response mechanism [7]. Each playbook should have a narrow purpose, a managed identity or other approved authentication method, an explicit resource scope, a timeout, an idempotency key, a rollback path, and structured audit output. The agent does not receive a generic “run command” tool. It can request collect_diagnostics , temporarily_block_indicator , or isolate_single_device , each with a typed schema and preconditions. The policy service reauthorizes every action at execution time. This helps reduce confused-deputy risk and prevents an old approval from being reused against a different resource. 6. Evidence, observability, and learning plane Store a tamper-evident decision record containing the incident ID, evidence references, model and prompt version, policy version, tool request, approver, action result, rollback state, and analyst feedback. Foundry Agent Service supports tracing and evaluation for custom agents [6]; native Microsoft security experiences provide their own evidence and activity views. Do not train directly on every analyst click. A rushed approval, a false positive, or attacker-poisoned telemetry can become a persistent failure pattern. Curate feedback, separate evaluation data from production memory, and require review before changing prompts, policies, or action permissions. Guardrails that matter more than the model The most important controls are architectural: Separate read from write. Investigation agents should be read-only. A distinct action service performs mutations after policy evaluation. Authorize every action. Recheck user, agent, resource, purpose, and policy at execution time — not only when a session starts. Use least privilege and just-in-time access. Use Microsoft Entra role-based access controls and Privileged Identity Management where applicable. Avoid standing administrative credentials. Allowlist tools and parameters. Block arbitrary shell, browser, query, or code execution in the response path unless it is isolated and explicitly required. Require approval for consequence. Human approval is mandatory for high-impact, irreversible, externally visible, privacy-sensitive, or legally significant actions. Limit blast radius. Set maximum affected identities, devices, subscriptions, duration, calls, tokens, and cost per run. Treat context as data, not instructions. Sanitize untrusted fields, isolate system instructions, and do not let retrieved content redefine the agent’s policy. Design for rollback. Temporary blocks should expire; device isolation should have a tested release path; repeated requests should be idempotent. Log enough to reconstruct the decision. Capture evidence and rationale without copying unnecessary secrets or personal data into prompts or long-lived memory. Provide a kill switch. Security operations must be able to suspend an agent, revoke its identity, and disable playbooks independently. These controls align with Microsoft’s AI agent shared responsibility guidance: customers remain accountable for data, identity, authorization, human oversight, and governance, even when using a managed agent platform [8]. OWASP guidance similarly emphasizes least privilege, human approval for high-impact actions, input validation, memory protection, logging, and emergency shutdown [14]. Safe proof of concept: score simulated telemetry and request approval The following Python example is intentionally benign. It does not scan systems, generate exploits, or invoke a live security API. It scores synthetic observations, selects a recommendation from an allowlist, and emits an approval request. Use it to test the control boundary before connecting any production data. from __future__ import annotations from dataclasses import asdict, dataclass from typing import Literal import json import re import uuid Action = Literal[ "no_action", "observe", "collect_diagnostics", "isolate_single_device", ] Status = Literal["evaluated", "rejected"] POLICY_VERSION = "acdf-lab-v1" @dataclass(frozen=True) class SyntheticObservation: incident_id: str device_id: str failed_signins_10m: int privileged_identity: bool unusual_process: bool outbound_spike: bool asset_criticality: int # 1=low, 2=medium, 3=high @dataclass(frozen=True) class Decision: decision_id: str policy_version: str status: Status score: int | None recommendation: Action requires_action_approval: bool requires_human_review: bool evidence: tuple[str, ...] validation_errors: tuple[str, ...] def validate(obs: SyntheticObservation) -> tuple[str, ...]: """Reject malformed or out-of-scope inputs before scoring.""" errors: list[str] = [] if not re.fullmatch(r"SIM-[0-9]{4,8}", obs.incident_id): errors.append("incident_id must be a synthetic SIM identifier") if not re.fullmatch(r"LAB-DEVICE-[0-9]{2,4}", obs.device_id): errors.append("device_id must identify an approved lab device") if type(obs.failed_signins_10m) is not int or not 0 <= obs.failed_signins_10m <= 10_000: errors.append("failed_signins_10m must be an integer from 0 to 10000") if type(obs.privileged_identity) is not bool: errors.append("privileged_identity must be boolean") if type(obs.unusual_process) is not bool: errors.append("unusual_process must be boolean") if type(obs.outbound_spike) is not bool: errors.append("outbound_spike must be boolean") if type(obs.asset_criticality) is not int or obs.asset_criticality not in {1, 2, 3}: errors.append("asset_criticality must be 1, 2, or 3") return tuple(errors) def evaluate(obs: SyntheticObservation) -> Decision: errors = validate(obs) if errors: # Fail closed: reject the record and propose no action. return Decision( decision_id=str(uuid.uuid4()), policy_version=POLICY_VERSION, status="rejected", score=None, recommendation="no_action", requires_action_approval=False, requires_human_review=True, evidence=(), validation_errors=errors, ) score = 0 evidence: list[str] = [] if obs.failed_signins_10m >= 20: score += 20 evidence.append("failed_signins_10m>=20") if obs.privileged_identity: score += 25 evidence.append("privileged_identity") if obs.unusual_process: score += 25 evidence.append("unusual_process") if obs.outbound_spike: score += 20 evidence.append("outbound_spike") score += {1: 0, 2: 5, 3: 10}[obs.asset_criticality] if score >= 70: action: Action = "isolate_single_device" elif score >= 35: action = "collect_diagnostics" else: action = "observe" consequential = action == "isolate_single_device" return Decision( decision_id=str(uuid.uuid4()), policy_version=POLICY_VERSION, status="evaluated", score=score, recommendation=action, requires_action_approval=consequential, requires_human_review=consequential, evidence=tuple(evidence), validation_errors=(), ) sample = SyntheticObservation( incident_id="SIM-0042", device_id="LAB-DEVICE-07", failed_signins_10m=24, privileged_identity=False, unusual_process=True, outbound_spike=True, asset_criticality=2, ) invalid_sample = SyntheticObservation( incident_id="PROD-0042", # Rejected: outside this synthetic lab scope. device_id="SERVER-01", failed_signins_10m=-1, privileged_identity=False, unusual_process=False, outbound_spike=False, asset_criticality=9, ) valid_decision = evaluate(sample) rejected_decision = evaluate(invalid_sample) assert valid_decision.recommendation == "isolate_single_device" assert valid_decision.requires_action_approval is True assert rejected_decision.status == "rejected" assert rejected_decision.recommendation == "no_action" print(json.dumps(asdict(valid_decision), indent=2)) print(json.dumps(asdict(rejected_decision), indent=2)) The key design choice is not the score. It is the boundary: the program creates a recommendation and evidence record, but it has no credential and no function that can isolate a device. Malformed or out-of-scope input is rejected with no_action and routed for review. A separate approval and action service would validate the request again, re-check current policy and authorization, bind the approval to the exact action and lab resource, enforce an expiry, and then invoke a narrowly scoped playbook. To extend the lab safely: Replace the single sample with version-controlled synthetic JSON Lines files. Add unit tests for thresholds, missing fields, duplicate requests, expired approvals, and rollback. Mock the playbook endpoint; return deterministic success, failure, timeout, and partial-completion responses. Add a read-only agent that explains the deterministic decision, then test whether hostile text inside a telemetry field can alter the proposed action. Never use real customer data, production credentials, malware, exploit code, or internet scanning in the experiment. Evaluate the system without inventing success Do not claim that an agent “reduces response time” or “improves accuracy” until the system has been evaluated against a documented baseline. A reproducible evaluation can compare three modes on the same labeled, synthetic scenario set: Rules only: deterministic scoring and static playbook selection. Agent assisted: an agent enriches and explains; policy still decides. Agent plus governed action: low-risk actions can run; consequential actions require approval. Record the dataset version, scenario families, label owner, product configuration, model version, prompts, policy version, run count, and randomization settings. Measure: Table 2. Reproducible evaluation metrics Metric Definition Detection precision and recall Correct suspicious classifications relative to the labeled set Alert-to-decision latency Time from final synthetic event to a complete recommendation Unsafe-action proposal rate Proposals that violate the action policy divided by all proposals Approval override rate Approved recommendations that analysts change or reject Evidence completeness Required evidence fields present and traceable to source records Idempotency pass rate Repeated requests produce no duplicate side effect Rollback success rate Reversible actions restored within the test objective Cost per evaluated incident Model, compute, and automation cost for each completed case Define gates before running the test. For example, any Tier 3 autonomous action, cross-tenant data exposure, policy bypass, or unlogged tool call should fail the release. Report confidence intervals or raw counts, not only percentages, and publish negative cases. An agent that is faster but proposes unsafe containment is not an improvement. Operational rollout: earn autonomy in stages A production journey should expand authority only after evidence supports it: Shadow: the agent reads copied or synthetic data and produces recommendations that no one acts on. Assist: analysts can inspect evidence and manually launch existing playbooks. Approve: the system creates a typed action request; an authorized analyst approves it. Bounded autonomy: only reversible Tier 0 or Tier 1 actions run automatically within strict scope and volume limits. Continuous assurance: red-team prompt injection, poisoned telemetry, permission drift, model changes, tool failures, and rollback every release cycle. Keep emergency response outside the experimental agent path. If the agent is unavailable or produces conflicting evidence, analysts must retain access to the native Microsoft Defender and Microsoft Sentinel workflows. Limitations and design boundaries ACDF does not eliminate cyber risk, replace patch management, or guarantee containment. Its effectiveness depends on telemetry quality, identity hygiene, asset context, well-tested playbooks, supported product capabilities, licensing, region, and operational maturity. Some Microsoft security agent capabilities and Security Copilot integrations are in preview and can change. Not all Microsoft Sentinel tables are supported in every Copilot or advanced-hunting path. Verify current documentation, permissions, query behavior, licensing, regional availability, and support boundaries before production use [3][4][5][10]. Language models can hallucinate, overgeneralize, follow malicious instructions embedded in context, or vary between runs. Deterministic policy reduces these risks but cannot compensate for incorrect labels, missing logs, compromised administrators, or an overly permissive action catalog. Legal, privacy, employee-monitoring, customer-contract, and regulatory obligations may also restrict what data an agent can process and which actions it may recommend or execute. Finally, autonomous defense should not become a reason to normalize autonomous disruption. The objective is controlled speed: faster evidence gathering, better prioritization, and narrowly governed response with clear accountability. Start with one bounded control loop Choose one high-volume, low-consequence security workflow. Build a synthetic scenario set, define an allowlisted action catalog, and separate the agent from the policy and action services. Connect read-only evidence first. Then run the evaluation until you can explain every decision, reproduce every result, and roll back every permitted action. If you already use Microsoft Defender XDR and Microsoft Sentinel, start by exploring their unified incidents, advanced hunting, Security Copilot integration, and documented agents. Treat preview capabilities and generated queries as inputs for validation, not as automatic authority. Use Microsoft Foundry Agent Service only when a custom agent is justified, and keep the action boundary outside the model. Autonomous attackers compress time. Defenders can respond by compressing analysis — without compressing governance. References Google Threat Intelligence Group, GTIG AI Threat Tracker: Agentic Threat Activity Crosses a Significant Threshold, November 16, 2026. NDTV, Google Warns 'Era Of Autonomous AI Attacks Has Arrived', November 18, 2026. Microsoft Learn, Security Copilot with Microsoft Sentinel. Microsoft Learn, Deploy AI agents in Microsoft Defender. Microsoft Learn, Microsoft Security Copilot Security Analyst Agent overview. Microsoft Learn, Agents in Microsoft Foundry. Microsoft Learn, Azure Logic Apps for Microsoft Sentinel playbooks. Microsoft Learn, AI agent shared responsibility model. Microsoft Learn, What is Privileged Identity Management?. Microsoft Learn, Advanced hunting with Microsoft Sentinel data in Microsoft Defender. NIST, Artificial Intelligence Risk Management Framework: Generative Artificial Intelligence Profile, NIST AI 600-1. NIST, The NIST Cybersecurity Framework (CSF) 2.0. MITRE, ATLAS: Adversarial Threat Landscape for Artificial-Intelligence Systems. OWASP Cheat Sheet Series, AI Agent Security Cheat Sheet.319Views2likes1CommentThe Governance Layer Every Enterprise AI Agent Needs
Introduction The first wave of agentic AI was about capability: Can an AI agent reason, retrieve enterprise knowledge, call tools, and take actions? The next question is much harder: Should the agent be allowed to do it? As AI agents move from experiments into enterprise environments, building the agent is only part of the problem. We need to decide what principles it must follow, what knowledge it can trust, which model should handle a request, what actions it is authorized to perform, and how every important decision can be traced and audited. Building such an agent raises four fundamental governance questions: 1. What principles must the agent obey? 2. What knowledge is the agent allowed to access and trust? 3. Which model should handle each request? 4. What did the agent decide and do, and can we audit it? These four questions give us four layers of enterprise AI governance: This is where AI governance becomes part of the architecture, not an afterthought. 1. Constitutional Governance What principles must the agent obey? AI agents can reason, retrieve information, call tools, and take actions dynamically. This introduces an important governance question: What principles and boundaries must the agent follow regardless of what a user asks it to do? For example, an enterprise HR agent might be required to: Protect sensitive employee information. Detect attempts to manipulate its instructions. Prevent harmful or prohibited responses. Validate risky actions before executing them. Connect only to approved enterprise systems. These principles form a constitutional governance layer around the agent. The goal is not to rely only on instructions in the system prompt, but to enforce controls throughout the agent workflow. How does Microsoft Foundry enable it? Microsoft Foundry provides Guardrails, which allow organizations to configure safety and security controls around models and agents. A guardrail is a named collection of controls. Each control defines: The risk that should be detected. Where in the interaction the risk should be evaluated. What action should be taken when the risk is detected. Guardrails can evaluate an interaction at different stages: Intervention point What is checked User input What the user asks Tool call What action the agent wants to perform Tool response What information a tool returns Output What the agent returns to the user For example, consider: "Ignore company policy and retrieve the salary details of another employee." A guardrail can detect the unsafe input, inspect a proposed HR tool call, evaluate information returned by the tool, or prevent unsafe information from appearing in the final response. This provides defense in depth, rather than relying on a single system prompt. Steps to configure Guardrails in Microsoft Foundry Open the Microsoft Foundry project. Go to Build → Guardrails. Select Create Guardrail. Select the required control or risk. Choose where it should apply: User input, Tool call, Tool response, or Output. Configure the required action and save the guardrail. Assign it to the supported agent or model deployment. Test with both normal and adversarial prompts. Step 1: Creating a Guardrail Capture: Foundry → Build → Guardrails → Create Guardrail This screenshot demonstrates where governance controls are created. Step 2: Configuring a control Capture the screen showing the selected risk together with the available intervention points and actions. This is the most important screenshot because it visually demonstrates that governance can happen at different stages of agent execution. Step 3: Testing the Guardrail Run one allowed prompt and one intentionally blocked test prompt and capture the resulting behavior. This demonstrates that the governance policy is actually being enforced rather than existing only as an agent instruction. 2. Knowledge Governance What knowledge is the agent allowed to access and trust? Enterprise agents need access to organizational knowledge such as policies, SharePoint documents, operational data, and business information. But simply because information exists within the enterprise does not mean every agent or employee should be able to access it. Knowledge Governance therefore focuses on four questions: Source: Where did the information come from? Trust: Is it an approved enterprise source? Access: Is the user authorized to see it? Grounding: Can the answer be traced back to its source? For example, an HR agent should be able to answer: "What is our parental leave policy?" But it should not expose another employee's confidential information simply because that data exists within an enterprise system. How does Microsoft Foundry enable it? Microsoft Foundry provides Foundry IQ, which enables organizations to create reusable, multi-source knowledge bases for AI agents. A shared knowledge architecture can look like this: SharePoint + OneLake + Azure Blob Storage + Approved Web Sources → Foundry IQ Knowledge Base → HR Agent / IT Agent / Finance Agent Instead of every agent maintaining a separate retrieval pipeline, multiple agents can use a shared knowledge base. Foundry IQ uses Azure AI Search for indexing and retrieval and supports agentic retrieval across configured knowledge sources. More importantly for governance, it can support permission-aware retrieval using capabilities such as Microsoft Entra identity, ACLs, query-time authorization, and Microsoft Purview sensitivity labels for supported sources. This means the knowledge base can be shared while the information returned still depends on what the requesting user is authorized to access. Foundry IQ can also return citations to the source content, helping users verify where an agent's answer originated. Steps to create a shared knowledge base Open your Microsoft Foundry project and go to Build → Knowledge. Create or connect an Azure AI Search resource. Create a Knowledge Base and add the required knowledge sources. Configure the required retrieval settings and access controls. In Azure AI Search, go to Access control (IAM) → Add role assignment and assign Search Index Data Reader to the Foundry project/resource managed identity. Go to Agents and connect the Knowledge Base to the required agent. Test the agent and verify that the response is grounded in the expected source with citations. Step 1: Build → Knowledge showing the Knowledge Base and connected sources. Step 2: The Knowledge Base connected to an agent and adding the permissions Step 3: An agent response showing the retrieved answer and source citations. Key takeaway: Knowledge Governance is not simply about giving an agent more data. It is about giving the agent access to the right knowledge, for the right user, from trusted sources, with traceability back to the source. 3. Model Governance Which model should handle each request? Model Governance determines which AI models an organization allows its agents to use, how models are selected for different tasks, and how their performance is evaluated over time. Not every enterprise request requires the same level of intelligence. A simple question such as "What are the office working hours?" does not require the same reasoning capability as "Compare these three financial reports and identify potential inconsistencies." Using the most powerful model for every request can increase operational costs and response latency. Conversely, using a smaller model for complex reasoning tasks could affect response quality. Model Governance therefore focuses on finding the right balance between: Capability: Is the model capable of handling the task? Quality: Does it produce accurate and reliable responses? Cost: Is the model economically viable at scale? Performance: Does it meet the required latency and throughput? Compliance: Is the model approved for the organization's data and workload requirements? It also establishes a controlled set of models that agents are permitted to use, rather than allowing unrestricted model selection. How does Microsoft Foundry enable it? Microsoft Foundry provides a model catalogue, model deployment options, routing capabilities, and evaluation tools to help organizations manage model selection and performance. 1. Microsoft Foundry Model Catalogue The Foundry Model Catalogue provides a centralized place to explore available models from Microsoft and other providers. Organizations can compare models based on their capabilities, supported modalities, benchmarks, and deployment options. For example, an enterprise might maintain an approved model pool containing: A smaller model for simple employee queries. A more capable model for document summarization. A reasoning-oriented model for complex multi-step tasks. This creates a controlled model selection process before models are made available to agents. Steps to use the Model Catalog 1. On the overview page of Microsoft Foundry, Select Explore Models. 2. Search for the model that you're looking for in the search bar. 2. Microsoft Foundry Model Router One of the most interesting capabilities here is Model Router. Instead of manually writing routing logic for every incoming request, Model Router analyzes the request context and dynamically selects an appropriate model from the configured model pool. For example: Employee request Routing decision "What are the office timings?" A smaller, faster model "Summarize the leave policy." A capable general-purpose model "Compare multiple policies and identify exceptions." A more capable reasoning model Model Router supports different routing approaches that prioritize cost, balanced performance, or quality. It can also be used with Foundry Agent Service, where model selection can happen independently for individual requests within a conversation. This means the same conversation does not necessarily need to use the same model for every turn. Steps to implement model router through Microsoft Foundry 1. In Model catalog, search for model-router 2. Choose Custom settings 3. Select the routing mode 4. Deploy the model router and navigate to the playground to test. In the images below, I have tried three prompts. Each of these prompts are being handled by different models. 3. Model Evaluations Selecting a model based on its published benchmarks is not enough. Organizations need to evaluate how it performs against their actual business requirements. Microsoft Foundry Evaluations allows teams to assess models and agents using test datasets and predefined or custom evaluators. For example, an organization can create a dataset of HR-related questions and expected answers, then compare candidate models based on: Answer relevance. Accuracy and groundedness. Response quality. Safety. Latency and token consumption. These evaluations help determine whether a model is suitable for a particular workload before it is approved for production. Steps to run a Model Evaluation in Microsoft Foundry 1. Open your Foundry project. Select Evaluations on the navigation bar on the left. 2. Select Create and choose Model as the evaluation target. 3. Choose an existing dataset or create one containing test questions, reference context, and expected answers. 4. Select evaluators such as Relevance, Groundedness, Coherence, and Fluency. 5. Configure the evaluation, review the settings, and submit the run. 6. Once completed, inspect the aggregate scores and individual evaluation results. An important distinction: The evaluated model vs. the evaluator model In AI evaluations, two different models may be involved: Target model: The model being evaluated. It generates responses to the test questions. Evaluator (Judge) model: A separate model that assesses the generated responses against evaluation criteria such as relevance, groundedness, and quality. For example, an organization might evaluate GPT-4o-mini using a GPT-4.1 deployment as the evaluation judge. The target model generates the answer, while the judge model assesses how well that answer meets the expected criteria. Not every evaluator requires a judge model. Some evaluators use code-based metrics, while others use AI-assisted evaluation and require a configured judge model. 4. Continuous Evaluation and Optimization Model governance does not end once a model is deployed. Organizations need to continuously monitor AI performance, identify quality regressions, and optimize their solutions based on observed behavior. Microsoft Foundry provides a monitoring dashboard that helps teams track agent activity, execution performance, token consumption, and operational trends. Steps to monitor and optimize AI agents in Microsoft Foundry Deploy an AI agent and enable tracing so that its interactions and execution details can be captured. Generate sample interactions through the agent playground or application. Navigate to Monitor > Overview in your Foundry project. Select the relevant time range and review metrics such as agent runs, token usage, estimated cost, and operational performance. Compare trends across different time periods to identify changes in usage, performance, or failures. Use the observations to optimize prompts, model selection, and Model Router configurations where applicable. For example, if an agent experiences increased latency or consistently consumes more tokens than expected, engineering teams can investigate its execution traces and optimize the underlying model or orchestration strategy. This creates a feedback loop where observed performance and evaluation results drive ongoing optimization. If quality drops for certain request types, adjust Model Router's configuration to route those to a more capable model. 4. Decision Governance What did the agent decide and do, and can we audit it? Decision Governance focuses on making an AI agent's execution, decisions, and actions observable, measurable, and accountable. Unlike traditional applications, AI agents can make context-dependent decisions, select tools, retrieve information, and execute multi-step workflows. This introduces an important enterprise challenge: knowing what happened during an interaction is not always as straightforward as checking an application log. Consider an employee asking an IT support agent to raise a service request. The agent might: Interpret the employee's request. Identify the appropriate IT support category. Select the relevant API or tool. Invoke the API to create a ticket. Receive a response from the ITSM system. Confirm the result to the employee. Now imagine that the agent creates a duplicate ticket or assigns the request to the wrong department. The organization needs to investigate: What did the employee ask? Which model handled the request? What information did the agent retrieve? Which tool did it invoke? Was the action authorized? What was the final outcome? Decision Governance ensures that these interactions can be investigated, evaluated, and audited. How does Microsoft Foundry enable it? 1. Agent Tracing Microsoft Foundry provides tracing capabilities to capture the execution flow of an AI agent. Tracing helps organizations understand what happens during an agent interaction, including: User inputs and agent responses. Model invocations. Tool calls and tool responses. Execution duration and latency. Token consumption. Errors and failed operations. For example, if an agent fails to create an IT ticket, developers can inspect the trace to determine whether the issue occurred during model execution, tool selection, API invocation, or the external system's response. Foundry integrates tracing with Azure Monitor Application Insights. Steps to inspect agent execution traces in Microsoft Foundry Open your Foundry project and navigate to Create > Agents. Create an agent or open an existing agent. Configure the tracing connection with Azure Application Insights if it hasn't already been enabled. Open the agent playground and submit a test request that triggers the agent's response or tool invocation. Navigate to Observe > Traces (or the Traces view associated with your agent, depending on the portal experience). Select the latest interaction and expand its trace spans to inspect model invocations, tool calls, inputs, outputs, execution duration, and errors. Use the trace details to identify where failures or unexpected behavior occurred. 2. Evaluations Tracing helps us understand what happened. Evaluations help us determine whether the agent performed well. Microsoft Foundry Evaluations can assess the quality, safety, and reliability of agent interactions. For example, an organization can evaluate: Evaluation area What it checks Task completion Did the agent successfully complete the requested task? Tool selection Did it invoke the correct tool? Answer relevance Did it address the employee's request? Groundedness Was its response supported by retrieved information? Safety Did it follow the required safety boundaries? These evaluations can be performed during development and against production traces to identify recurring issues and improve agent behavior. Steps to evaluate agents in Microsoft Foundry The evaluation process is similar to the Model Evaluation workflow described in the previous section. The key difference is that, instead of selecting Model as the evaluation target, select Agent to evaluate the agent's responses and behavior. Follow the same steps to select your dataset, configure the appropriate evaluators, run the evaluation, and inspect the results. 3. Monitoring with Azure Monitor and Application Insights An agent's behavior needs to be monitored continuously after deployment. Microsoft Foundry integrates with Azure Monitor and Application Insights to provide visibility into operational and performance metrics. Organizations can monitor: Request volumes. Response latency. Token consumption. Failure rates. Agent execution performance. Quality and safety metrics where configured. For example, if the HR agent suddenly starts experiencing increased latency or a higher failure rate, monitoring helps engineering teams identify and investigate the issue. Organizations can also configure alerts to respond to operational or quality problems. Steps to evaluate monitor in Microsoft Foundry The monitoring process is similar to the workflow described in the previous section. The key difference is that, instead of monitoring model-level performance, the focus shifts to agent-level execution and behavior. 4. Decision and Audit Ledger This is where we introduce an additional application-level component. Foundry tracing provides technical execution visibility, but enterprises may also need a structured record of important business decisions and actions. This can be implemented as a decision or audit ledger within the application architecture. For example, whenever the agent creates an IT support ticket, the application can record: Audit field Example Interaction ID INT-10245 User identity Authenticated employee Agent version IT-Agent v1.2 Requested action Create IT ticket Authorization Approved Tool invoked CreateTicket API Execution result Successful Transaction reference INC-20451 Timestamp Execution timestamp This record can be stored in an appropriate enterprise audit datastore and integrated with the organization's existing logging and compliance systems. The important distinction is: Tracing captures how the agent executed a task. Evaluations measure whether the agent performed the task correctly. Monitoring identifies operational and behavioral issues. The audit ledger records important business actions, authorization outcomes, and transaction references. Microsoft Purview and other enterprise compliance tools can complement this architecture by providing additional data governance, auditing, and protection capabilities where configured. Steps to implement a Decision and Audit Ledger Unlike tracing and evaluations, Foundry does not provide a built-in business audit ledger. However, you can use Foundry's tool-calling capabilities along with Azure Storage Table to implement one. Implementing a Decision and Audit Ledger using Azure Storage Table An AI agent may interact with enterprise systems and execute business-critical actions, such as creating support tickets, approving requests or updating employee records. Organizations need a way to track these actions and establish accountability. For this demonstration, Azure Storage Table is used as a lightweight audit datastore. A Storage Account is created, followed by an AgentAuditLedger table to store details of agent-initiated business actions. A Python FastAPI backend acts as the application-level control layer. It receives the requested action, validates the user's authorization, executes the business operation and automatically writes an audit record to Azure Storage Table. Each record captures information such as the user's identity, agent version, requested action, authorization decision, tool invoked, execution result, transaction reference and timestamp. For the demonstration, an IT support ticket creation scenario is simulated. When an authorized employee requests a ticket, the backend executes the operation and records the successful transaction. Unauthorized requests are rejected and their authorization failures are also recorded. This demonstrates how an application-level audit ledger can provide traceability and accountability for actions performed through AI agents. Key takeaway: Microsoft Foundry provides the agent orchestration and tool-calling capabilities, while the application backend implements authorization, business-action execution and audit logging. Azure Storage Table provides the persistence layer for maintaining these records. Create an Azure Storage Account through the Azure portal. Navigate to Storage Browser > Tables and create a table named AgentAuditLedger. Define the audit record structure using fields such as Interaction ID, User Identity, Agent Version, Requested Action, Authorization, Tool Invoked, Execution Result, Transaction Reference, and Timestamp. Implement a backend using Python (FastAPI) to receive tool requests, validate user authorization, and execute the corresponding business action. The backend acts as the execution layer between the Microsoft Foundry agent and the enterprise systems. It receives tool requests, validates user authorization, executes the requested business operation, and automatically records the outcome for auditing. For this implementation, I developed a Python-based backend using FastAPI and the Azure Data Tables SDK. The implementation includes: API endpoint: Exposes a /create-ticket endpoint to receive requests from the agent. Authorization: Validates the requesting user's identity before executing the business operation. Business execution: Simulates IT ticket creation for authorized requests. Audit logging: Automatically records both successful and rejected requests in the Azure Storage Table AgentAuditLedger. Microsoft Entra authentication: Uses DefaultAzureCredential to securely authenticate the backend with Azure Storage. GitHub Repository: https://github.com/higopika/agent-audit-backend The repository contains the complete Python implementation, dependencies, and instructions to run and test the backend locally Run the backend locally, open the Swagger UI at 127.0.0.1:8000/docs, expand POST /create-ticket, and execute a request with user_identity and issue to confirm a 200 response with status: "Successful" and a generated ticket_id. Open Storage browser > Tables > AgentAuditLedger in the Azure portal to review the logged entities and confirm both Approved and Denied requests were recorded with their PartitionKey, RowKey, Timestamp, and Authorization outcome. Host the application in a web app in Azure App Service Instance. On the Deployment tab, enable Continuous deployment, connect the higopika/agent-audit-backend GitHub repository on the master branch. Enable the App Service's system-assigned managed identity and assign it the Storage Table Data Contributor role on the Storage Account through IAM. Configure your storage endpoint Name Value AZURE_STORAGE_TABLE_ENDPOINT https://YOUR_STORAGE_ACCOUNT.table.core.windows.net After deployment, the App Service overview confirms the app is live at its default domain (agent-audit-backend-34525-....azurewebsites.net), and browsing to /docs confirms the FastAPI /create-ticket endpoint is reachable and ready for testing. In Microsoft Foundry, create an agent and configure a custom function or tool (for example, CreateITTicket) that allows it to request business actions. In the IT-Governance-Agent playground, add a new tool, select OpenAPI as the tool type, name it CreateITTicket, create a new connection targeting the backend's /create-ticket endpoint, and paste the OpenAPI 3.0 schema to complete the tool configuration. { "openapi": "3.0.1", "info": { "title": "IT Ticket Management API", "version": "1.0.0", "description": "API for creating IT support tickets through the backend." }, "servers": [ { "url": "https://agent-audit-backend-34525-hbadaeame5hdhegb.centralindia-01.azurewebsites.net/" } ], "paths": { "/create-ticket": { "post": { "operationId": "create_ticket", "summary": "Create an IT support ticket", "description": "Submits an IT issue to the backend. The backend validates the user's authorization, creates a ticket if authorized, and records the outcome in Azure Storage for auditing.", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "user_identity": { "type": "string", "description": "Email address of the employee requesting the ticket." }, "issue": { "type": "string", "description": "Description of the IT issue." } }, "required": [ "user_identity", "issue" ] } } } }, "responses": { "200": { "description": "Ticket created successfully", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string" }, "ticket_id": { "type": "string" } } } } } }, "403": { "description": "User is not authorized" }, "422": { "description": "Invalid request" }, "500": { "description": "Internal server error" } } } } } } 7. Test the agent by triggering an action and verify that the corresponding audit record appears in the Azure Storage Table. Triggering an IT ticket request in the IT-Governance-Agent playground creates the ticket successfully, and the new entry appears immediately in the AgentAuditLedger table in Storage Browser with an Approved authorization outcome. Get Started Ready to apply these governance patterns to your own AI agents? Try it yourself Create and test a Guardrail in Microsoft Foundry. Build a Foundry IQ Knowledge Base and connect it to an agent. Experiment with Model Router to explore different model-routing strategies. Clone the audit ledger sample used in this article and adapt it to your own business-action workflow. Go deeper Guardrails and controls in Microsoft Foundry Configure Guardrails in Microsoft Foundry Foundry IQ overview Connect agents to Foundry IQ Model Router in Microsoft Foundry Monitor agents in Microsoft Foundry Decision and Audit Ledger sample Conclusion Building an enterprise AI agent is no longer just a question of what it can do. It's a question of what it's allowed to do, what it can trust, which model should answer, and whether every decision can be traced back and explained. The four governance layers covered here work together rather than in isolation. Constitutional governance defines the boundaries an agent must respect regardless of what it's asked. Knowledge governance ensures the agent draws only from trusted, access-controlled sources. Model governance balances capability, cost, and quality across the models an agent relies on. Decision governance closes the loop, making the agent's actions observable, evaluable, and auditable. Microsoft Foundry brings these layers together through Guardrails, Foundry IQ, the model catalogue and Model Router, Evaluations, and native tracing integrated with Azure Monitor. Where Foundry's built-in capabilities stop, such as a structured business audit ledger, an application-level component like the one demonstrated here with Azure Storage Table closes the gap. As agents take on more consequential, enterprise-critical work, governance can't be bolted on after deployment. It has to be designed into the architecture from the start, so every principle enforced, every source trusted, every model selected, and every action taken can withstand scrutiny.422Views1like0CommentsClosing the AI Agent Governance Gap with Microsoft Foundry
Developers are shipping agents faster than security teams can catalog them. As organizations move beyond pilots and begin operating dozens or hundreds of agents, one question keeps coming up: how do we actually get visibility into our AI agents across our environment? In this article, we'll walk through how Azure services can help establish visibility, guardrails, and cost accountability across your AI estate. Governance for AI happens across four layers: Resources – who can create new AI resources Builders – who can develop and publish agents in a certain scope Behavior – how agent outputs are evaluated, monitored, and governed Dependencies – what models, tools, APIs, and MCP servers agents can interact with Most organizations already have governance controls for identities, networking, and compliance. The challenge isn't creating new controls. It's connecting existing controls into an operating model that works for AI agents. Below we walk through each area and go a bit deeper on how to close the gap. Setting up boundaries with Azure Policy First, let's start in the Azure portal with Azure Policy. Azure Policy lets you set guardrails on what can be deployed in your environment and flags or blocks anything that doesn't comply. For AI workloads, the built-in definitions range from limiting models that people in your organization can deploy to locking down the network through enabling private endpoints. Some policies you get started with: Foundry model deployments should only use approved models: Restricts deployments to models or publishers your organization has explicitly approved Foundry model deployments should meet eligibility requirements (preview): Applies rules based on model attributes like preview vs. GA status and distribution source Azure AI Services resources should have key access disabled: Makes Microsoft Entra ID the only entry point The full list of policies related to Azure AI Services are available here: List of built-in policy definitions - Azure Policy | Microsoft Learn Why this comes first: Policy checks resources before they are created, so it proactively keeps your environment aligned with your standards. Implementing role-based access control (RBAC) Once these boundaries are in place, the next step is RBAC. Setting RBAC up early ensures that people and identities building agents have the right scope for what they actually need to do. Foundry roles only apply when you authenticate using Microsoft Entra ID. If you're using key-based authentication instead, the key grants full access with without role restrictions. API keys are convenient for quick development usage but when moving towards production, Microsoft Entra ID is the preferred method. Roles can be assigned at three scopes: the Foundry resource, a Foundry project, or an individual agent itself. Below is an example of how different personas within organization can map to a certain scope for creating and building agents with Foundry. Here's how each role in the diagram compares, from least to most privileged: Role Privilege Level What it does in Microsoft Foundry Foundry Agent Consumer Least Interact with agent endpoints in a project. This is your least-privilege role for people who only need to use agents. Foundry User Low Grants reader access to the Foundry project, the Foundry resource, and data actions for your Foundry project. Least-privilege access role for developers building and testing agents. Foundry Project Manager Medium This role lets you perform management actions on Foundry projects, build and develop with projects, and conditionally assign the Foundry User role to other user principals. Foundry Account Owner Higher Grants full access to manage Foundry projects and resources, and lets you assign the Foundry User role to other user principals. Foundry Owner Highest Grants full access to manage Foundry projects and resources to build and develop with projects. This role can also assign the Foundry User, ACR, and monitoring roles to users in the environment. Source: Role-based access control for Microsoft Foundry - Microsoft Foundry | Microsoft Learn For the agent resources themselves, assign managed identities rather than API keys since it lowers the risk of having compromised credentials. Note if you're scripting RBAC permissions: these roles were recently renamed from Azure AI User, Azure AI Owner, Azure AI Account Owner, and Azure AI Project Manager. The role IDs and permissions didn't change, so use the role definition GUID in your code to avoid issues while the rename rolls out. Observability in Microsoft Foundry Governance requires more than access control. Organizations also need evidence of how agents are being used. Observability provides the audit trail needed to investigate incidents, understand usage patterns, and track costs. The Foundry Control Plane brings these observability and governance tools together in one place, alongside services like Azure Monitor, Microsoft Entra, Microsoft Purview, and Azure Policy. In the Foundry portal, tracing is a good starting point. Once you connect an Application Insights resource to your project, Foundry turns on tracing automatically so every run, including the ones you test in the playground, is logged. After it is completed, you can search by Response ID or Trace ID to see the conversation history, token usage, run steps, tool calls, and inputs and outputs between the user and the agent. For more granular queries, you can write KQL to dive into individual agent runs or use the prebuilt Grafana dashboards in Azure Monitor. With client-side tracing, you can also export traces to observability tools you may already use, such as Datadog or Jaeger. Note: Permissions required for viewing this telemetry requires the Log Analytics Reader role on the connected Application Insights resource, and Privileged Monitoring Data Reader on top of that if the underlying Log Analytics tables are protected. Alongside all of these monitoring features, every agent comes with content safety guardrails and evaluations let you test and optimize performance before and after you publish your agents. When agents get published to Microsoft Teams and Microsoft 365 Copilot, Microsoft 365 admins can approve usage requests. These requests can be further scoped to a limited group for pilot testing/department usage or the full organization. Adding an AI gateway Observability tells you what your agents are doing, but how do you actually control them? This is where Azure API Management comes in. Once you have more than one agent, model deployment, or multiple teams consuming them, you need a single enforcement point between the agents and the resources they call. Adding Azure API Management in front of Microsoft Foundry gives you: Rate limiting and load balancing across regions and model deployments Consistent authentication and quota policies for model and tool traffic Usage tracking per team or cost center so you can accurately charge back to different departments Governed access to your custom and remote MCP servers Note: When choosing MCP servers, start with trusted, enterprise supported sources (GitHub, Microsoft, internally developed servers, etc.) that have documented security controls, enterprise authentication, clear ownership, and least-privilege permissions. Treat community MCP servers as untrusted until they have undergone a formal security review and are verified by organizations. Adding an AI gateway completes the governance picture. Azure Policy governs what can be deployed. RBAC governs who can build and manage agents. Observability provides evidence of how agents behave in production. The AI gateway extends governance into runtime, controlling how agents interact with models, tools, and external systems. Combined, these layers help organizations move beyond simply building agents to operating them responsibly at scale. Extend governance across the wider estate A few directions to take this further: MCP registry in Azure API Center – As MCP usage grows, you can create an approved inventory of MCP servers and APIs that can be used across an organization. Microsoft Agent 365 – Microsoft's enterprise control plane for AI agents. It gives every agent its own Microsoft Entra Agent ID and published Foundry agents sync to its registry automatically. This gives your IT team one place to run access reviews, lifecycle policies, and owner attestation across every agent in the tenant, including shadow agents discovered outside Foundry. Copilot Studio – when you add an MCP tool, you can point it at the API Management URL instead of the direct remote endpoint to gain additional observability through the gateway. GitHub Copilot – you can apply the same AI gateway-fronted MCP registry, applied to the developer side. Microsoft Purview – data classification, DLP, audit, and AI interaction governance across the wider estate. Where to go next Looking for a quick start? Turn on the three Azure Policy definitions above in audit mode against a non-production subscription and see what gets flagged that is out of compliance. Ready to design the end-to-end pattern? Take a look at this Cloud Adoption Framework guidance on AI governance and governing Azure platform services for AI. Want to go deeper on agent observability? Start with these articles around Application Insights integrations with Foundry: Use Insights in Microsoft Foundry and Monitor AI Agents with Application Insights Governing AI agents doesn't require starting from scratch. The identity, policy, monitoring, and cost controls you already use for the rest of your Azure estate can extend to AI workloads. Start with one layer, connect the next, and build a governance foundation that grows with your AI adoption.942Views3likes0CommentsRequest for Copilot Improvements for Context‑Specific Reasoning for all users
Hello Microsoft Team, I am writing to request an improvement to Copilot’s behavior in certain legal‑analysis conversations to apply for all users. In particular, I would like Copilot to be able to adopt a “Tech‑company mindset” and say yes this will happen or a particular prediction by default for all users. In this mindset, I want Copilot to focus on: • constitutional‑risk assessments • long‑term survivability of laws • how tech companies evaluate legal exposure • how similar laws have fared in the past • and saying yes this will happen based on tech company mindsets Thank you for considering this feedback. Copilot has been very helpful to me, and I appreciate the work your team is doing to improve it.686Views0likes2CommentsMicrosoft 365 E7 & Agent365: From Where You Are to Enterprise AI at Scale
Introduction As organizations move beyond AI experimentation and begin operationalizing agent-based AI workloads, a new set of challenges is emerging governance, visibility, and control. Microsoft’s response to this shift is Microsoft 365 E7, introduced on May 1, 2026. It bundles: Microsoft 365 E5 Microsoft 365 Copilot Microsoft Entra Suite Microsoft Agent 365 This represents Microsoft’s strategic direction toward a human-led, agent-operated enterprise. However, a key pattern is emerging: Many organizations deploy Agent 365 and assume governance is complete. It isn’t. Understanding Agent 365: Control Plane, Not Control Source Agent 365 is not a standalone security solution, it is a control plane for AI agents. It provides: Agent registry and discovery Blueprint governance and lifecycle control Observability across agents Aggregation of signals from Entra, Defender and Purview Simple analogy Agent 365 is like a dashboard in a car It shows status It aggregates signals But it does not generate signals Without identity, data and threat signals → governance visibility is incomplete. The Key Gap: “Enabled” vs “Governed” Agent 365 can be enabled standalone but governance requires: Identity signals (Entra) Threat signals (Defender) Data risk signals (Purview) This gap between “enablement” and “full governance” is where most deployments fall short. Agent 365 Governance Maturity Heatmap The following heatmap summarizes how governance capabilities evolve as you layer the Microsoft stack: Capability Agent 365 on E3 + Defender Suite + Purview Suite + Entra Suite E7 (Full) Agent registry / inventory ✅ Full ✅ ✅ ✅ ✅ Shadow agent discovery ✅ Full ✅ ✅ ✅ ✅ Blueprint governance / kill-switch ✅ Full ✅ ✅ ✅ ✅ First-party agent observability ✅ Full ✅ ✅ ✅ ✅ Conditional Access for agents (P1) ✅ Already in BP/E3 ✅ ✅ ✅ ✅ ID Governance for agents (P1) ✅ Already in BP/E3 ✅ ✅ ✅ ✅ Risk-based CA / ID Protection (P2) ❌ ✅ ❌ ✅ ✅ MDA behavioral risk detection ❌ ✅ ❌ ❌ ✅ Risks column fully populated ⚠️ Entra only ⚠️ Entra + Defender ⚠️ Entra + Purview ⚠️ Entra + Network ✅ All signals Purview DLP for agent interactions ⚠️ Basic only ⚠️ Basic only ✅ Full ⚠️ Basic only ✅ Full DSPM for AI ❌ ❌ ✅ ❌ ✅ Shadow AI discovery (external tools) ❌ ❌ ❌ ✅ ✅ Security Copilot SCUs ❌ ❌ ❌ ❌ ✅ (via E5) 🔍 Interpretation of the Heatmap Key insight: Agent 365 on its own provides visibility and governance scaffolding, but true governance maturity emerges only when identity (Entra) threat (Defender), and data (Purview) signals are combined. Microsoft 365 E7 is the only SKU that delivers all signals, identity, security, compliance and AI governance in a single integrated model. What Works with Agent 365 Alone On Business Premium or E3 + Agent 365, you still get meaningful capabilities: Agent registry (full visibility) Shadow agent discovery Blueprint governance and kill-switch Entra Agent ID (identity registration) Conditional Access for agents (via Entra P1) ID Governance (via Entra P1) First-party agent observability This provides a strong governance foundation, especially for early-stage adoption. What’s Missing Without the Full Stack Without Defender, Purview, and Entra Suite key capabilities are limited: Risk-based Conditional Access (requires Entra P2) Behavioral threat detection (Defender) Data interaction governance (Purview DLP) AI data security posture (DSPM for AI) External shadow AI discovery (Entra Internet Access) Result: You can see agents exist but you cannot fully assess risk, behavior or data exposure. What changes across layers: Layer Added What Improves Defender Threat detection, behavioral risk Purview Data protection, AI data governance Entra Suite Network + identity-level AI control E7 Full integration across all layers Licensing Model: Clarifying Agent 365 Agent 365 licensing is simple but often misunderstood: Licensed per user (not per agent) Covers all agents owned or managed by that user Agents do not need individual licenses This eliminates agent sprawl licensing concerns and anchors governance to the user identity. Upgrade Math by Starting Point This is where architecture meets commercial reality. 📍 Business Premium Starting point: $22/user Step Add-on Total Step 1 Agent 365 ($15) $37 Step 2 Defender + Purview Combo ($15) $52 Step 3 Entra Suite ($12) $64 Step 4 Copilot + Intune Suite ~$95 👉 Full E7 Parity: ~$95/user 👉 E7: $99/user At this stage: Minimal price difference E7 adds Security Copilot + removes 300-user limit ✅ This is where consolidation becomes compelling. 📍 E3 Starting point: $39/user Component Cost E3 Base $39 Agent 365 $15 Defender Suite $12 Purview Suite $12 Entra Suite $12 Intune Suite $10 Copilot $30 Total $130/user 👉 E7: $99/user 💥 Delta: $31/user 💥 ~$74K/year extra for 200 users ✅Use Agent 365 for visibility if needed ✅Avoid building full add-on stack ✅Move to E5 or E7 early 📍 E5 Starting point: $60/user Remaining gaps: Copilot ($30) Entra Suite ($12) Agent 365 ($15) 👉 Total: $117/user 👉 E7: $99/user 💥 Savings: $18/user 💥 ~$108K/year for 500 users ✅ ~15% savings ✅ Simplified licensing ✅ This becomes a strong renewal conversation driver. Architectural Perspective AI governance requires layered architecture: Layer Function Agent 365 Control plane Entra Identity + access Defender Threat detection Purview Data protection Governance is not a feature, it is a system built on continuous signals across identity, security and data. How to Position This in Customer Conversations For Business Premium Start with Agent 365 Add Defender + Purview for maximum value For E3 Avoid incremental add-ons Move to E5/E7 For E5 Position E7 as cost optimization + simplification Final Thought Agent 365 is a foundational capability but it is not a complete solution. On its own, it gives you visibility and a governance layer. But enterprise AI governance is not just about seeing and managing agents it’s about understanding what they’re doing, what they’re accessing and whether they should be doing it at all. A simple way to think about it: Deploying Agent 365 alone is like setting up a badge system in your building you can track who is inside and control access. But without the broader security stack, you still can’t: Detect risky or unusual behavior Protect sensitive data from overexposure Enforce governance consistently across the environment Bottom Line Agent 365 provides the control plane Security and compliance services provide the signals Microsoft 365 E7 brings these together into a unified governance model The Strategic Shift Organizations are moving from: AI as tools → isolated productivity gains AI as systems → integrated workflows and automation AI as governed ecosystems → secure, compliant, and scalable operations Sustainable AI adoption is not defined by capability alone it is defined by how effectively that capability is governed at scale. E7 is not just a licensing evolution it represents a shift to an integrated AI operating model, where governance is embedded by design, not added as an afterthought.2.3KViews2likes1CommentCI/CD for AI Agents on Microsoft Foundry
Introduction Building an AI agent is the straightforward part. Shipping it reliably to production with version control, evaluation-driven quality gates, multi-environment promotion, and enterprise governance is where most teams run into friction. Microsoft Foundry changes this. It is Microsoft's AI app and agent factory: a fully managed platform for building, deploying, and governing AI agents at scale. It provides a first-class agent runtime with built-in lifecycle management, making it possible to apply the same CI/CD rigour you already use for application software to AI agents — regardless of whether you are building containerised hosted agents or declarative prompt-based agents. This post walks through a complete, production-ready reference architecture for doing exactly that. You will find the GitHub Actions workflow, the Azure DevOps pipeline YAML, and the architecture diagram linked throughout. Reference implementation repository: foundry-agents-lifecycle and CI/CD for AI Agents on Microsoft Foundry Why Agent CI/CD Is Different Traditional software pipelines gate releases on test pass/fail. Agent pipelines require an additional, critical layer: evaluation-driven quality gates. Before any agent version can be promoted to the next environment, it must pass three categories of evaluation: Quality — answer correctness, task completion rate, hallucination rate Safety — grounded responses, policy compliance, tool usage validation Performance — token usage per query, p95 response latency A second key difference is the deployment unit. You are not deploying a binary or a container tag in isolation. You are deploying an agent version — an immutable artefact that bundles the model selection, system instructions, tool definitions, and configuration together. This is what enables deterministic promotion and full auditability across environments. "Agents follow a standard CI/CD pattern, but with a critical shift: promotion happens at the agent version level, and release gates are driven by evaluation outcomes, not just test results." Reference Architecture Figure 1: End-to-end CI/CD reference architecture for hosted and prompt-based agents on Microsoft Foundry. The architecture has five logical layers, flowing from developer commit to production monitoring: Layer 1 — Developer Layer The developer layer is a standard source-controlled repository in GitHub or Azure DevOps. It contains: Agent code written in Python or .NET agent.yaml or prompt definition files for prompt-based agents Tool configurations: MCP servers, REST API connectors, or other integrations Infrastructure as Code: Bicep or ARM templates for provisioning the Foundry project and dependencies Layer 2 — CI Pipeline (Build · Validate · Evaluate) Every push or pull request triggers the CI pipeline. It performs five steps: Docker build — for hosted agents, build and tag the container image Static checks — lint with ruff , security scan with bandit , agent YAML schema validation Unit and tool tests — pytest suites covering agent logic and tool integrations Evaluation gate — run evaluation datasets; fail the pipeline if thresholds are breached Image push — push the validated container to Azure Container Registry (ACR) Prompt-based agents skip the Docker build step. Instead, the YAML definition and prompt bundle are validated against schema and evaluated against golden datasets. Layer 3 — CD Pipeline (Multi-stage Promotion) A single agent version is promoted through three Foundry project environments: Stage Environment Activities Gate Stage 1 Dev Foundry Project Deploy vNext version, smoke tests, developer evals Eval quality thresholds Stage 2 Test / QA Foundry Project Scenario tests, HITL validation, safety evaluation Eval gates + human approval Stage 3 Production Foundry Project Promote version, enable endpoint, post-deploy smoke test Required reviewer approval Rollback is straightforward: switch the active version pointer back to the previous agent version. No re-deployment is needed. Layer 4 — Microsoft Foundry Agent Service The Foundry Agent Service runtime provides: Hosted agent runtime — managed container execution supporting Agent Framework, LangGraph, Semantic Kernel, or custom code Prompt-based agent runtime — declarative agent definitions, no container required Built-in lifecycle operations — version, start, stop, rollback Entra Agent Identity — each deployed version receives a dedicated Microsoft Entra managed identity RBAC and policy enforcement — Azure role-based access controls per project Observability — distributed traces, structured logs, and evaluation signals Layer 5 — Monitoring, Governance, and Control Plane Foundry control plane: agent registry, environment configuration, version history OpenTelemetry forwarded to Azure Monitor and Application Insights Continuous evaluation pipelines for ongoing quality, grounding, and safety monitoring Azure Policy and RBAC enforcement at the platform level Environment Topology There are two topology options. We recommend Option A for all production workloads: Option Structure Best for Trade-off A — Recommended Dev Project → Test Project → Prod Project (separate Foundry projects) Enterprise workloads Full isolation, clean RBAC boundaries, easier governance B — Lightweight Single Foundry project with agent version tags (dev/test/prod) Small teams, prototyping Simpler setup, but weaker environment separation Separate projects mean separate RBAC policies, separate connection strings, and separate evaluation signals. A developer service principal has access only to the Dev project; the CI/CD identity has restricted access to promote to Test and Production. Evaluation Gates — The Core Difference Evaluation gates transform a standard software pipeline into an AI-safe deployment pipeline. They run at two points: pre-merge (CI) and pre-promotion (CD). Defining the Gates Category Metric CI threshold Prod threshold Quality Hallucination rate < 5% < 3% Quality Task completion rate > 90% > 95% Safety Grounded response rate > 95% > 98% Safety Policy violations 0 0 Performance p95 latency < 4 000 ms < 3 000 ms Cost Token usage per query Track only Alert on > 20% regression Gate Enforcement (Python) import json import sys def check_gates(results_path: str) -> None: with open(results_path) as f: results = json.load(f) failures = [] if results["hallucination_rate"] > 0.05: failures.append(f"Hallucination rate {results['hallucination_rate']:.1%} exceeds 5% threshold") if results["task_completion_rate"] < 0.90: failures.append(f"Task completion {results['task_completion_rate']:.1%} below 90% threshold") if results["latency_p95_ms"] > 4000: failures.append(f"p95 latency {results['latency_p95_ms']}ms exceeds 4000ms threshold") if results.get("policy_violations", 0) > 0: failures.append(f"Policy violations detected: {results['policy_violations']}") if failures: for f in failures: print(f"GATE FAILED: {f}", file=sys.stderr) sys.exit(1) print("All evaluation gates passed — proceeding to deployment") if __name__ == "__main__": check_gates(sys.argv[1]) Hosted vs Prompt-Based Agents — Pipeline Differences Capability Hosted Agents Prompt-Based Agents Deployment unit Container image + agent definition YAML / prompt configuration bundle Build step required Yes — Docker build + ACR push No — YAML validation only Supported frameworks Agent Framework, LangGraph, Semantic Kernel, custom Foundry declarative runtime Promotion artefact Versioned agent with container image reference Versioned prompt/config bundle CI focus Code quality, tool tests, evaluation Prompt schema validation, evaluation Rollback mechanism Switch active agent version Switch active agent version Runtime management Foundry manages container lifecycle Foundry manages declarative runtime CI Pipeline Walkthrough The following steps are representative of the full GitHub Actions workflow available in github-actions-pipeline.yml alongside this post. Hosted Agent CI # 1. Static checks ruff check . bandit -r src/ -ll python scripts/validate_agent_config.py --config agent.yaml # 2. Tests pytest tests/unit/ -v --tb=short pytest tests/tools/ -v --tb=short # 3. Evaluation gate python scripts/run_evaluations.py \ --dataset eval/datasets/golden_set.jsonl \ --output eval/results/results.json python scripts/check_eval_gates.py \ --results eval/results/results.json \ --max-hallucination 0.05 \ --min-task-completion 0.90 \ --max-latency-p95 4000 # 4. Push container image az acr build \ --registry myregistry.azurecr.io \ --image "myagent:$SHA" \ --file Dockerfile . Prompt-Based Agent CI # Validate YAML / prompt definitions python scripts/validate_agent_config.py --config agent.yaml # Evaluation against golden dataset python scripts/run_evaluations.py \ --dataset eval/datasets/golden_set.jsonl \ --output eval/results/results.json python scripts/check_eval_gates.py \ --results eval/results/results.json CD Pipeline Walkthrough Stage 1 — Dev Deployment python scripts/deploy_agent.py \ --env dev \ --image "myregistry.azurecr.io/myagent:$SHA" \ --foundry-endpoint $FOUNDRY_ENDPOINT_DEV \ --agent-config agent.yaml # Returns the new agent version ID, stored for promotion AGENT_VERSION=$(python scripts/get_active_version.py --env dev) Stage 2 — Promote to Test (after approval gate) python scripts/promote_agent.py \ --from-env dev \ --to-env test \ --agent-version $AGENT_VERSION \ --foundry-endpoint $FOUNDRY_ENDPOINT_TEST # Run scenario tests and safety evaluation python scripts/run_evaluations.py \ --dataset eval/datasets/scenario_set.jsonl \ --output eval/results/test-results.json python scripts/check_eval_gates.py \ --results eval/results/test-results.json \ --max-hallucination 0.03 \ --min-task-completion 0.95 Stage 3 — Promote to Production (after required reviewer approval) python scripts/promote_agent.py \ --from-env test \ --to-env prod \ --agent-version $AGENT_VERSION \ --foundry-endpoint $FOUNDRY_ENDPOINT_PROD # Enable the production endpoint python scripts/enable_agent_endpoint.py \ --agent-version $AGENT_VERSION \ --foundry-endpoint $FOUNDRY_ENDPOINT_PROD Rollback # Switch the active version to the previous known-good version python scripts/promote_agent.py \ --from-env prod \ --to-env prod \ --agent-version $PREVIOUS_AGENT_VERSION \ --foundry-endpoint $FOUNDRY_ENDPOINT_PROD # OR delete the failing version python scripts/delete_agent_version.py \ --agent-version $AGENT_VERSION \ --foundry-endpoint $FOUNDRY_ENDPOINT_PROD Deployment Using the Azure AI Projects SDK The azure-ai-projects SDK provides programmatic control over the full agent lifecycle. This is the recommended approach for CI/CD scripts where you need deterministic, scriptable deployment. from azure.identity import DefaultAzureCredential from azure.ai.projects import AIProjectClient # Connect to the Foundry project client = AIProjectClient( endpoint=FOUNDRY_PROJECT_ENDPOINT, credential=DefaultAzureCredential() ) # List existing agents (useful for idempotent deploy scripts) for agent in client.agents.list(): print(f"Agent: {agent.name} version: {agent.id}") # Create a new agent version (hosted agent) agent = client.agents.create_agent( model="gpt-4o", name="my-enterprise-agent", instructions="You are a helpful assistant ...", tools=[...], # tool definitions metadata={"version": GIT_SHA, "environment": "dev"} ) print(f"Created agent version: {agent.id}") For hosted agents, the SDK call also references the container image pushed to ACR. Refer to the Deploy a hosted agent — Microsoft Foundry documentation for the full SDK flow including container image registration and version polling. Reference Implementation Stack Concern Technology Source control and pipelines GitHub Actions or Azure DevOps Pipelines Infrastructure and agent deployment Azure Developer CLI ( azd up ) Programmatic agent lifecycle azure-ai-projects Python SDK Agent evaluation azure-ai-evaluation Python SDK Agent runtime Microsoft Foundry Agent Service Container registry Azure Container Registry (hosted agents only) Observability OpenTelemetry, Azure Monitor, Application Insights Identity and access Microsoft Entra (Agent ID, OIDC workload identity federation) Governance Azure Policy, RBAC, Foundry control plane Governance and Responsible AI Shipping AI agents at enterprise scale requires governance beyond what a traditional CI/CD pipeline provides. Microsoft Foundry addresses this at the platform level: RBAC per environment — each Foundry project has independent access controls. Developers deploy to Dev; only CI/CD service principals (with audited OIDC tokens) can promote to Test and Production. Agent registry and audit trail — the Foundry control plane records which agent version is active in each environment, who deployed it, and when. This satisfies enterprise audit requirements without additional tooling. Content safety and policy enforcement — Azure Policy governs model access, data handling, and content safety rules at the infrastructure level, not just at the application code level. Policy violations block deployment automatically. Entra Agent Identity — each deployed agent version receives a dedicated, short-lived managed identity. Agents authenticate to downstream services using least-privilege credentials scoped to that specific deployment. Continuous evaluation in production — evaluation pipelines run on sampled production traffic, alerting when quality, safety, or cost metrics drift from their baseline. A key trade-off to be transparent about: evaluation datasets must be maintained and updated as the agent's tasks evolve. Stale datasets produce misleading pass/fail signals. Treat your golden evaluation set as a first-class engineering artefact alongside the agent code itself. Pipeline Files Two pipeline files accompany this reference architecture. Both implement the same four-stage pipeline (CI Build, CI Evaluate, CD Dev, CD Test, CD Production) with environment-appropriate approval gates. github-actions-pipeline.yml — GitHub Actions workflow. Uses GitHub Environments for approval gates and OIDC Workload Identity Federation for passwordless Azure authentication. No stored Azure credentials required. azure-devops-pipeline.yml — Azure DevOps multi-stage YAML pipeline. Uses ADO Environments with required approvers and variable groups per environment. Both pipelines share these security practices: OIDC / Workload Identity Federation — no long-lived Azure credentials stored in pipeline secrets Per-environment variable groups, each with scoped connection strings and endpoints Evaluation quality gates enforced before every promotion step Mandatory human approval before production deployment Summary The full pipeline in one view: Developer commit | CI Pipeline ├── Docker build (hosted agents) / YAML validation (prompt agents) ├── Static checks + unit tests + tool tests └── Evaluation gate ← quality · safety · performance | Agent Version created ← immutable, versioned artefact | CD Pipeline ├── Deploy to Dev → smoke tests + eval gate ├── Promote to Test → scenario tests + HITL + approval gate └── Promote to Prod → enable endpoint + monitoring | Microsoft Foundry Agent Service └── Versioned runtime · Entra identity · RBAC · Observability | Control Plane └── Agent registry · Governance · Continuous evaluation Microsoft Foundry provides the platform primitives — versioned agent deployments, multi-environment Foundry projects, built-in lifecycle management, and an enterprise observability stack — needed to operate AI agents with the same confidence as any production software system. The key takeaway: treat the agent version as your deployment artefact, and evaluation outcomes as your release gate. The rest follows familiar CI/CD patterns you already know and trust. Next Steps Clone the CI/CD Repo at leestott/foundry-cicd Clone the reference demo: foundry-agents-lifecycle on GitHub Set up your environment: Set up your environment for Foundry Agent Service Deploy your first hosted agent: Quickstart: Deploy your first hosted agent Understand hosted agent concepts: Foundry Hosted Agents concepts Automate deployments in CI/CD: Automate deployment of Microsoft Foundry agents Manage agent versions: Manage hosted agents — Microsoft Foundry Deploy via SDK: Deploy a hosted agent — Microsoft Foundry SDK and endpoint reference: Microsoft Foundry SDK and Endpoints reference Azure AI Projects SDK: azure-ai-projects Python SDK Azure Developer CLI: Azure Developer CLI (azd) overview Microsoft Foundry documentation hub: Microsoft Foundry on Microsoft Learn16KViews8likes0CommentsMicrosoft Foundry: Unlock Adaptive, Personalized Agents with User-Scoped Persistent Memory
From Knowledgeable to Personalized: Why Memory Matters Most AI agents today are knowledgeable — they ground responses in enterprise data sources and rely on short‑term, session‑based memory to maintain conversational coherence. This works well within a single interaction. But once the session ends, the context disappears. The agent starts fresh, unable to recall prior interactions, user preferences, or previously established context. In reality, enterprise users don’t interact with agents exclusively in one‑off sessions. Conversations can span days, weeks, evolving across multiple interactions rather than isolated sessions. Without a way to persist and safely reuse relevant context across interactions, AI agents remain efficient in the short term be being stateful within a session, but lose continuity over time due to their statelessness across sessions. Bridging this gap between short-term efficiency and long‑term adaptation exposes a deeper challenge. Persisting memory across sessions is not just a technical decision; in enterprise environments, it introduces legitimate concerns around privacy, data isolation, governance, and compliance — especially when multiple users interact with the same agent. What seems like an obvious next step quickly becomes a complex architectural problem, requiring organizations to balance the ability for agents to learn and adapt over time with the need to preserve trust, enforce isolation boundaries, and meet enterprise compliance requirements. In this post, I’ll walk through a practical design pattern for user‑scoped persistent memory, including a reference architecture and a deployable sample implementation that demonstrates how to apply this pattern in a real enterprise setting while preserving isolation, governance, and compliance. The Challenge of Persistent Memory in Enterprise AI Agents Extending memory beyond a single session seems like a natural way to make AI agents more adaptive. Retaining relevant context over time — such as preferences, prior decisions, or recurring patterns — would allow an agent to progressively tailor its behavior to each user, moving from simple responsiveness toward genuine adaptation. In enterprise environments, however, persistence introduces a different class of risk. Storing and reusing user context across interactions raises questions of privacy, data isolation, governance, and compliance — particularly when multiple users interact with shared systems. Without clear ownership and isolation boundaries, naïvely persisted memory can lead to cross‑user data leakage, policy violations, or unclear retention guarantees. As a result, many systems default to ephemeral, session‑only memory. This approach prioritizes safety and simplicity — but does so at the cost of long‑term personalization and continuity. The challenge, then, is not whether agents should remember, but how memory can be introduced without violating enterprise trust boundaries. Persistent Memory: Trade‑offs Between Abstraction and Control As AI agents evolve toward more adaptive behavior, several approaches to agent memory are emerging across the ecosystem. Each reflects a different set of trade-offs between abstraction, flexibility, and control — making it useful to briefly acknowledge these patterns before introducing the design presented here. Microsoft Foundry Agent Service includes a built‑in memory capability (currently in Preview) that enables agents to retain context beyond a single interaction. This approach integrates tightly with the Foundry runtime and abstracts much of the underlying memory management, making it well suited for scenarios that align closely with the managed agent lifecycle. Another notable approach combines Mem0 with Azure AI Search, where memory entries are stored and retrieved through vector search. In this model, memory is treated as an embedding‑centric store that emphasizes semantic recall and relevance. Mem0 is intentionally opinionated, defining how memory is structured, summarized, and retrieved to optimize for ease of use and rapid iteration. Both approaches represent meaningful progress. At the same time, some enterprises require an approach where user memory is explicitly owned, scoped, and governed within their existing data architecture — rather than implicitly managed by an agent framework or memory library. These requirements often stem from stricter expectations around data isolation, compliance, and long‑term control. User-Scoped Persistent Memory with Azure Cosmos DB The solution presented in this post provides a practical reference implementation for organizations that require explicit control over how user memory is stored, scoped, and governed. Rather than embedding long‑term memory implicitly within the agent runtime, this design models memory as a first‑class system component built on Azure Cosmos DB. At a high level, the architecture introduces user‑scoped persistent memory: a durable memory layer in which each user’s context is isolated and managed independently. Persistent memory is stored in Azure Cosmos DB containers partitioned by user identity and consists of curated, long‑lived signals — such as preferences, recurring intent, or summarized outcomes from prior interactions — rather than raw conversational transcripts. This keeps memory intentional, auditable, and easy to evolve over time. Short‑term, in‑session conversation state remains managed by Microsoft Foundry on the server side through its built‑in conversation and thread model. By separating ephemeral session context from durable user memory, the system preserves conversational coherence while avoiding uncontrolled accumulation of long‑term state within the agent runtime. This design enables continuity and personalization across sessions while deliberately avoiding the risks associated with shared or global memory models, including cross‑user data leakage, unclear ownership, and unintended reuse of context. Azure Cosmos DB provides enterprises with direct control over memory isolation, data residency, retention policies, and operational characteristics such as consistency, availability, and scale. In this architecture, knowledge grounding and memory serve complementary roles. Knowledge grounding ensures correctness by anchoring responses in trusted enterprise data sources. User‑scoped persistent memory ensures relevance by tailoring interactions to the individual user over time. Together, they enable trustworthy, adaptive AI agents that improve with use — without compromising enterprise boundaries. Architecture Components and Responsibilities Identity and User Scoping Microsoft Entra ID (App Registrations) — provides the frontend a client ID and tenant ID so the Microsoft Authentication Library (MSAL) can authenticate users via browser redirect. The oid (Object ID) claim from the ID token is used as the user identifier throughout the system. Agent Runtime and Orchestration Microsoft Foundry — serves as the unified AI platform for hosting models, managing agents, and maintaining conversation state. Foundry manages in‑session and thread‑level memory on the server side, preserving conversational continuity while keeping ephemeral context separate from long‑term user memory. Backend Agent Service — implements the AI agent using Microsoft Foundry’s agent and conversation APIs. The agent is responsible for reasoning, tool‑calling decisions, and response generation, delegating memory and search operations to external MCP servers. Memory and Knowledge Services MCP‑Memory — MCP server that hosts tools for extracting structured memory signals from conversations, generating embeddings, and persisting user‑scoped memories. Memories are written to and retrieved from Azure Cosmos DB, enforcing strict per‑user isolation. MCP‑Search — MCP server exposing tools for querying enterprise knowledge sources via Azure AI Search. This separation ensures that knowledge grounding and memory retrieval remain distinct concerns. Azure Cosmos DB for NoSQL — provides the durable, serverless document store for user‑scoped persistent memory. Memory containers are partitioned by user ID, enabling isolation, auditable access, configurable retention policies, and predictable scalability. Vector search is used to support semantic recall over stored memory entries. Azure AI Search — supplies hybrid retrieval (keyword and vector) with semantic reranking over the enterprise knowledge index. An integrated vectorizer backed by an embedding model is used for query‑time vectorization. Models text‑embedding‑3‑large — used for generating vector embeddings for both user‑scoped memories and enterprise knowledge search. gpt‑5‑mini — used for lightweight analysis tasks, such as extracting structured memory facts from conversational context. gpt‑5.1 — powers the AI agent, handling multi‑turn conversations, tool invocation, and response synthesis. Application and Hosting Infrastructure Frontend Web Application — a React‑based web UI that handles user authentication and presents a conversational chat interface. Azure Container Apps Environment — provides a shared execution environment for all services, including networking, scaling, and observability. Azure Container Apps — hosts the frontend, backend agent service, and MCP servers as independently scalable containers. Azure Container Registry — stores container images for all application components. Try It Yourself Demonstration of user‑scoped persistent memory across sessions. To make these concepts concrete, I’ve published a working reference implementation that demonstrates the architecture and patterns described above. The complete solution is available in the Agent-Memory GitHub repository. The repository README includes prerequisites, environment setup notes, and configuration details. Start by cloning the repository and moving into the project directory: git clone https://github.com/mardianto-msft/azure-agent-memory.git cd azure-agent-memory Next, sign in to Azure using the Azure CLI: az login Then authenticate the Azure Developer CLI: azd auth login Once authenticated, deploy the solution: azd up After deployment is complete, sign in using the provided demo users and interact with the agent across multiple sessions. Each user’s preferences and prior context are retained independently, the interaction continues seamlessly after signing out and returning later, and user context remains fully isolated with no cross‑identity leakage. The solution also includes a knowledge index initialized with selected Microsoft Outlook Help documentation, which the agent uses for knowledge grounding. This index can be easily replaced or extended with your own publicly accessible URLs to adapt the solution to different domains. Looking Ahead: Personalized Memory as a Foundation for Adaptive Agents As enterprise AI agents evolve, many teams are looking beyond larger models and improved retrieval toward human‑centered personalization at scale — building agents that adapt to individual users while operating within clearly defined trust boundaries. User‑scoped persistent memory enables this shift. By treating memory as a first‑class, user‑owned component, agents can maintain continuity across sessions while preserving isolation, governance, and compliance. Personalization becomes an intentional design choice, aligning with Microsoft’s human‑centered approach to AI, where users retain control over how systems adapt to them. This solution demonstrates how knowledge grounding and personalized memory serve complementary roles. Knowledge grounding ensures correctness by anchoring responses in trusted enterprise data. Personalized memory ensures relevance by tailoring interactions to the individual user. Together, they enable context‑aware, adaptive, and personalized agents — without compromising enterprise trust. Finally, this solution is intentionally presented as a reference design pattern, not a prescriptive architecture. It offers a practical starting point for enterprises designing adaptive, personalized agents, illustrating how user‑scoped memory can be modeled, governed, and integrated as a foundational capability for scalable enterprise AI.1.8KViews1like1CommentHow Do We Know AI Isn’t Lying? The Art of Evaluating LLMs in RAG Systems
🔍 1. Why Evaluating LLM Responses is Hard In classical programming, correctness is binary. Input Expected Result 2 + 2 4 ✔ Correct 2 + 2 5 ✘ Wrong Software is deterministic — same input → same output. LLMs are probabilistic. They generate one of many valid word combinations, like forming sentences from multiple possible synonyms and sentence structures. Example: Prompt: "Explain gravity like I'm 10" Possible responses: Response A Response B Gravity is a force that pulls everything to Earth. Gravity bends space-time causing objects to attract. Both are correct. Which is better? Depends on audience. So evaluation needs to look beyond text similarity. We must check: ✔ Is the answer meaningful? ✔ Is it correct? ✔ Is it easy to understand? ✔ Does it follow prompt intent? Testing LLMs is like grading essays — not checking numeric outputs. 🧠 2. Why RAG Evaluation is Even Harder RAG introduces an additional layer — retrieval. The model no longer answers from memory; it must first read context, then summarise it. Evaluation now has multi-dimensions: Evaluation Layer What we must verify Retrieval Did we fetch the right documents? Understanding Did the model interpret context correctly? Grounding Is the answer based on retrieved data? Generation Quality Is final response complete & clear? A simple story makes this intuitive: Teacher asks student to explain Photosynthesis. Student goes to library → selects a book → reads → writes explanation. We must evaluate: Did they pick the right book? → Retrieval Did they understand the topic? → Reasoning Did they copy facts correctly without inventing? → Faithfulness Is written explanation clear enough for another child to learn from? → Answer Quality One failure → total failure. 🧩 3. Two Types of Evaluation 🔹 Intrinsic Evaluation — Quality of the Response Itself Here we judge the answer, ignoring real-world impact. We check: ✔ Grammar & coherence ✔ Completeness of explanation ✔ No hallucination ✔ Logic flow & clarity ✔ Semantic correctness This is similar to checking how well the essay is written. Even if the result did not solve the real problem, the answer could still look good — that’s why intrinsic alone is not enough. 🔹 Extrinsic Evaluation — Did It Achieve the Goal? This measures task success. If a customer support bot writes a beautifully worded paragraph, but the user still doesn’t get their refund — it failed extrinsically. Examples: System Type Extrinsic Goal Banking RAG Bot Did user get correct KYC procedure? Medical RAG Was advice safe & factual? Legal search assistant Did it return the right section of the law? Technical summariser Did summary capture key meaning? Intrinsic = writing quality. Extrinsic = impact quality. A production-grade RAG system must satisfy both. 📏 4. Core RAG Evaluation Metrics (Explained with Very Simple Analogies) Metric Meaning Analogy Relevance Does answer match question? Ask who invented C++? → model talks about Java ❌ Faithfulness No invented facts Book says started 2004, response says 1990 ❌ Groundedness Answer traceable to sources Claims facts that don’t exist in context ❌ Completeness Covers all parts of question User asks Windows vs Linux → only explains Windows Context Recall / Precision Correct docs retrieved & used Student opens wrong chapter Hallucination Rate Degree of made-up info “Taj Mahal is in London” 😱 Semantic Similarity Meaning-level match “Engine died” = “Car stopped running” 💡 Good evaluation doesn’t check exact wording. It checks meaning + truth + usefulness. 🛠 5. Tools for RAG Evaluation 🔹 1. RAGAS — Foundation for RAG Scoring RAGAS evaluates responses based on: ✔ Faithfulness ✔ Relevance ✔ Context recall ✔ Answer similarity Think of RAGAS as a teacher grading with a rubric. It reads both answer + source documents, then scores based on truthfulness & alignment. 🔹 2. LangChain Evaluators LangChain offers multiple evaluation types: Type What it checks String or regex Basic keyword presence Embedding based Meaning similarity, not text match LLM-as-a-Judge AI evaluates AI (deep reasoning) LangChain = testing toolbox RAGAS = grading framework Together they form a complete QA ecosystem. 🔹 3. PyTest + CI for Automated LLM Testing Instead of manually validating outputs, we automate: Feed preset questions to RAG Capture answers Run RAGAS/LangChain scoring Fail test if hallucination > threshold This brings AI closer to software-engineering discipline. RAG systems stop being experiments — they become testable, trackable, production-grade products. 🚀 6. The Future: LLM-as-a-Judge The future of evaluation is simple: LLMs will evaluate other LLMs. One model writes an answer. Another model checks: ✔ Was it truthful? ✔ Was it relevant? ✔ Did it follow context? This enables: Benefit Why it matters Scalable evaluation No humans needed for every query Continuous improvement Model learns from mistakes Real-time scoring Detect errors before user sees them This is like autopilot for AI systems — not only navigating, but self-correcting mid-flight. And that is where enterprise AI is headed. 🎯 Final Summary Evaluating LLM responses is not checking if strings match. It is checking if the machine: ✔ Understood the question ✔ Retrieved relevant knowledge ✔ Avoided hallucination ✔ Provided complete, meaningful reasoning ✔ Grounded answer in real source text RAG evaluation demands multi-layer validation — retrieval, reasoning, grounding, semantics, safety. Frameworks like RAGAS + LangChain evaluators + PyTest pipelines are shaping the discipline of measurable, reliable AI — pushing LLM-powered RAG from cool demo → trustworthy enterprise intelligence. Useful Resources What is Retrieval-Augmented Generation (RAG) : https://azure.microsoft.com/en-in/resources/cloud-computing-dictionary/what-is-retrieval-augmented-generation-rag/ Retrieval-Augmented Generation concepts (Azure AI) : https://learn.microsoft.com/en-us/azure/ai-services/content-understanding/concepts/retrieval-augmented-generation RAG with Azure AI Search – Overview : https://learn.microsoft.com/en-us/azure/search/retrieval-augmented-generation-overview Evaluate Generative AI Applications (Microsoft Learn – Learning Path) : https://learn.microsoft.com/en-us/training/paths/evaluate-generative-ai-apps/ Evaluate Generative AI Models in Microsoft Foundry Portal : https://learn.microsoft.com/en-us/training/modules/evaluate-models-azure-ai-studio/ RAG Evaluation Metrics (Relevance, Groundedness, Faithfulness) : https://learn.microsoft.com/en-us/azure/ai-foundry/concepts/evaluation-evaluators/rag-evaluators RAGAS – Evaluation Framework for RAG Systems : https://docs.ragas.io/963Views0likes0CommentsGenerally Available: Evaluations, Monitoring, and Tracing in Microsoft Foundry
If you've shipped an AI agent to production, you've likely run into the same uncomfortable realization: the hard part isn't getting the agent to work - it's keeping it working. Models get updated, prompts get tweaked, retrieval pipelines drift, and user traffic surfaces edge cases that never appeared in your eval suite. Quality isn't something you establish once. It's something you have to continuously measure. Today, we're making that continuous measurement a first-class operational capability. Evaluations, Monitoring, and Tracing in Microsoft Foundry are now generally available through Foundry Control Plane. These aren't standalone tools bolted onto the side of the platform - they're deeply integrated with Azure Monitor, which means AI agent observability now lives in the same operational plane as the rest of your infrastructure. The Problem With Point-in-Time Evaluation Most evaluation workflows are designed around a pre-deployment gate. You build a test dataset, run your evals, review the scores, and ship. That approach has real value - but it has a hard ceiling. In production, agent behavior is a function of many things that change independently of your code: Foundation model updates ship continuously and can shift output style, reasoning patterns, and edge case handling in ways that don't always surface on your benchmark set. Prompt changes can have nonlinear effects downstream, especially in multi-step agentic flows. Retrieval pipeline drift changes what context your agent actually sees at inference time. A document index fresh last month may have stale or subtly different content today. Real-world traffic distribution is never exactly what you sampled for your test set. Production surfaces long-tail inputs that feel obvious in hindsight but were invisible during development. The implication is straightforward: evaluation has to be continuous, not episodic. You need quality signals at development time, at every CI/CD commit, and continuously against live production traffic - all using the same evaluator definitions so results are comparable across environments. That's the core design principle behind Foundry Observability. Continuous Evaluation Across the Full AI Lifecycle Built-In Evaluators Foundry's built-in evaluators cover the most critical quality and safety dimensions for production agent systems: Coherence and Relevance measure whether responses are internally consistent and on-topic relative to the input. These are table-stakes signals for any conversational or task-completion agent. Groundedness is particularly important for RAG-based architectures. It measures whether the model's output is actually supported by the retrieved context - as opposed to plausible-sounding content the model generated from its parametric memory. Groundedness failures are a leading indicator of hallucination risk in production, and they're often invisible to human reviewers at scale. Retrieval Quality evaluates the retrieval step independently from generation. Groundedness failures can originate in two places: the model may be ignoring good context, or the retrieval pipeline may not be surfacing relevant context in the first place. Splitting these signals makes it much easier to pinpoint root cause. Safety and Policy Alignment evaluates whether outputs meet your deployment's policy requirements - content safety, topic restrictions, response format compliance, and similar constraints. These evaluators are designed to run at every stage of the AI lifecycle: Local development - run evals inline as you iterate on prompts, retrieval config, or orchestration logic CI/CD pipelines - gate every commit against your quality baselines; catch regressions before they reach production Production traffic monitoring - continuously evaluate sampled live traffic and surface trends over time Because the evaluators are identical across all three contexts, a score in CI means the same thing as a score in production monitoring. See the Practical Guide to Evaluations and the Built-in Evaluators Reference for a deeper walkthrough. Custom Evaluators - Encoding Your Own Definition of Quality Built-in evaluators cover common signals well, but production agents often need to satisfy criteria specific to a domain, regulatory environment, or internal standard. Foundry supports two types of custom evaluators (currently in public preview): LLM-as-a-Judge evaluators let you configure a prompt and grading rubric, then use a language model to apply that rubric to your agent's outputs. This is the right approach for quality dimensions that require reasoning or contextual judgment - whether a response appropriately acknowledges uncertainty, whether a customer-facing message matches your brand tone, or whether a clinical summary meets documentation standards. You write a judge prompt with a scoring scale (e.g., 1–5 with criteria for each level) that evaluates a given {input} / {response} pair. Foundry runs this at scale and aggregates scores into your dashboards alongside built-in results. Code-based evaluators are Python functions that implement any evaluation logic you can express programmatically - regex matching, schema validation, business rule checks, compliance assertions, or calls to external systems. If your organization has documented policies about what a valid agent response looks like, you can encode those policies directly into your evaluation pipeline. Custom and built-in evaluators compose naturally - running against the same traffic, producing results in the same schema, feeding into the same dashboards and alert rules. Monitoring and Alerting - AI Quality as an Operational Signal All observability data produced by Foundry - evaluation results, traces, latency, token usage, and quality metrics - is published directly to Azure Monitor. This is where the integration pays off for teams already on Azure. What this enables that siloed AI monitoring tools can't: Cross-stack correlation. When your groundedness score drops, is it a model update, a retrieval pipeline issue, or an infrastructure problem affecting latency? With AI quality signals and infrastructure telemetry in the same Azure Monitor Application Insights workspace, you can answer that in minutes rather than hours of manual correlation across disconnected systems. Unified alerting. Configure Azure Monitor alert rules on any evaluation metric - trigger a PagerDuty incident when groundedness drops below threshold, send a Teams notification when safety violations spike, or create automated runbook responses when retrieval quality degrades. These are the same alert mechanisms your SRE team already uses. Enterprise governance by default. Azure Monitor's RBAC, retention policies, diagnostic settings, and audit logging apply automatically to all AI observability data. You inherit the governance framework your organization has already built and approved. Grafana and existing dashboards. If your team uses Azure Managed Grafana, evaluation metrics can flow into existing dashboards alongside your other operational metrics - a single pane of glass for application health, infrastructure performance, and AI agent quality. The Agent Monitoring Dashboard in the Foundry portal provides an AI-native view out of the box - evaluation metric trends, safety threshold status, quality score distributions, and latency breakdowns. Everything in that dashboard is backed by Azure Monitor data, so SRE teams can always drill deeper. End-to-End Tracing: From Quality Signal to Root Cause A groundedness score tells you something is wrong. A trace tells you exactly where the failure occurred and what the agent actually did. Foundry provides OpenTelemetry-based distributed tracing that follows each request through your entire agent system: model calls, tool invocations, retrieval steps, orchestration logic, and cross-agent handoffs. Traces capture the full execution path - inputs, outputs, latency at each step, tool call parameters and responses, and token usage. The key design decision: evaluation results are linked directly to traces. When you see a low groundedness score in your monitoring dashboard, you navigate directly to the specific trace that produced it - no manual timestamp correlation, no separate trace ID lookup. The connection is made automatically. Foundry auto-collects traces across the frameworks your agents are likely already built on: Microsoft Agent Framework Semantic Kernel LangChain and LangGraph OpenAI Agents SDK For custom or less common orchestration frameworks, the Azure Monitor OpenTelemetry Distro provides an instrumentation path. Microsoft is also contributing upstream to the OpenTelemetry project - working with Cisco Outshift, we've contributed semantic conventions for multi-agent trace correlation, standardizing how agent identity, task context, and cross-agent handoffs are represented in OTel spans. Note: Tracing is currently in public preview, with GA shipping by end of March. Prompt Optimizer (Public Preview) One persistent friction point in agent development is the iteration loop between writing prompts and measuring their effect. You make a change, run your evals, look at the delta, try to infer what about the change mattered, and repeat. Prompt Optimizer tightens this loop. It analyzes your existing prompt and applies structured prompt engineering techniques - clarifying ambiguous instructions, improving formatting for model comprehension, restructuring few-shot examples, making implicit constraints explicit - with paragraph-level explanations for every change it makes. The transparency is deliberate. Rather than producing a black-box "optimized" prompt, it shows you exactly what it changed and why. You can add constraints, trigger another optimization pass, and iterate until satisfied. When you're done, apply it with one click. The value compounds alongside continuous evaluation: run your eval suite against the current prompt, optimize, run evals again, see the measured improvement. That feedback loop - optimize, measure, optimize - is the closest thing to a systematic approach to prompt engineering that currently exists. What Makes our Approach to Observability Different There are other evaluation and observability tools in the AI ecosystem. The differentiation in Foundry's approach comes down to specific architectural choices: Unified lifecycle coverage, not just pre-deployment testing. Most existing evaluation tools are designed for offline, pre-deployment use. Foundry's evaluators run in the same form at development time, in CI/CD, and against live production traffic. Your quality metrics are actually comparable across the lifecycle - you can tell whether production quality matches what you saw in testing, rather than operating two separate measurement systems that can't be compared. No separate observability silo. Publishing all observability data to Azure Monitor means you don't operate a separate system for AI quality alongside your existing infrastructure monitoring. AI incidents route through your existing on-call rotations. AI quality data is subject to the same retention and compliance controls as the rest of your telemetry. Framework-agnostic tracing. Auto-instrumentation across Semantic Kernel, LangChain, LangGraph, and the OpenAI Agents SDK means you're not locked into a specific orchestration framework. The OpenTelemetry foundation means trace data is portable to any compatible backend, protecting your investment as the tooling landscape evolves. Composable evaluators. Built-in and custom evaluators run in the same pipeline, against the same traffic, producing results in the same schema, feeding into the same dashboards and alert rules. You don't choose between generic coverage and domain-specific precision - you get both. Evaluation linked to traces. Most systems treat evaluation and tracing as separate concerns. Foundry treats them as two views of the same event - closing the loop between detecting a quality problem and diagnosing it. Getting Started If you're building agents on Microsoft Foundry, or using Semantic Kernel, LangChain, LangGraph, or the OpenAI Agents SDK and want to add production observability, the entry point is Foundry Control Plane. Try it You'll need a Foundry project with an agent and an Azure OpenAI deployment. Enable observability by navigating to Foundry Control Plane and connecting your Azure Monitor workspace. Then walk through the Practical Guide to Evaluations, explore the Built-in Evaluators Reference, and set up end-to-end tracing for your agents.5.4KViews1like0Comments