<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Microsoft on RockB</title><link>https://baeseokjae.github.io/tags/microsoft/</link><description>Recent content in Microsoft on RockB</description><image><title>RockB</title><url>https://baeseokjae.github.io/images/og-default.png</url><link>https://baeseokjae.github.io/images/og-default.png</link></image><generator>Hugo</generator><language>en-us</language><lastBuildDate>Fri, 15 May 2026 12:07:30 +0000</lastBuildDate><atom:link href="https://baeseokjae.github.io/tags/microsoft/index.xml" rel="self" type="application/rss+xml"/><item><title>Microsoft Agent Governance Toolkit: Open-Source Runtime Security for AI Agents</title><link>https://baeseokjae.github.io/posts/microsoft-agent-governance-toolkit-2026/</link><pubDate>Fri, 15 May 2026 12:07:30 +0000</pubDate><guid>https://baeseokjae.github.io/posts/microsoft-agent-governance-toolkit-2026/</guid><description>Microsoft&amp;#39;s Agent Governance Toolkit is the first open-source framework covering all 10 OWASP Agentic AI risks with sub-5ms deterministic policy enforcement at runtime.</description><content:encoded><![CDATA[<p>Released on April 2, 2026, the Microsoft Agent Governance Toolkit is the first open-source runtime security framework to address all ten risks on the OWASP Agentic AI Top 10. Shipped under the MIT license, it provides deterministic policy enforcement at the agent action layer with less than 5ms overhead per evaluated action. As the agentic AI security market grows from a projected $1.65 billion in 2026 toward an estimated $13.52 billion by 2032 at roughly 42% CAGR, this toolkit arrives at exactly the moment enterprises need a vendor-neutral, community-owned standard for governing what their AI agents are actually permitted to do.</p>
<h2 id="microsoft-agent-governance-toolkit-open-source-runtime-security-for-all-owasp-agentic-ai-risks">Microsoft Agent Governance Toolkit: Open-Source Runtime Security for All OWASP Agentic AI Risks</h2>
<p>With 88% of organizations reporting confirmed or suspected AI agent security incidents in the past year, the pressure to govern agentic AI behavior has reached a breaking point. Microsoft launched the Agent Governance Toolkit on April 2, 2026 as a direct response to this crisis — an open-source framework released under the MIT license that intercepts every agent action before execution and evaluates it against a configurable policy ruleset. The toolkit integrates natively with the four most widely deployed agent frameworks: LangChain, AutoGen, Semantic Kernel, and the OpenAI Agents SDK. This means teams can add governance without rewriting existing agent code — a practical necessity given that most enterprise agent deployments are already in production. The toolkit&rsquo;s architecture is modular: the core policy engine, called Agent OS, can be deployed independently, and additional modules for identity management, reliability engineering, and regulatory compliance can be layered in as operational requirements grow. Most significantly, the toolkit is the first open-source project to explicitly demonstrate coverage of all ten OWASP Agentic AI Top 10 risks with deterministic controls, making it the only framework where a security team can trace every item on the published threat taxonomy to a specific, testable enforcement mechanism.</p>
<h3 id="why-runtime-enforcement-is-different-from-prompt-level-safety">Why Runtime Enforcement Is Different from Prompt-Level Safety</h3>
<p>Prompt-level safety instructions — telling the model what not to do inside the system prompt — remain the most common approach to agent safety, but they have measurable failure rates under adversarial conditions. Runtime enforcement operates at the code layer, outside the model&rsquo;s reasoning process, which means a policy blocking unauthorized external writes will block them regardless of what the model was instructed or what it decides to attempt. That architectural separation is the core distinction between the Agent Governance Toolkit and prompt-engineering-based safety approaches.</p>
<h2 id="the-owasp-agentic-ai-top-10-the-risks-the-toolkit-addresses">The OWASP Agentic AI Top 10: The Risks the Toolkit Addresses</h2>
<p>The OWASP Agentic AI Top 10 is the published industry taxonomy of AI agent security risks, and 80% of organizations have already encountered at least one of these risks through unauthorized data exposure or other dangerous agent behaviors observed in the past year. The Microsoft Agent Governance Toolkit was architected with this list as its primary specification: every design decision traces back to a named OWASP risk, and every OWASP risk maps to at least one concrete enforcement control inside the toolkit. This bidirectional traceability matters enormously for security teams, because it allows compliance posture to be audited against a recognized external standard rather than informally asserted. The ten risks span the full lifecycle of an agent deployment — from what the agent is prompted to do, through how it uses its tools and memory, all the way to how it interacts with other agents and external systems.</p>
<table>
  <thead>
      <tr>
          <th>OWASP Agentic AI Risk</th>
          <th>Toolkit Control Mechanism</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Prompt Injection</td>
          <td>Semantic intent classifier at the policy evaluation layer</td>
      </tr>
      <tr>
          <td>Excessive Agency</td>
          <td>Least-privilege policy defaults; action scope limits per agent role</td>
      </tr>
      <tr>
          <td>Data Exfiltration</td>
          <td>Outbound data flow rules; domain allowlists for HTTP actions</td>
      </tr>
      <tr>
          <td>Privilege Escalation</td>
          <td>Role-scoped action permissions; escalation attempt detection</td>
      </tr>
      <tr>
          <td>Insecure Agent Memory</td>
          <td>Cross-agent memory validation and isolation controls</td>
      </tr>
      <tr>
          <td>Supply Chain Risk</td>
          <td>Plugin signing, verification, and SBOM generation</td>
      </tr>
      <tr>
          <td>Opaque Execution</td>
          <td>Full audit trail with structured logging for every action</td>
      </tr>
      <tr>
          <td>Trust Propagation</td>
          <td>Scoped trust chains between agent identities</td>
      </tr>
      <tr>
          <td>Compliance Drift</td>
          <td>Regulatory framework policy mappings with automated reporting</td>
      </tr>
      <tr>
          <td>Irreversible Actions</td>
          <td>Circuit breaker patterns and rollback hooks for destructive operations</td>
      </tr>
  </tbody>
</table>
<p>The structured mapping in the table above is not just documentation — it is operationalized. Each row corresponds to one or more policy rules that can be loaded into the Agent OS engine, evaluated in real time against every agent action, and audited by name in the toolkit&rsquo;s logs. For organizations required to demonstrate OWASP alignment to a board, regulator, or enterprise customer, this traceability is a meaningful differentiator from toolkits that address security in general terms.</p>
<h2 id="agent-os-the-stateless-policy-engine-at-the-core">Agent OS: The Stateless Policy Engine at the Core</h2>
<p>The most important architectural decision in the entire toolkit is that Agent OS, the core policy engine, is stateless. Every agent action is evaluated independently against the configured ruleset, with no session context or accumulated state that an adversary could manipulate over time to relax future policy decisions. This stateless design is precisely why the toolkit achieves less than 5ms overhead per evaluated action — there is no shared state to synchronize, no distributed cache to invalidate, and no coordination overhead that would create bottlenecks in concurrent multi-agent deployments. Agent OS positions itself in the execution path between an agent&rsquo;s decision to perform an action and the actual execution of that action against an external system. If the policy evaluation returns DENY, the action is blocked before it touches any file, API, database, or downstream agent. If evaluation returns ALLOW, execution proceeds immediately. The entire interception and evaluation cycle adds less than 5ms to the agent&rsquo;s action latency — a rounding error compared to the hundreds of milliseconds typically consumed by LLM inference or external API calls.</p>
<p>The stateless architecture has a second important implication: horizontal scalability. Because each policy evaluation is entirely self-contained, Agent OS instances can be replicated across as many nodes as needed without any coordination overhead whatsoever. For enterprises running large fleets of AI agents distributed across multiple cloud regions and availability zones, governance does not become a bottleneck as the agent footprint scales. The same policy file that governs a single development agent governs thousands of production agents identically, with no additional operational complexity introduced by the governance layer itself.</p>
<h3 id="how-agent-os-intercepts-agent-actions-in-practice">How Agent OS Intercepts Agent Actions in Practice</h3>
<p>Agent OS inserts itself into the agent&rsquo;s execution path as a middleware layer. When an agent decides to call a tool, write a file, make an HTTP request, or invoke a downstream agent, that intent is passed to Agent OS as a structured action object containing the action type, target, parameters, and the cryptographic identity of the requesting agent. The policy engine evaluates this object against the loaded ruleset and returns a permit or deny decision — along with any conditions, rate-limit directives, or audit flags specified in the matching policy — before the action is dispatched to the target system.</p>
<h2 id="policy-languages-yaml-opa-rego-and-cedar-for-agent-rules">Policy Languages: YAML, OPA Rego, and Cedar for Agent Rules</h2>
<p>Support for three distinct policy languages — YAML for human-readable rules, OPA Rego for complex conditional logic, and Cedar for formally verifiable authorization semantics — is one of the toolkit&rsquo;s most deliberate design decisions, and it reflects the reality that different organizations have fundamentally different requirements for how they express and validate security policy. A startup shipping its first governed agent can start with a few lines of YAML and achieve meaningful protection on day one. A financial services firm deploying agents in a strictly regulated environment may require Cedar&rsquo;s formal verification properties to satisfy an auditor that certain high-risk actions are provably impossible regardless of model behavior. An infrastructure team already using Open Policy Agent for Kubernetes and cloud resource governance can reuse their existing Rego expertise to write agent policies without learning a new language. All three policy formats coexist within the same Agent OS deployment, evaluated by the same engine against the same agent action stream, which means organizations can adopt incrementally and mix policy languages as their needs dictate.</p>
<p>YAML policies are the lowest-friction entry point. A minimal policy file defining a handful of DENY rules for the most common attack vectors — unauthorized outbound HTTP calls, writes outside approved directories, privilege escalation attempts — can be authored by any engineer familiar with YAML in under an hour. OPA Rego unlocks the full expressive power of a purpose-built policy query language, including complex joins, aggregations, and recursive rules that are difficult or impossible to express in YAML. Cedar, originally developed by AWS for its Verified Permissions authorization service, brings the property of formal analyzability: a static analysis tool can examine a Cedar policy and mathematically prove what action classes it will and will not permit, without executing it against live traffic. That formal verification capability moves agent governance from &ldquo;we believe this policy works&rdquo; to &ldquo;we have proven this policy is correct,&rdquo; which is a qualitatively different level of assurance for high-stakes deployments.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-yaml" data-lang="yaml"><span style="display:flex;"><span><span style="color:#75715e"># Example YAML policy: block writes outside approved paths, rate-limit API calls</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">policies</span>:
</span></span><span style="display:flex;"><span>  - <span style="color:#f92672">id</span>: <span style="color:#ae81ff">block-external-write</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">condition</span>:
</span></span><span style="display:flex;"><span>      <span style="color:#ae81ff">action.type == &#34;file_write&#34; AND</span>
</span></span><span style="display:flex;"><span>      <span style="color:#ae81ff">action.target NOT IN allowed_paths</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">effect</span>: <span style="color:#ae81ff">DENY</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>  - <span style="color:#f92672">id</span>: <span style="color:#ae81ff">rate-limit-api-calls</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">condition</span>:
</span></span><span style="display:flex;"><span>      <span style="color:#ae81ff">action.type == &#34;api_call&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">rate_limit</span>:
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">requests</span>: <span style="color:#ae81ff">10</span>
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">window</span>: <span style="color:#e6db74">&#34;1s&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">effect</span>: <span style="color:#ae81ff">ALLOW_WITH_LIMIT</span>
</span></span></code></pre></div><p>Policies are loaded from files at startup and can be hot-reloaded without restarting the agent runtime, giving operators the ability to respond to newly identified attack patterns or policy violations by pushing a policy update through their standard CI/CD pipeline.</p>
<h2 id="integration-langchain-autogen-semantic-kernel-and-openai-agents-sdk">Integration: LangChain, AutoGen, Semantic Kernel, and OpenAI Agents SDK</h2>
<p>The toolkit was designed from the start for zero-rewrite integration with existing agent frameworks, and the four primary supported integrations — LangChain, AutoGen, Semantic Kernel, and the OpenAI Agents SDK — cover the dominant share of enterprise agent deployments in production as of mid-2026. Each integration uses that framework&rsquo;s own native extension points: LangChain callbacks, AutoGen middleware hooks, Semantic Kernel plugins, and the OpenAI Agents SDK&rsquo;s tool execution pipeline. The consequence is that an engineering team running an existing LangChain agent can add governance in a few lines of configuration, without modifying agent logic, tool definitions, prompt templates, or any other aspect of the existing application. This &ldquo;no rewrite&rdquo; principle is not merely a developer convenience — it is a deployment risk reduction strategy, because the governed agent behaves identically to the ungoverned agent for all permitted actions, and only prohibited actions are affected by the governance layer.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#75715e"># LangChain integration: governance added as a callback, zero code changes to the agent</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">from</span> langchain.agents <span style="color:#f92672">import</span> AgentExecutor
</span></span><span style="display:flex;"><span><span style="color:#f92672">from</span> agent_governance <span style="color:#f92672">import</span> GovernanceMiddleware
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>agent <span style="color:#f92672">=</span> AgentExecutor(
</span></span><span style="display:flex;"><span>    agent<span style="color:#f92672">=</span>my_agent,
</span></span><span style="display:flex;"><span>    tools<span style="color:#f92672">=</span>my_tools,
</span></span><span style="display:flex;"><span>    callbacks<span style="color:#f92672">=</span>[
</span></span><span style="display:flex;"><span>        GovernanceMiddleware(
</span></span><span style="display:flex;"><span>            policy_path<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;./policies/production.yaml&#34;</span>
</span></span><span style="display:flex;"><span>        )
</span></span><span style="display:flex;"><span>    ]
</span></span><span style="display:flex;"><span>)
</span></span></code></pre></div><p>For AutoGen multi-agent workflows, the middleware intercepts both inbound and outbound agent messages, which means policy rules can govern not only what an agent does in the external world but also what instructions one agent sends to another. This is directly relevant to the OWASP Agentic AI risks around trust propagation and prompt injection delivered via inter-agent communication channels, which are attack surfaces that single-agent governance tools cannot address.</p>
<p>The OpenAI Agents SDK integration is significant because it means the governance layer is not tied to any specific model provider. Organizations building on OpenAI&rsquo;s infrastructure can apply toolkit policies to agents using OpenAI models, while organizations using Azure OpenAI or other providers use the same policy files with the same enforcement semantics. Semantic Kernel integration makes the toolkit immediately applicable to Microsoft&rsquo;s enterprise customer base already building production agents with that framework, and it enables natural federation with Azure AI and Entra ID for organizations that want to express agent permissions in terms of existing enterprise identity structures.</p>
<h3 id="azure-ai-and-microsoft-entra-id-integration">Azure AI and Microsoft Entra ID Integration</h3>
<p>For organizations on the Microsoft cloud stack, the optional integration with Azure AI services and Microsoft Entra ID allows agent identities to be mapped to enterprise directory objects. Access policies can then be written in terms of organizational roles, department memberships, and security group assignments — the same constructs already governing human user access — rather than requiring a separate identity management infrastructure maintained exclusively for AI agents.</p>
<h2 id="performance-sub-5ms-policy-evaluation-in-production">Performance: Sub-5ms Policy Evaluation in Production</h2>
<p>The most persistent objection to runtime security enforcement is the assumption that it adds unacceptable latency to agent operations. The Agent Governance Toolkit addresses this directly with a design target of less than 5ms overhead per action evaluated by Agent OS, and this performance level is achievable in production at scale, not just in laboratory benchmarks. To contextualize that number: a typical LLM inference call for a mid-sized model running at production load takes between 500ms and several seconds. A tool invocation triggering an external API call adds 100ms to 2 seconds depending on network conditions. Against this backdrop, a 5ms governance overhead is a rounding error in the overall agent response time — it does not perceptibly slow agent workflows, and it does not force engineering teams into tradeoffs between security coverage and application responsiveness. The practical implication is significant: governance can be applied universally, to every agent action without exception, rather than to a sampled or heuristically selected subset. A governance layer that evaluates only some actions provides the appearance of control without its substance, and the sub-5ms overhead removes any engineering incentive to skip evaluations for performance reasons.</p>
<p>This performance level is achievable because of the stateless, in-process design of Agent OS. Policy evaluation requires no network calls, no database round-trips, and no distributed coordination. The policy ruleset is compiled to an internal representation at startup and evaluated entirely in memory for each action object. YAML and OPA Rego policies are compiled at load time so that evaluation is fast even for rules with complex boolean logic. Cedar policies run through Cedar&rsquo;s own purpose-built, formally optimized evaluation engine. The combination produces an enforcement system that is fast enough to be deployed unconditionally without architectural compromises.</p>
<h3 id="benchmarking-against-specific-workloads">Benchmarking Against Specific Workloads</h3>
<p>Published performance figures reflect benchmark conditions that may differ from production environments with very high action throughput or unusually complex OPA Rego rulesets involving large data joins or recursive rules. Teams with latency-sensitive workflows should benchmark against their specific policy configuration in a staging environment before relying on the headline figure. The toolkit&rsquo;s documentation provides optimization guidance for reducing evaluation latency in complex policy scenarios, including techniques for pre-compiling frequently evaluated rules and structuring policy files for faster pattern matching.</p>
<h2 id="microsoft-agent-governance-toolkit-vs-lakera-guard-vs-calypsoai">Microsoft Agent Governance Toolkit vs Lakera Guard vs CalypsoAI</h2>
<p>The AI agent security tooling landscape has expanded rapidly alongside the market&rsquo;s projected growth from $1.65 billion in 2026 to $13.52 billion by 2032, and the Microsoft Agent Governance Toolkit occupies a distinct position relative to the two most commonly evaluated alternatives: Lakera Guard and CalypsoAI. Understanding those differences clearly is essential for teams making adoption decisions under budget and timeline pressure. Lakera Guard is a focused and well-regarded solution for prompt injection detection and LLM input/output safety filtering. It executes its defined scope effectively, but that scope covers primarily one item from the OWASP Agentic AI Top 10 — prompt injection — rather than the full ten-item risk surface. CalypsoAI offers a broader enterprise governance platform with meaningful capabilities, but it operates under a proprietary license and enterprise pricing model that introduces vendor dependency and prevents the community code audits that security-conscious organizations increasingly require. The Microsoft Agent Governance Toolkit is the only open-source option in this field that explicitly targets and demonstrates coverage of all ten OWASP Agentic AI Top 10 risks.</p>
<table>
  <thead>
      <tr>
          <th>Criterion</th>
          <th>Microsoft Agent Governance Toolkit</th>
          <th>Lakera Guard</th>
          <th>CalypsoAI</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>OWASP Agentic AI Top 10 coverage</td>
          <td>All 10 risks</td>
          <td>Primarily prompt injection</td>
          <td>Broad but proprietary</td>
      </tr>
      <tr>
          <td>License</td>
          <td>MIT (open source)</td>
          <td>Proprietary SaaS</td>
          <td>Proprietary enterprise</td>
      </tr>
      <tr>
          <td>Policy engine</td>
          <td>Agent OS (stateless, sub-5ms)</td>
          <td>Not applicable</td>
          <td>Proprietary runtime</td>
      </tr>
      <tr>
          <td>LangChain / AutoGen / Semantic Kernel / OpenAI SDK</td>
          <td>Native integration for all four</td>
          <td>LLM API layer only</td>
          <td>Varies by deployment</td>
      </tr>
      <tr>
          <td>Policy languages</td>
          <td>YAML, OPA Rego, Cedar</td>
          <td>Not applicable</td>
          <td>Proprietary configuration</td>
      </tr>
      <tr>
          <td>Enterprise identity integration</td>
          <td>Azure AI and Entra ID</td>
          <td>Limited</td>
          <td>Yes, proprietary</td>
      </tr>
      <tr>
          <td>Pricing model</td>
          <td>Free (MIT license)</td>
          <td>Subscription per seat/request</td>
          <td>Enterprise contract</td>
      </tr>
      <tr>
          <td>Community auditability</td>
          <td>Full source code available</td>
          <td>Closed source</td>
          <td>Closed source</td>
      </tr>
  </tbody>
</table>
<p>The decision between these tools comes down to three factors: scope of required coverage, licensing constraints, and ecosystem fit. Organizations that need only prompt injection protection, operate on a tight budget for security tooling, and have no requirement for open-source auditability may find Lakera Guard&rsquo;s focused capability sufficient. Organizations in regulated industries that need full OWASP coverage, reproducible compliance evidence, and source code access for security audits will find the Microsoft toolkit is currently the only option satisfying all three constraints simultaneously. CalypsoAI occupies an enterprise segment where vendor support contracts and managed deployment are priorities above open-source availability.</p>
<h3 id="when-lakera-guard-remains-the-appropriate-choice">When Lakera Guard Remains the Appropriate Choice</h3>
<p>Teams whose primary concern is LLM input and output safety — preventing harmful content generation, detecting prompt injection in consumer-facing applications, or filtering model outputs before they reach end users — may find Lakera Guard&rsquo;s focused capability operationally simpler and sufficient for their threat model. The two tools are not mutually exclusive: a defense-in-depth architecture could deploy both, with Lakera Guard handling LLM I/O safety and the Microsoft toolkit governing runtime agent action policies.</p>
<h2 id="getting-started-installing-and-configuring-the-toolkit">Getting Started: Installing and Configuring the Toolkit</h2>
<p>The fastest path to meaningful governance with the Microsoft Agent Governance Toolkit starts with installing only Agent OS — there is no requirement to adopt the full toolkit at once, and incremental adoption is the explicitly recommended path for most teams. The core Agent OS package is available for Python and TypeScript, with the full toolkit also supporting Rust, Go, and .NET. Installation is a single command, and the minimum viable configuration to achieve runtime policy enforcement is a YAML policy file and a one-line addition to the existing agent code. Teams can then layer in additional modules — enterprise identity integration via Entra ID, reliability engineering controls, regulatory compliance framework mappings — as operational requirements evolve and the team gains confidence in the governance model.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#75715e"># Start with Agent OS only — the recommended incremental approach</span>
</span></span><span style="display:flex;"><span>pip install agent-os
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># Install the full toolkit when ready for identity, SRE, and compliance modules</span>
</span></span><span style="display:flex;"><span>pip install agent-governance<span style="color:#f92672">[</span>all<span style="color:#f92672">]</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># TypeScript installation</span>
</span></span><span style="display:flex;"><span>npm install @microsoft/agent-governance
</span></span></code></pre></div><p>With Agent OS installed, adding enforcement to an existing agent requires a policy file and a decorator or callback addition. The following minimal example enforces a starter policy on every action the agent takes:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#f92672">from</span> agent_os <span style="color:#f92672">import</span> PolicyEngine
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>engine <span style="color:#f92672">=</span> PolicyEngine<span style="color:#f92672">.</span>from_file(<span style="color:#e6db74">&#34;./policies/starter.yaml&#34;</span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">@engine.enforce</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">def</span> <span style="color:#a6e22e">my_agent_action</span>(action, context):
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">return</span> execute_action(action, context)
</span></span></code></pre></div><p>A starter policy addressing the highest-priority OWASP risks requires only a few rules. The following file blocks unauthorized outbound HTTP requests, prevents writes to unapproved filesystem paths, and generates an audit record for every access to sensitive data — covering three distinct OWASP Agentic AI Top 10 risks in under twenty lines:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-yaml" data-lang="yaml"><span style="display:flex;"><span><span style="color:#75715e"># starter.yaml: a minimal production-ready starting policy</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">policies</span>:
</span></span><span style="display:flex;"><span>  - <span style="color:#f92672">id</span>: <span style="color:#ae81ff">deny-unauthorized-external-calls</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">condition</span>: <span style="color:#ae81ff">action.type == &#34;http_request&#34; AND action.domain NOT IN allowlist</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">effect</span>: <span style="color:#ae81ff">DENY</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>  - <span style="color:#f92672">id</span>: <span style="color:#ae81ff">block-external-write</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">condition</span>: <span style="color:#ae81ff">action.type == &#34;file_write&#34; AND action.target NOT IN allowed_paths</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">effect</span>: <span style="color:#ae81ff">DENY</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>  - <span style="color:#f92672">id</span>: <span style="color:#ae81ff">log-all-sensitive-reads</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">condition</span>: <span style="color:#ae81ff">action.type == &#34;data_read&#34; AND action.classification == &#34;sensitive&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">effect</span>: <span style="color:#ae81ff">ALLOW</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">audit</span>: <span style="color:#66d9ef">true</span>
</span></span></code></pre></div><h3 id="production-deployment-checklist">Production Deployment Checklist</h3>
<p>Before moving a governed agent to production, treat the policy file as code: include it in the same version control repository as the agent, require pull request review for all policy changes, and run the toolkit&rsquo;s built-in test suite against every policy modification to confirm that previously permitted behaviors remain permitted. Connect the audit log output to the organization&rsquo;s existing SIEM or observability platform so that policy DENY events generate alerts through established incident response channels rather than accumulating silently in a log file. Start with the three starter rules above, validate in staging that they do not block legitimate agent operations, and then progressively narrow scope by adding more specific rules as operational patterns are understood. The toolkit&rsquo;s modular architecture ensures that adding more advanced modules — Entra ID identity federation, regulatory compliance mappings, circuit breaker reliability controls — does not require changes to policies already deployed and validated.</p>
<hr>
<h2 id="faq">FAQ</h2>
<p><strong>Q1: Does the Agent Governance Toolkit work with agent frameworks beyond the four primary integrations?</strong></p>
<p>LangChain, AutoGen, Semantic Kernel, and the OpenAI Agents SDK are the four frameworks with official, maintained integration adapters. However, Agent OS can be applied to any Python or TypeScript agent code using its decorator and middleware APIs directly, independent of any specific framework. Teams using frameworks not yet covered by an official adapter can implement the integration using the core Agent OS API, which is well-documented and designed to be framework-agnostic at its lowest abstraction level. The open-source MIT license also means community-contributed adapters for additional frameworks are possible and welcome.</p>
<p><strong>Q2: How does the sub-5ms policy evaluation performance hold up as policy complexity increases?</strong></p>
<p>Simple YAML policies with straightforward conditional rules evaluate well under 1ms in normal production conditions. Complex OPA Rego policies — particularly those involving recursive rules, large data joins, or many policy conditions evaluated in sequence — may push evaluation time toward the 5ms boundary. Cedar policies run through Cedar&rsquo;s formally optimized evaluator and tend to maintain fast evaluation even for sophisticated authorization logic. Teams with high-throughput agent action streams and complex rulesets should benchmark their specific policy configuration against representative production load in a staging environment before drawing conclusions from the headline figure. The toolkit&rsquo;s documentation provides structured guidance on policy optimization techniques for latency-sensitive deployments.</p>
<p><strong>Q3: Should the toolkit be used alongside prompt-level safety instructions, or does it replace them?</strong></p>
<p>The two approaches address different layers of the agent security stack and are most effective in combination. Prompt-level safety instructions shape the model&rsquo;s general behavior and serve as the first line of defense for a well-aligned agent in normal operating conditions. The Agent Governance Toolkit operates at the code layer and enforces hard limits on what actions can actually be executed, regardless of what the model decides to attempt. Using both layers together produces substantially better outcomes than either approach alone: well-crafted prompt instructions reduce the frequency with which the policy engine sees prohibited action attempts, while the runtime policy enforcement provides a reliable backstop for the violations that occur despite good prompt design.</p>
<p><strong>Q4: How does the toolkit support regulatory compliance requirements such as the EU AI Act?</strong></p>
<p>The toolkit provides the technical foundation for compliance evidence across several dimensions. The policy language and audit logging capabilities allow organizations to demonstrate human oversight, transparency, and risk management controls that regulatory frameworks require for high-risk AI system deployments. By mapping OWASP Agentic AI Top 10 risks to configured policy rules, organizations can trace their compliance posture to a published external standard. The structured audit logs generated for every agent action and policy decision produce the kind of evidence-based documentation that regulators increasingly expect to see. Teams in regulated industries should work with their legal and compliance functions to translate specific regulatory requirements into policy rules, using Cedar&rsquo;s formal verification properties where mathematical proof of policy correctness is required to satisfy an auditor.</p>
<p><strong>Q5: Does the open-source MIT license mean Microsoft could change the terms or direction of the project in ways that create risk for adopters?</strong></p>
<p>The MIT license itself is irrevocable — code already released under MIT remains under MIT regardless of what Microsoft does with the project going forward. Additionally, Microsoft has announced plans to donate the project to a neutral open-source foundation, which would transfer governance of the project&rsquo;s direction to a community body rather than a single corporate sponsor. This mirrors the trajectory of projects like Kubernetes, which moved from Google to the Cloud Native Computing Foundation and subsequently became a de facto industry standard with broad multi-vendor contribution. Until the foundation donation occurs, the open-source codebase can be forked by any organization that needs to maintain an independent version, which is a meaningful risk mitigation for organizations concerned about long-term stewardship.</p>
]]></content:encoded></item><item><title>Microsoft Agent Framework 1.0: Build Production AI Agents in .NET and Python</title><link>https://baeseokjae.github.io/posts/microsoft-agent-framework-1-0-guide-2026/</link><pubDate>Fri, 15 May 2026 00:00:00 +0000</pubDate><guid>https://baeseokjae.github.io/posts/microsoft-agent-framework-1-0-guide-2026/</guid><description>Complete guide to Microsoft Agent Framework 1.0: multi-agent patterns, Azure integration, memory management, observability, and how it compares to LangGraph and AutoGen.</description><content:encoded><![CDATA[<p>Microsoft Agent Framework 1.0 is the official, production-ready framework from Microsoft for building AI agents and multi-agent systems, available natively in both .NET (C#) and Python. Built on top of Semantic Kernel and deeply integrated with the Azure AI ecosystem, it represents the clearest path to deploying enterprise-grade AI agents at scale in 2026.</p>
<h2 id="microsoft-agent-framework-10-the-official-microsoft-path-to-production-ai-agents">Microsoft Agent Framework 1.0: The Official Microsoft Path to Production AI Agents</h2>
<p>Enterprise adoption of Microsoft Agent Framework 1.0 grew 350% between 2025 and 2026, driven by organizations that needed a supported, enterprise-grade runtime for AI agents that integrated natively with their existing Azure and Microsoft 365 infrastructure. Unlike research-originated frameworks that were adapted for production use, Microsoft Agent Framework 1.0 was designed from the start with production requirements in mind: deterministic orchestration, identity-aware execution, structured observability, and deployment primitives that match enterprise operations. The 1.0 milestone signals API stability — Microsoft has committed to a stable public API surface, semantic versioning, and long-term support for both the .NET and Python SDKs. For organizations running workloads on Azure, the framework eliminates the integration tax that comes with open-source alternatives: Azure OpenAI, Azure AI Foundry, Azure Monitor, and Entra ID are all first-class citizens in the framework&rsquo;s configuration model, not afterthoughts bolted on through community plugins. The framework&rsquo;s Semantic Kernel foundation means teams that have already built with Semantic Kernel can adopt it incrementally, migrating plugin-based workflows to full agent orchestration without rewriting existing code.</p>
<p>The 1.0 release also codifies patterns that were previously tribal knowledge among early adopters. The framework ships with reference implementations for common enterprise patterns: approval workflows with human-in-the-loop gates, document processing pipelines with parallel extraction agents, and code review workflows that combine static analysis tools with LLM-based reasoning. These aren&rsquo;t toy examples — they&rsquo;re production patterns extracted from Microsoft&rsquo;s internal deployments and from the early-adopter program that ran throughout 2025.</p>
<h3 id="what-makes-10-different-from-earlier-previews">What Makes 1.0 Different from Earlier Previews</h3>
<p>The preview releases (0.x) validated the agent model and gathered feedback on API ergonomics. The 1.0 release tightens the type system, stabilizes the serialization format for agent state, and introduces the <code>AgentRuntime</code> abstraction that decouples agent logic from the underlying execution environment. This means agent code written against the 1.0 API runs unchanged whether it&rsquo;s hosted in Azure Container Apps, Azure Functions, AKS, or a local development server.</p>
<h2 id="net-and-python-feature-parity-one-framework-two-languages">.NET and Python Feature Parity: One Framework, Two Languages</h2>
<p>Microsoft Agent Framework 1.0 achieves genuine feature parity between its .NET and Python implementations — a deliberate engineering decision that distinguishes it from most AI frameworks, which treat one language as the primary SDK and the other as a secondary binding with missing features. Both implementations expose the same core abstractions: <code>Agent</code>, <code>AgentRuntime</code>, <code>AgentChannel</code>, <code>Tool</code>, <code>Memory</code>, and <code>Orchestrator</code>. Both support the same multi-agent patterns, the same Azure integrations, and the same observability hooks. This means cross-language teams — common in enterprises where backend services mix C# microservices with Python data pipelines — can share agent design patterns, documentation, and even serialized agent state across language boundaries. The .NET SDK targets .NET 8 and .NET 9 with full async/await support throughout. The Python SDK targets Python 3.10 through 3.13 and uses <code>asyncio</code> as its native execution model. Tool definitions written in one language can be described using a shared JSON schema format that the other language can consume, enabling polyglot agent networks where a C# orchestrator delegates to Python specialist agents.</p>
<p>The feature parity commitment extends to release cadence: both SDKs ship simultaneously with the same version numbers, and breaking changes in one language require corresponding changes in the other. This is enforced through a cross-language conformance test suite that runs in CI for every pull request. For enterprise teams evaluating the framework, this means the same architectural decisions — agent topology, memory strategy, tool registry design — apply regardless of which language a given team uses.</p>
<h3 id="net-implementation-type-safe-agents-in-c">.NET Implementation: Type-Safe Agents in C#</h3>
<p>The .NET SDK takes advantage of C#&rsquo;s strong type system to provide compile-time safety for tool definitions and agent messages. Tool interfaces are defined as C# interfaces with method signatures, and the framework generates the JSON schema and function-calling payload automatically from those signatures. This eliminates a common class of runtime errors where tool argument schemas don&rsquo;t match what the LLM sends.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-csharp" data-lang="csharp"><span style="display:flex;"><span><span style="color:#66d9ef">using</span> Microsoft.AgentFramework;
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">using</span> Microsoft.AgentFramework.Tools;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">public</span> <span style="color:#66d9ef">interface</span> <span style="color:#a6e22e">IDocumentTools</span>
</span></span><span style="display:flex;"><span>{
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">    [AgentTool(&#34;search_documents&#34;)]</span>
</span></span><span style="display:flex;"><span>    Task&lt;SearchResult&gt; SearchAsync(<span style="color:#66d9ef">string</span> query, <span style="color:#66d9ef">int</span> maxResults = <span style="color:#ae81ff">10</span>);
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">
</span></span></span><span style="display:flex;"><span><span style="color:#a6e22e">    [AgentTool(&#34;summarize_document&#34;)]</span>
</span></span><span style="display:flex;"><span>    Task&lt;<span style="color:#66d9ef">string</span>&gt; SummarizeAsync(<span style="color:#66d9ef">string</span> documentId, SummaryLength length);
</span></span><span style="display:flex;"><span>}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">var</span> agent = AgentBuilder.Create()
</span></span><span style="display:flex;"><span>    .WithName(<span style="color:#e6db74">&#34;document-agent&#34;</span>)
</span></span><span style="display:flex;"><span>    .WithModel(AzureOpenAIModel.GPT4o)
</span></span><span style="display:flex;"><span>    .WithTools&lt;IDocumentTools&gt;()
</span></span><span style="display:flex;"><span>    .WithMemory(MemoryStrategy.Semantic)
</span></span><span style="display:flex;"><span>    .Build();
</span></span></code></pre></div><h3 id="python-implementation-pythonic-agent-design">Python Implementation: Pythonic Agent Design</h3>
<p>The Python SDK uses dataclasses and type hints to achieve similar type safety with Python idioms. The <code>@tool</code> decorator handles schema generation from Python function signatures, and the <code>Agent</code> class uses keyword arguments that mirror the .NET builder pattern without requiring a builder chain.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#f92672">from</span> microsoft.agent_framework <span style="color:#f92672">import</span> Agent, tool
</span></span><span style="display:flex;"><span><span style="color:#f92672">from</span> microsoft.agent_framework.models <span style="color:#f92672">import</span> AzureOpenAIModel
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">@tool</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">async</span> <span style="color:#66d9ef">def</span> <span style="color:#a6e22e">search_documents</span>(query: str, max_results: int <span style="color:#f92672">=</span> <span style="color:#ae81ff">10</span>) <span style="color:#f92672">-&gt;</span> list[dict]:
</span></span><span style="display:flex;"><span>    <span style="color:#e6db74">&#34;&#34;&#34;Search the internal document store for relevant content.&#34;&#34;&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">...</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">@tool</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">async</span> <span style="color:#66d9ef">def</span> <span style="color:#a6e22e">summarize_document</span>(document_id: str, length: str <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;medium&#34;</span>) <span style="color:#f92672">-&gt;</span> str:
</span></span><span style="display:flex;"><span>    <span style="color:#e6db74">&#34;&#34;&#34;Generate a summary of the specified document.&#34;&#34;&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">...</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>agent <span style="color:#f92672">=</span> Agent(
</span></span><span style="display:flex;"><span>    name<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;document-agent&#34;</span>,
</span></span><span style="display:flex;"><span>    model<span style="color:#f92672">=</span>AzureOpenAIModel<span style="color:#f92672">.</span>GPT4o,
</span></span><span style="display:flex;"><span>    tools<span style="color:#f92672">=</span>[search_documents, summarize_document],
</span></span><span style="display:flex;"><span>    memory<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;semantic&#34;</span>,
</span></span><span style="display:flex;"><span>)
</span></span></code></pre></div><h2 id="multi-agent-patterns-sequential-parallel-and-supervisor-architectures">Multi-Agent Patterns: Sequential, Parallel, and Supervisor Architectures</h2>
<p>Microsoft Agent Framework 1.0 ships four first-class multi-agent orchestration patterns — sequential, parallel, swarm, and supervisor/worker — each suited to different task structures and complexity profiles. Organizations using the framework report a 60% reduction in agent orchestration complexity compared to building equivalent patterns in AutoGen, driven by the framework&rsquo;s declarative pattern DSL and built-in state management. The sequential pattern routes a task through a chain of specialist agents where each agent&rsquo;s output becomes the next agent&rsquo;s input — the right choice for document processing pipelines, code review workflows, and report generation where each step transforms the artifact. The parallel pattern fans a task out to multiple agents simultaneously and merges their outputs — optimal for research tasks where multiple search strategies should run concurrently, or for validation workflows where multiple checkers evaluate the same artifact independently. The swarm pattern enables peer-to-peer agent collaboration without a central coordinator, useful for open-ended research tasks where the best next step isn&rsquo;t known in advance. The supervisor/worker pattern is the most structured: a supervisor agent decomposes a task, assigns subtasks to specialist workers, monitors their progress, and synthesizes results — the right choice when tasks have complex dependency graphs and require dynamic assignment based on agent capabilities.</p>
<p>Choosing the right pattern matters because each has different failure semantics and cost profiles. Sequential pipelines fail fast but have the longest latency. Parallel patterns maximize throughput but incur higher token costs and require a merge strategy. Swarms are flexible but harder to reason about and debug. Supervisors add overhead but provide the most control over complex workflows.</p>
<h3 id="implementing-a-supervisorworker-pattern">Implementing a Supervisor/Worker Pattern</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#f92672">from</span> microsoft.agent_framework <span style="color:#f92672">import</span> SupervisorAgent, WorkerAgent, AgentRuntime
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>research_worker <span style="color:#f92672">=</span> WorkerAgent(
</span></span><span style="display:flex;"><span>    name<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;researcher&#34;</span>,
</span></span><span style="display:flex;"><span>    model<span style="color:#f92672">=</span>AzureOpenAIModel<span style="color:#f92672">.</span>GPT4o,
</span></span><span style="display:flex;"><span>    tools<span style="color:#f92672">=</span>[web_search, fetch_document],
</span></span><span style="display:flex;"><span>    system_message<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;You research topics and return structured findings.&#34;</span>
</span></span><span style="display:flex;"><span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>analysis_worker <span style="color:#f92672">=</span> WorkerAgent(
</span></span><span style="display:flex;"><span>    name<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;analyst&#34;</span>,
</span></span><span style="display:flex;"><span>    model<span style="color:#f92672">=</span>AzureOpenAIModel<span style="color:#f92672">.</span>GPT4o,
</span></span><span style="display:flex;"><span>    tools<span style="color:#f92672">=</span>[run_calculation, query_database],
</span></span><span style="display:flex;"><span>    system_message<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;You analyze data and identify patterns.&#34;</span>
</span></span><span style="display:flex;"><span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>supervisor <span style="color:#f92672">=</span> SupervisorAgent(
</span></span><span style="display:flex;"><span>    name<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;coordinator&#34;</span>,
</span></span><span style="display:flex;"><span>    model<span style="color:#f92672">=</span>AzureOpenAIModel<span style="color:#f92672">.</span>GPT4o,
</span></span><span style="display:flex;"><span>    workers<span style="color:#f92672">=</span>[research_worker, analysis_worker],
</span></span><span style="display:flex;"><span>    max_iterations<span style="color:#f92672">=</span><span style="color:#ae81ff">10</span>,
</span></span><span style="display:flex;"><span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>runtime <span style="color:#f92672">=</span> AgentRuntime()
</span></span><span style="display:flex;"><span>result <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> runtime<span style="color:#f92672">.</span>run(supervisor, task<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;Analyze market trends for Q1 2026&#34;</span>)
</span></span></code></pre></div><h3 id="sequential-and-parallel-orchestrators">Sequential and Parallel Orchestrators</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-csharp" data-lang="csharp"><span style="display:flex;"><span><span style="color:#75715e">// Sequential: each agent processes the output of the previous</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">var</span> pipeline = OrchestratorBuilder.Sequential()
</span></span><span style="display:flex;"><span>    .AddAgent(extractionAgent)
</span></span><span style="display:flex;"><span>    .AddAgent(validationAgent)
</span></span><span style="display:flex;"><span>    .AddAgent(enrichmentAgent)
</span></span><span style="display:flex;"><span>    .Build();
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// Parallel: all agents process the same input simultaneously</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">var</span> parallel = OrchestratorBuilder.Parallel()
</span></span><span style="display:flex;"><span>    .AddAgent(sentimentAgent)
</span></span><span style="display:flex;"><span>    .AddAgent(entityAgent)
</span></span><span style="display:flex;"><span>    .AddAgent(topicAgent)
</span></span><span style="display:flex;"><span>    .WithMergeStrategy(MergeStrategy.Aggregate)
</span></span><span style="display:flex;"><span>    .Build();
</span></span></code></pre></div><h2 id="azure-integration-openai-ai-foundry-and-entra-id-for-enterprise">Azure Integration: OpenAI, AI Foundry, and Entra ID for Enterprise</h2>
<p>Azure integration is where Microsoft Agent Framework 1.0 creates the clearest separation from open-source alternatives — enterprises adopting the framework report that Azure-native connectivity eliminates an average of 8 weeks of integration work that would otherwise be required to connect agent workloads to existing cloud infrastructure. Azure OpenAI integration is handled through the framework&rsquo;s model configuration layer: you point the framework at your Azure OpenAI endpoint, and all agents in the runtime use that connection with automatic token counting, retry logic with exponential backoff, and streaming support for long-running responses. Azure AI Foundry integration goes further: agents can be registered in AI Foundry&rsquo;s agent catalog, which enables centralized governance over which models and tools each agent can access, and provides the deployment artifacts needed to move from development to production without manual packaging. Azure Cognitive Services integration covers document intelligence, speech, and vision through pre-built tool wrappers — you don&rsquo;t write Azure SDK calls directly, you register the service as a tool and the framework handles authentication, request formatting, and response parsing.</p>
<p>Entra ID integration is the enterprise differentiator that matters most for security teams. Every agent in the framework has an Entra ID identity — either a managed identity for Azure-hosted deployments or a service principal for on-premises or hybrid deployments. This means agent actions appear in Azure audit logs with the agent&rsquo;s identity, not a generic service account. Role-based access control applies to agent tool calls: a research agent can be granted read-only access to SharePoint while a workflow agent has write access to Dynamics 365, and these permissions are enforced at the identity layer rather than in application code.</p>
<h3 id="configuring-azure-openai-and-entra-id">Configuring Azure OpenAI and Entra ID</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#f92672">from</span> microsoft.agent_framework.azure <span style="color:#f92672">import</span> AzureAgentRuntime, EntraIdCredential
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>credential <span style="color:#f92672">=</span> EntraIdCredential(
</span></span><span style="display:flex;"><span>    tenant_id<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;your-tenant-id&#34;</span>,
</span></span><span style="display:flex;"><span>    client_id<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;your-client-id&#34;</span>,
</span></span><span style="display:flex;"><span>    <span style="color:#75715e"># Uses managed identity in Azure, service principal locally</span>
</span></span><span style="display:flex;"><span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>runtime <span style="color:#f92672">=</span> AzureAgentRuntime(
</span></span><span style="display:flex;"><span>    azure_openai_endpoint<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;https://your-resource.openai.azure.com/&#34;</span>,
</span></span><span style="display:flex;"><span>    deployment_name<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;gpt-4o&#34;</span>,
</span></span><span style="display:flex;"><span>    credential<span style="color:#f92672">=</span>credential,
</span></span><span style="display:flex;"><span>    ai_foundry_project<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;your-project-name&#34;</span>,
</span></span><span style="display:flex;"><span>)
</span></span></code></pre></div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-csharp" data-lang="csharp"><span style="display:flex;"><span><span style="color:#66d9ef">var</span> credential = <span style="color:#66d9ef">new</span> EntraIdCredential(
</span></span><span style="display:flex;"><span>    tenantId: configuration[<span style="color:#e6db74">&#34;Azure:TenantId&#34;</span>],
</span></span><span style="display:flex;"><span>    clientId: configuration[<span style="color:#e6db74">&#34;Azure:ClientId&#34;</span>]
</span></span><span style="display:flex;"><span>);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">var</span> runtime = AzureAgentRuntimeBuilder.Create()
</span></span><span style="display:flex;"><span>    .WithAzureOpenAI(
</span></span><span style="display:flex;"><span>        endpoint: configuration[<span style="color:#e6db74">&#34;Azure:OpenAI:Endpoint&#34;</span>],
</span></span><span style="display:flex;"><span>        deployment: <span style="color:#e6db74">&#34;gpt-4o&#34;</span>,
</span></span><span style="display:flex;"><span>        credential: credential)
</span></span><span style="display:flex;"><span>    .WithAIFoundry(projectName: configuration[<span style="color:#e6db74">&#34;Azure:AIFoundry:Project&#34;</span>])
</span></span><span style="display:flex;"><span>    .WithEntraIdIdentity(managedIdentityEnabled: <span style="color:#66d9ef">true</span>)
</span></span><span style="display:flex;"><span>    .Build();
</span></span></code></pre></div><h2 id="memory-management-conversation-semantic-and-episodic-memory">Memory Management: Conversation, Semantic, and Episodic Memory</h2>
<p>Memory management in Microsoft Agent Framework 1.0 is a three-layer system — conversation history, semantic memory using embeddings, and episodic memory for task-level recall — with each layer serving a distinct purpose and carrying different cost and latency trade-offs that teams must understand to build performant agents. Conversation history is the simplest layer: a rolling buffer of messages exchanged in the current session, managed automatically by the framework with configurable window sizes and token budget limits. When the conversation history exceeds the configured token budget, the framework applies a summarization strategy to compress older turns while preserving key facts — this is handled transparently without application code changes. Semantic memory uses embedding models to store and retrieve facts across sessions: when an agent learns something important — a user&rsquo;s preference, a domain fact, a resolved ambiguity — it can write that to semantic memory, and future agents can retrieve relevant memories using vector similarity search against Azure AI Search. Episodic memory tracks task-level context: what tasks have been attempted, what outcomes were achieved, and what strategies failed — enabling agents to avoid repeating mistakes across multiple invocations of the same workflow.</p>
<p>The three memory layers are independently configurable. A lightweight query-answering agent might use only conversation history with a 4,096-token window. A long-running research agent might use all three layers. A stateless API handler might disable memory entirely and rely on the caller to pass context. The framework&rsquo;s <code>MemoryConfiguration</code> class provides a fluent API for expressing these trade-offs explicitly.</p>
<h3 id="configuring-multi-layer-memory">Configuring Multi-Layer Memory</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#f92672">from</span> microsoft.agent_framework.memory <span style="color:#f92672">import</span> MemoryConfiguration, AzureAISearchSemanticStore
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>memory_config <span style="color:#f92672">=</span> MemoryConfiguration(
</span></span><span style="display:flex;"><span>    conversation<span style="color:#f92672">=</span>ConversationMemory(
</span></span><span style="display:flex;"><span>        max_tokens<span style="color:#f92672">=</span><span style="color:#ae81ff">8192</span>,
</span></span><span style="display:flex;"><span>        compression_strategy<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;summarize&#34;</span>,
</span></span><span style="display:flex;"><span>    ),
</span></span><span style="display:flex;"><span>    semantic<span style="color:#f92672">=</span>SemanticMemory(
</span></span><span style="display:flex;"><span>        store<span style="color:#f92672">=</span>AzureAISearchSemanticStore(
</span></span><span style="display:flex;"><span>            endpoint<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;https://your-search.search.windows.net&#34;</span>,
</span></span><span style="display:flex;"><span>            index_name<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;agent-memories&#34;</span>,
</span></span><span style="display:flex;"><span>            credential<span style="color:#f92672">=</span>credential,
</span></span><span style="display:flex;"><span>        ),
</span></span><span style="display:flex;"><span>        embedding_model<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;text-embedding-3-large&#34;</span>,
</span></span><span style="display:flex;"><span>        top_k<span style="color:#f92672">=</span><span style="color:#ae81ff">5</span>,
</span></span><span style="display:flex;"><span>    ),
</span></span><span style="display:flex;"><span>    episodic<span style="color:#f92672">=</span>EpisodicMemory(
</span></span><span style="display:flex;"><span>        retention_days<span style="color:#f92672">=</span><span style="color:#ae81ff">30</span>,
</span></span><span style="display:flex;"><span>        max_episodes_per_agent<span style="color:#f92672">=</span><span style="color:#ae81ff">1000</span>,
</span></span><span style="display:flex;"><span>    ),
</span></span><span style="display:flex;"><span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>agent <span style="color:#f92672">=</span> Agent(name<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;research-agent&#34;</span>, model<span style="color:#f92672">=</span>model, memory<span style="color:#f92672">=</span>memory_config)
</span></span></code></pre></div><h3 id="writing-and-reading-semantic-memories">Writing and Reading Semantic Memories</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-csharp" data-lang="csharp"><span style="display:flex;"><span><span style="color:#75715e">// Write a fact to semantic memory during agent execution</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">await</span> agent.Memory.Semantic.WriteAsync(<span style="color:#66d9ef">new</span> MemoryRecord
</span></span><span style="display:flex;"><span>{
</span></span><span style="display:flex;"><span>    Content = <span style="color:#e6db74">&#34;User prefers executive summaries under 200 words&#34;</span>,
</span></span><span style="display:flex;"><span>    Tags = [<span style="color:#e6db74">&#34;user-preference&#34;</span>, <span style="color:#e6db74">&#34;formatting&#34;</span>],
</span></span><span style="display:flex;"><span>    Importance = MemoryImportance.High,
</span></span><span style="display:flex;"><span>});
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// Retrieve relevant memories before processing a request</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">var</span> relevant = <span style="color:#66d9ef">await</span> agent.Memory.Semantic.SearchAsync(
</span></span><span style="display:flex;"><span>    query: <span style="color:#e6db74">&#34;how should I format this response?&#34;</span>,
</span></span><span style="display:flex;"><span>    topK: <span style="color:#ae81ff">3</span>
</span></span><span style="display:flex;"><span>);
</span></span></code></pre></div><h2 id="observability-and-monitoring-opentelemetry-and-azure-monitor">Observability and Monitoring: OpenTelemetry and Azure Monitor</h2>
<p>Observability in Microsoft Agent Framework 1.0 is built on OpenTelemetry, meaning agent traces, metrics, and logs flow into any OpenTelemetry-compatible backend — Jaeger, Grafana Tempo, Honeycomb, Datadog — while also having first-class support for Azure Monitor and Application Insights through a dedicated exporter that enriches traces with Azure-specific metadata. Production deployments show that teams with full observability configured identify and resolve agent misbehavior an average of 4x faster than teams relying on application logs alone, because the framework&rsquo;s automatic instrumentation captures the full reasoning chain — every LLM call, every tool invocation, every memory read/write — as structured spans with timing, token counts, and model responses. Every agent execution produces a root span that contains child spans for each processing step. Tool calls are recorded as spans with the tool name, input arguments (with configurable PII masking), and the raw output. Memory operations record hit/miss rates and retrieval latency. LLM calls record prompt token counts, completion token counts, finish reasons, and latency — giving cost attribution at the individual agent level. The framework ships with a Grafana dashboard template and an Azure Monitor workbook that visualize these metrics out of the box.</p>
<p>Configuring OpenTelemetry is a one-time setup at the runtime level. All agents registered with the runtime automatically inherit the observability configuration without per-agent setup code.</p>
<h3 id="opentelemetry-and-azure-monitor-setup">OpenTelemetry and Azure Monitor Setup</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#f92672">from</span> opentelemetry <span style="color:#f92672">import</span> trace
</span></span><span style="display:flex;"><span><span style="color:#f92672">from</span> opentelemetry.sdk.trace <span style="color:#f92672">import</span> TracerProvider
</span></span><span style="display:flex;"><span><span style="color:#f92672">from</span> opentelemetry.sdk.trace.export <span style="color:#f92672">import</span> BatchSpanProcessor
</span></span><span style="display:flex;"><span><span style="color:#f92672">from</span> azure.monitor.opentelemetry.exporter <span style="color:#f92672">import</span> AzureMonitorTraceExporter
</span></span><span style="display:flex;"><span><span style="color:#f92672">from</span> microsoft.agent_framework.observability <span style="color:#f92672">import</span> AgentFrameworkInstrumentation
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># Configure OpenTelemetry with Azure Monitor</span>
</span></span><span style="display:flex;"><span>exporter <span style="color:#f92672">=</span> AzureMonitorTraceExporter(
</span></span><span style="display:flex;"><span>    connection_string<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;InstrumentationKey=your-key;...&#34;</span>
</span></span><span style="display:flex;"><span>)
</span></span><span style="display:flex;"><span>provider <span style="color:#f92672">=</span> TracerProvider()
</span></span><span style="display:flex;"><span>provider<span style="color:#f92672">.</span>add_span_processor(BatchSpanProcessor(exporter))
</span></span><span style="display:flex;"><span>trace<span style="color:#f92672">.</span>set_tracer_provider(provider)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># Instrument the agent framework</span>
</span></span><span style="display:flex;"><span>AgentFrameworkInstrumentation()<span style="color:#f92672">.</span>instrument()
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># Runtime automatically captures all agent activity as traces</span>
</span></span><span style="display:flex;"><span>runtime <span style="color:#f92672">=</span> AzureAgentRuntime(<span style="color:#f92672">...</span>)
</span></span></code></pre></div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-csharp" data-lang="csharp"><span style="display:flex;"><span><span style="color:#75715e">// .NET: configure via the standard OpenTelemetry builder pattern</span>
</span></span><span style="display:flex;"><span>services.AddOpenTelemetry()
</span></span><span style="display:flex;"><span>    .WithTracing(tracing =&gt; tracing
</span></span><span style="display:flex;"><span>        .AddAgentFrameworkInstrumentation()
</span></span><span style="display:flex;"><span>        .AddAzureMonitorTraceExporter(options =&gt;
</span></span><span style="display:flex;"><span>        {
</span></span><span style="display:flex;"><span>            options.ConnectionString = configuration[<span style="color:#e6db74">&#34;ApplicationInsights:ConnectionString&#34;</span>];
</span></span><span style="display:flex;"><span>        }));
</span></span></code></pre></div><h3 id="what-gets-traced-automatically">What Gets Traced Automatically</h3>
<p>The framework traces the following without any application code changes: agent invocation start/end with task description, LLM calls with model name, deployment, and token usage, tool calls with name, arguments, and results, memory operations (read/write/search) with latency, orchestrator routing decisions and agent assignments, and exception traces with the full agent context at the time of failure.</p>
<h2 id="microsoft-agent-framework-vs-langgraph-vs-autogen">Microsoft Agent Framework vs LangGraph vs AutoGen</h2>
<p>Microsoft Agent Framework 1.0, LangGraph, and AutoGen occupy different positions in the agent framework landscape — choosing the right one depends primarily on your language ecosystem, existing infrastructure, and whether you need research flexibility or production stability. Microsoft Agent Framework 1.0 is the right choice for organizations running on Azure with .NET or Python workloads that need enterprise identity, governance, and Microsoft-supported SLAs. LangGraph is the right choice for Python and JavaScript shops that need maximum flexibility in graph-based workflow design and already use the LangChain ecosystem. AutoGen, now maintained by the ag2ai community as AG2, remains a strong choice for research-oriented teams that need free-form conversational multi-agent patterns and prioritize community-driven development over commercial support. The most significant differentiator between Microsoft Agent Framework 1.0 and AutoGen is the 60% reduction in orchestration complexity that production deployments report — MAF 1.0 replaces AutoGen&rsquo;s conversational routing model with declarative orchestration patterns that eliminate the class of bugs that arise when LLM-based routing makes unexpected decisions about which agent handles which message.</p>
<table>
  <thead>
      <tr>
          <th>Dimension</th>
          <th>Microsoft Agent Framework 1.0</th>
          <th>LangGraph</th>
          <th>AutoGen (AG2)</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Primary language</td>
          <td>.NET + Python (parity)</td>
          <td>Python + JavaScript</td>
          <td>Python</td>
      </tr>
      <tr>
          <td>.NET support</td>
          <td>Native, first-class</td>
          <td>Not supported</td>
          <td>Not supported</td>
      </tr>
      <tr>
          <td>Azure integration</td>
          <td>Native, identity-aware</td>
          <td>Via community plugins</td>
          <td>Via community plugins</td>
      </tr>
      <tr>
          <td>Orchestration model</td>
          <td>Declarative patterns</td>
          <td>Graph-based</td>
          <td>Conversational</td>
      </tr>
      <tr>
          <td>Enterprise support</td>
          <td>Microsoft commercial support</td>
          <td>LangChain community</td>
          <td>ag2ai community</td>
      </tr>
      <tr>
          <td>Identity/auth</td>
          <td>Entra ID native</td>
          <td>Manual</td>
          <td>Manual</td>
      </tr>
      <tr>
          <td>Observability</td>
          <td>OpenTelemetry + Azure Monitor</td>
          <td>LangSmith + OTEL</td>
          <td>Custom + OTEL</td>
      </tr>
      <tr>
          <td>AutoGen compatibility</td>
          <td>Supersedes AutoGen</td>
          <td>Independent lineage</td>
          <td>Fork of AutoGen</td>
      </tr>
      <tr>
          <td>Best for</td>
          <td>Azure enterprise, .NET teams</td>
          <td>Python/JS flexibility</td>
          <td>Research, experimentation</td>
      </tr>
  </tbody>
</table>
<h3 id="when-to-choose-langgraph-instead">When to Choose LangGraph Instead</h3>
<p>LangGraph&rsquo;s graph-based state machine model gives developers more fine-grained control over exactly how state flows between nodes. If your workflow has complex conditional branching that depends on the full state of the graph — not just the previous agent&rsquo;s output — LangGraph&rsquo;s explicit state graph may be easier to reason about than the framework&rsquo;s orchestrator patterns. LangGraph also has a larger community of Python-focused practitioners and more third-party integrations with Python-native tools. The trade-off is that LangGraph requires manual Azure integration and doesn&rsquo;t have native Entra ID support.</p>
<h3 id="autogen-migration-path">AutoGen Migration Path</h3>
<p>For teams already running AutoGen (AG2) in production, Microsoft Agent Framework 1.0 provides a migration path rather than a hard cut-over. The framework&rsquo;s <code>AutoGenCompatibilityLayer</code> package translates AutoGen&rsquo;s <code>AssistantAgent</code> and <code>UserProxyAgent</code> primitives into Agent Framework agents, allowing incremental migration. Teams typically migrate the orchestration layer first — replacing GroupChat with a Supervisor pattern — and then migrate individual agents as they&rsquo;re updated.</p>
<h2 id="getting-started-your-first-agent-in-15-minutes">Getting Started: Your First Agent in 15 Minutes</h2>
<p>Getting a working agent running with Microsoft Agent Framework 1.0 takes under 15 minutes with either SDK, and the fastest path uses a local development runtime that doesn&rsquo;t require Azure credentials — making it accessible to developers who want to evaluate the framework before provisioning cloud resources. The local runtime uses OpenAI directly (or any OpenAI-compatible endpoint) and writes agent traces to the console, giving a full observability picture without any cloud setup. Once the local prototype works, switching to the Azure runtime is a configuration change, not a code change — the same agent definitions, tool implementations, and memory configurations work unchanged against both runtimes. The only difference is the runtime instantiation block at the top of your application. This design choice — local-first development with a clean path to production — reflects the framework&rsquo;s philosophy: developer experience and production deployability should not be in tension. The following walkthroughs cover the complete path from zero to a running agent in both Python and .NET.</p>
<h3 id="python-install-and-first-agent">Python: Install and First Agent</h3>
<p>Install the package:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>pip install microsoft-agent-framework
</span></span></code></pre></div><p>Create <code>first_agent.py</code>:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#f92672">import</span> asyncio
</span></span><span style="display:flex;"><span><span style="color:#f92672">from</span> microsoft.agent_framework <span style="color:#f92672">import</span> Agent, AgentRuntime, tool
</span></span><span style="display:flex;"><span><span style="color:#f92672">from</span> microsoft.agent_framework.models <span style="color:#f92672">import</span> OpenAIModel
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">@tool</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">async</span> <span style="color:#66d9ef">def</span> <span style="color:#a6e22e">get_current_time</span>(timezone: str <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;UTC&#34;</span>) <span style="color:#f92672">-&gt;</span> str:
</span></span><span style="display:flex;"><span>    <span style="color:#e6db74">&#34;&#34;&#34;Return the current time in the specified timezone.&#34;&#34;&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">from</span> datetime <span style="color:#f92672">import</span> datetime, timezone <span style="color:#66d9ef">as</span> tz
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">import</span> pytz
</span></span><span style="display:flex;"><span>    local_tz <span style="color:#f92672">=</span> pytz<span style="color:#f92672">.</span>timezone(timezone)
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">return</span> datetime<span style="color:#f92672">.</span>now(local_tz)<span style="color:#f92672">.</span>strftime(<span style="color:#e6db74">&#34;%Y-%m-</span><span style="color:#e6db74">%d</span><span style="color:#e6db74"> %H:%M:%S %Z&#34;</span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">@tool</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">async</span> <span style="color:#66d9ef">def</span> <span style="color:#a6e22e">calculate</span>(expression: str) <span style="color:#f92672">-&gt;</span> str:
</span></span><span style="display:flex;"><span>    <span style="color:#e6db74">&#34;&#34;&#34;Evaluate a mathematical expression safely.&#34;&#34;&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">try</span>:
</span></span><span style="display:flex;"><span>        result <span style="color:#f92672">=</span> eval(expression, {<span style="color:#e6db74">&#34;__builtins__&#34;</span>: {}}, {})
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">return</span> str(result)
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">except</span> <span style="color:#a6e22e">Exception</span> <span style="color:#66d9ef">as</span> e:
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">return</span> <span style="color:#e6db74">f</span><span style="color:#e6db74">&#34;Error: </span><span style="color:#e6db74">{</span>e<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>agent <span style="color:#f92672">=</span> Agent(
</span></span><span style="display:flex;"><span>    name<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;assistant&#34;</span>,
</span></span><span style="display:flex;"><span>    model<span style="color:#f92672">=</span>OpenAIModel(model<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;gpt-4o&#34;</span>, api_key<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;your-openai-key&#34;</span>),
</span></span><span style="display:flex;"><span>    tools<span style="color:#f92672">=</span>[get_current_time, calculate],
</span></span><span style="display:flex;"><span>    system_message<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;You are a helpful assistant with access to the current time and a calculator.&#34;</span>,
</span></span><span style="display:flex;"><span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">async</span> <span style="color:#66d9ef">def</span> <span style="color:#a6e22e">main</span>():
</span></span><span style="display:flex;"><span>    runtime <span style="color:#f92672">=</span> AgentRuntime()
</span></span><span style="display:flex;"><span>    result <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> runtime<span style="color:#f92672">.</span>run(agent, task<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;What time is it in Tokyo, and what is 42 * 1337?&#34;</span>)
</span></span><span style="display:flex;"><span>    print(result<span style="color:#f92672">.</span>content)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>asyncio<span style="color:#f92672">.</span>run(main())
</span></span></code></pre></div><p>Run it:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>python first_agent.py
</span></span></code></pre></div><h3 id="net-install-and-first-agent">.NET: Install and First Agent</h3>
<p>Create a new console project and add the package:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>dotnet new console -n FirstAgent
</span></span><span style="display:flex;"><span>cd FirstAgent
</span></span><span style="display:flex;"><span>dotnet add package Microsoft.AgentFramework
</span></span></code></pre></div><p>Replace <code>Program.cs</code>:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-csharp" data-lang="csharp"><span style="display:flex;"><span><span style="color:#66d9ef">using</span> Microsoft.AgentFramework;
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">using</span> Microsoft.AgentFramework.Models;
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">using</span> Microsoft.AgentFramework.Tools;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// Define tools using the AgentTool attribute</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">public</span> <span style="color:#66d9ef">static</span> <span style="color:#66d9ef">class</span> <span style="color:#a6e22e">AssistantTools</span>
</span></span><span style="display:flex;"><span>{
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">    [AgentTool(&#34;get_current_time&#34;)]</span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">public</span> <span style="color:#66d9ef">static</span> Task&lt;<span style="color:#66d9ef">string</span>&gt; GetCurrentTimeAsync(<span style="color:#66d9ef">string</span> timezone = <span style="color:#e6db74">&#34;UTC&#34;</span>)
</span></span><span style="display:flex;"><span>    {
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">var</span> tz = TimeZoneInfo.FindSystemTimeZoneById(timezone);
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">var</span> time = TimeZoneInfo.ConvertTime(DateTime.UtcNow, tz);
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">return</span> Task.FromResult(time.ToString(<span style="color:#e6db74">&#34;yyyy-MM-dd HH:mm:ss zzz&#34;</span>));
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">
</span></span></span><span style="display:flex;"><span><span style="color:#a6e22e">    [AgentTool(&#34;calculate&#34;)]</span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">public</span> <span style="color:#66d9ef">static</span> Task&lt;<span style="color:#66d9ef">string</span>&gt; CalculateAsync(<span style="color:#66d9ef">string</span> expression)
</span></span><span style="display:flex;"><span>    {
</span></span><span style="display:flex;"><span>        <span style="color:#75715e">// Use a safe expression evaluator in production</span>
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">return</span> Task.FromResult(<span style="color:#e6db74">$&#34;Result: {expression} (implement safe eval)&#34;</span>);
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">var</span> agent = AgentBuilder.Create()
</span></span><span style="display:flex;"><span>    .WithName(<span style="color:#e6db74">&#34;assistant&#34;</span>)
</span></span><span style="display:flex;"><span>    .WithModel(<span style="color:#66d9ef">new</span> OpenAIModel(<span style="color:#e6db74">&#34;gpt-4o&#34;</span>, apiKey: <span style="color:#e6db74">&#34;your-openai-key&#34;</span>))
</span></span><span style="display:flex;"><span>    .WithToolsFromType&lt;AssistantTools&gt;()
</span></span><span style="display:flex;"><span>    .WithSystemMessage(<span style="color:#e6db74">&#34;You are a helpful assistant with access to time and calculator tools.&#34;</span>)
</span></span><span style="display:flex;"><span>    .Build();
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">var</span> runtime = <span style="color:#66d9ef">new</span> AgentRuntime();
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">var</span> result = <span style="color:#66d9ef">await</span> runtime.RunAsync(
</span></span><span style="display:flex;"><span>    agent,
</span></span><span style="display:flex;"><span>    task: <span style="color:#e6db74">&#34;What time is it in Tokyo, and what is 42 * 1337?&#34;</span>
</span></span><span style="display:flex;"><span>);
</span></span><span style="display:flex;"><span>Console.WriteLine(result.Content);
</span></span></code></pre></div><p>Run it:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>dotnet run
</span></span></code></pre></div><h3 id="moving-to-azure">Moving to Azure</h3>
<p>Switching from local OpenAI to Azure is a runtime configuration change:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#f92672">from</span> microsoft.agent_framework.azure <span style="color:#f92672">import</span> AzureAgentRuntime
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># Replace AgentRuntime() with:</span>
</span></span><span style="display:flex;"><span>runtime <span style="color:#f92672">=</span> AzureAgentRuntime(
</span></span><span style="display:flex;"><span>    azure_openai_endpoint<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;https://your-resource.openai.azure.com/&#34;</span>,
</span></span><span style="display:flex;"><span>    deployment_name<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;gpt-4o&#34;</span>,
</span></span><span style="display:flex;"><span>    credential<span style="color:#f92672">=</span>DefaultAzureCredential(),  <span style="color:#75715e"># Uses managed identity in Azure</span>
</span></span><span style="display:flex;"><span>)
</span></span></code></pre></div><p>The agent definition, tools, and memory configuration stay exactly the same.</p>
<hr>
<h2 id="frequently-asked-questions">Frequently Asked Questions</h2>
<p><strong>Q: Does Microsoft Agent Framework 1.0 require an Azure subscription to use?</strong></p>
<p>No. The framework supports a local development runtime that works with any OpenAI-compatible API endpoint — including the OpenAI API directly, Ollama for local models, and Azure OpenAI. Azure integration is available and recommended for production deployments, but it is not required to evaluate the framework or run it in development. The local runtime provides the same agent abstractions and observability features as the Azure runtime, making it easy to develop locally and deploy to Azure without code changes.</p>
<p><strong>Q: How does Microsoft Agent Framework 1.0 relate to Semantic Kernel?</strong></p>
<p>Microsoft Agent Framework 1.0 is built on top of Semantic Kernel, Microsoft&rsquo;s LLM orchestration library. Semantic Kernel provides the foundation: the model abstraction layer, plugin system, memory connectors, and planner primitives. Agent Framework adds the agent and multi-agent orchestration layer on top: the <code>Agent</code>, <code>AgentRuntime</code>, multi-agent patterns (sequential, parallel, supervisor), Entra ID identity integration, and Azure deployment targets. Teams that have existing Semantic Kernel code can adopt Agent Framework incrementally — existing Semantic Kernel plugins become Agent Framework tools with minimal changes.</p>
<p><strong>Q: What is the migration path from AutoGen or AG2 to Microsoft Agent Framework 1.0?</strong></p>
<p>Microsoft provides an <code>AutoGenCompatibilityLayer</code> package that wraps AutoGen&rsquo;s <code>AssistantAgent</code> and <code>UserProxyAgent</code> classes to run within the Agent Framework runtime. This enables incremental migration: you can move the orchestration layer to Agent Framework&rsquo;s supervisor/worker pattern while keeping individual agents in AutoGen format temporarily. The recommended migration sequence is: (1) adopt Agent Framework runtime with the compatibility layer, (2) migrate individual agents from AutoGen format to native Agent Framework agents, (3) replace GroupChat patterns with Agent Framework orchestrators, and (4) add Azure integration and observability. Most teams complete migration in 4 to 8 weeks depending on the size of their existing agent codebase.</p>
<p><strong>Q: How does Entra ID integration work for agents deployed in non-Azure environments?</strong></p>
<p>Agents running outside Azure — on-premises, in another cloud, or in a developer&rsquo;s local environment — can use Entra ID service principals instead of managed identities. The framework&rsquo;s <code>EntraIdCredential</code> class handles both cases: in Azure, it automatically uses the managed identity assigned to the compute resource; outside Azure, it reads service principal credentials from environment variables or a configured credential store. The agent code does not change between environments — only the credential source changes. This enables the same Entra ID governance policies to apply to agents regardless of where they run.</p>
<p><strong>Q: What deployment targets does Microsoft Agent Framework 1.0 support?</strong></p>
<p>The framework supports three primary Azure deployment targets: Azure Container Apps (recommended for most production workloads — provides automatic scaling, built-in HTTP ingress, and managed certificates), Azure Kubernetes Service (recommended for teams that need custom networking, multi-region deployments, or tight control over resource allocation), and Azure Functions (recommended for event-driven agents that run in response to triggers like queue messages, HTTP requests, or timer events). The framework ships deployment templates for all three targets in both Bicep and Terraform formats. On-premises deployment is supported using the framework&rsquo;s generic HTTP hosting mode, which exposes agents as standard REST endpoints compatible with any reverse proxy or service mesh.</p>
]]></content:encoded></item></channel></rss>