{"id":5717,"date":"2026-07-22T01:54:03","date_gmt":"2026-07-22T08:54:03","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/agent-framework\/?p=5717"},"modified":"2026-07-22T01:54:03","modified_gmt":"2026-07-22T08:54:03","slug":"the-microsoft-agent-framework-harness-is-now-released","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/agent-framework\/the-microsoft-agent-framework-harness-is-now-released\/","title":{"rendered":"The Microsoft Agent Framework Harness is now released"},"content":{"rendered":"<p>Your agents can now be built on a <strong>stable, batteries-included harness<\/strong> &#8211; the loop, planning, memory, context management, approvals, and telemetry that turn a model into an agent that actually <em>does<\/em> things &#8211; in both <strong>Python<\/strong> and <strong>.NET<\/strong>.<\/p>\n<h2 id=\"what-is-an-agent-harness\">What is an agent harness?<\/h2>\n<p>An <em>agent harness<\/em> is the scaffolding that turns a language model into an agent. A model on its own can only generate text. To have it call tools, work through multi-step tasks, remember what it has done, and keep going until the job is finished, you need a runtime wrapped around the model &#8211; and that runtime is the harness.<\/p>\n<p>Agent Framework ships a ready-made one so you don&#8217;t have to build that scaffolding yourself. It&#8217;s an opinionated, fully customizable, batteries-included agent that wraps a chat client with a complete agentic pipeline, tuned for long-running, autonomous work such as research, data analysis, and general task automation. Internally it&#8217;s just a chat-client agent (<code>Agent<\/code> in Python, <code>ChatClientAgent<\/code> in .NET) with a curated set of Agent Framework features added &#8211; each enabled by default and individually customizable or removable:<\/p>\n<ul>\n<li><strong>Function invocation<\/strong> &#8211; the automatic tool-calling loop, with a configurable iteration limit.<\/li>\n<li><strong>Per-service-call history persistence<\/strong> &#8211; chat history saved after every model call for crash<\/li>\n<\/ul>\n<p>recovery and mid-run inspection.<\/p>\n<ul>\n<li><strong>Compaction<\/strong> &#8211; context-window management so long tool-calling loops don&#8217;t overflow.<\/li>\n<li><strong>Todo &amp; agent-mode providers<\/strong> &#8211; a persistent todo list plus plan\/execute mode tracking, so the agent plans work then executes it.<\/li>\n<\/ul>\n<ul>\n<li><strong>File memory<\/strong> &#8211; durable session notes and artifacts that survive across turns.<\/li>\n<li><strong>Skills<\/strong> &#8211; progressive discovery and loading of packaged domain expertise.<\/li>\n<li><strong>Web search<\/strong> &#8211; enables the inference service&#8217;s built-in web search tool, when the underlying service provides one, so the agent can ground answers in current information.<\/li>\n<\/ul>\n<ul>\n<li><strong>Tool approval<\/strong> &#8211; &#8220;don&#8217;t ask again&#8221; standing rules plus heuristic auto-approval for safe calls.<\/li>\n<li><strong>Telemetry<\/strong> &#8211; built-in OpenTelemetry.<\/li>\n<\/ul>\n<p>You supply your own chat client and only configure what makes the agent <em>yours<\/em> &#8211; its instructions and its tools. Everything else has a sensible default.<\/p>\n<h2 id=\"what-you-can-do-with-it\">What you can do with it<\/h2>\n<p>Here are some examples of the types of agents you can build with it:<\/p>\n<ul>\n<li><strong>Research assistants<\/strong> that plan a topic into todos, switch between plan and execute modes, search the web, and work autonomously through the plan.<\/li>\n<\/ul>\n<ul>\n<li><strong>Data-processing agents<\/strong> that read and analyze a folder of files with approval-gated file tools.<\/li>\n<li><strong>Domain assistants<\/strong> &#8211; like a personal-finance &#8220;claw&#8221; &#8211; that combine custom tools, memory, skills, and planning into a single agent you can grow feature by feature.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2026\/07\/harness-research-demo.gif\"><img decoding=\"async\" class=\"size-full wp-image-5728 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-content\/uploads\/sites\/78\/2026\/07\/harness-research-demo.gif\" alt=\"Harness Research Demo\" width=\"1280\" height=\"720\" \/><\/a><\/p>\n<h2 id=\"a-basic-harness-agent\">A basic harness agent<\/h2>\n<p>The harness collapses the whole pipeline into a single call. You bring a chat client, instructions, and (optionally) custom tools; the harness adds function invocation, planning, history persistence, compaction, approvals, web search, and telemetry.<\/p>\n<p><strong>.NET<\/strong><\/p>\n<pre><code class=\"language-csharp\">using Azure.AI.Projects;\r\nusing Azure.Identity;\r\nusing Microsoft.Agents.AI;\r\nusing Microsoft.Extensions.AI;\r\n\r\nvar endpoint = Environment.GetEnvironmentVariable(\"FOUNDRY_PROJECT_ENDPOINT\")\r\n    ?? throw new InvalidOperationException(\"FOUNDRY_PROJECT_ENDPOINT is not set.\");\r\nvar deploymentName = Environment.GetEnvironmentVariable(\"FOUNDRY_MODEL\") ?? \"gpt-5.4\";\r\n\r\n\/\/ Build an IChatClient backed by a Microsoft Foundry project...\r\nIChatClient chatClient =\r\n    new AIProjectClient(new Uri(endpoint), new DefaultAzureCredential())\r\n        .GetProjectOpenAIClient()\r\n        .GetResponsesClient()\r\n        .AsIChatClient(deploymentName);\r\n\r\n\/\/ ...then wrap it in the harness. One call gives you the full agentic pipeline.\r\nAIAgent agent = chatClient.AsHarnessAgent(new HarnessAgentOptions\r\n{\r\n    ChatOptions = new ChatOptions\r\n    {\r\n        Instructions = \"You are a helpful research assistant. Plan your work, then execute it.\",\r\n        Tools = [\/* your custom AIFunction tools *\/],\r\n    },\r\n});\r\n\r\nAgentRunResponse response = await agent.RunAsync(\"Research the outlook for renewable energy stocks.\");\r\nConsole.WriteLine(response.Text);<\/code><\/pre>\n<p><strong>Python<\/strong><\/p>\n<pre><code class=\"language-python\">import asyncio\r\n\r\nfrom agent_framework import create_harness_agent\r\nfrom agent_framework.foundry import FoundryChatClient\r\nfrom azure.identity import AzureCliCredential\r\n\r\n\r\nasync def main() -&gt; None:\r\n    # FoundryChatClient reads FOUNDRY_PROJECT_ENDPOINT and FOUNDRY_MODEL from the environment.\r\n    client = FoundryChatClient(credential=AzureCliCredential())\r\n\r\n    # One call builds a batteries-included agent: planning, history persistence,\r\n    # compaction, approvals, web search, and telemetry are all wired in for you.\r\n    agent = create_harness_agent(\r\n        client=client,\r\n        agent_instructions=\"You are a helpful research assistant. Plan your work, then execute it.\",\r\n        tools=[],  # add your own callable tools here\r\n    )\r\n\r\n    response = await agent.run(\"Research the outlook for renewable energy stocks.\")\r\n    print(response.text)\r\n\r\n\r\nif __name__ == \"__main__\":\r\n    asyncio.run(main())<\/code><\/pre>\n<p>That single call gives you function invocation, per-service-call history persistence, a todo list and plan\/execute mode tracking, compaction, approvals, web search, and telemetry &#8211; all on by default and each configurable. You only supplied the instructions and your tools.<\/p>\n<h2>Build a real one, step by step<\/h2>\n<p>Why not build your own personal-finance assistant using the Agent Framework harness.\u00a0 You can add: custom tools, memory, skills, shell, CodeAct, background agents, governance, and Foundry hosted deployment,<\/p>\n<p>See the <a href=\"https:\/\/devblogs.microsoft.com\/agent-framework\/build-your-own-claw-and-agent-harness-with-microsoft-agent-framework\">Build your own claw and agent harness with Microsoft Agent Framework<\/a> series.<\/p>\n<h2 id=\"still-in-preview\">Coming soon<\/h2>\n<p>While we are releasing the core harness, there are a few opt-in features that we are not releasing yet.\u00a0 It&#8217;s possible to use these already, but we think we can make them even better, and we would like to get more customer feedback before we release them.\u00a0 Until such time, you will get a warning when opting into these features:<\/p>\n<ul>\n<li><strong>Background agents<\/strong> &#8211; delegate sub-tasks to other agents concurrently.<\/li>\n<li><strong>File access<\/strong> &#8211; read\/write file tools scoped to a working directory.<\/li>\n<li><strong>Looping<\/strong> &#8211; automatically re-invoke the agent until a completion condition is met.<\/li>\n<li><strong>Shell tooling<\/strong> &#8211; run shell commands (from the alpha-stage tools package).<\/li>\n<\/ul>\n<h2>Conclusion<\/h2>\n<p><span data-teams=\"true\">With the harness, Agent Framework gives developers a production-ready agent runtime out of the box. Bring your model, instructions, and tools, and let the framework handle planning, memory, tool orchestration, approvals, context management, and telemetry.<\/span><\/p>\n<h2 id=\"get-started\">Get started<\/h2>\n<ul>\n<li><strong>Documentation:<\/strong> <a href=\"https:\/\/learn.microsoft.com\/agent-framework\/agents\/harness\">Agent Harnesses on Microsoft Learn<\/a><\/li>\n<li><strong>Samples:<\/strong>\n<ul>\n<li>.NET &#8211; <a href=\"https:\/\/github.com\/microsoft\/agent-framework\/tree\/main\/dotnet\/samples\/02-agents\/Harness\"><code>dotnet\/samples\/02-agents\/Harness<\/code><\/a><\/li>\n<li>Python &#8211; <a href=\"https:\/\/github.com\/microsoft\/agent-framework\/tree\/main\/python\/samples\/02-agents\/harness\"><code>python\/samples\/02-agents\/harness<\/code><\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Your agents can now be built on a stable, batteries-included harness &#8211; the loop, planning, memory, context management, approvals, and telemetry that turn a model into an agent that actually does things &#8211; in both Python and .NET. What is an agent harness? An agent harness is the scaffolding that turns a language model into [&hellip;]<\/p>\n","protected":false},"author":162052,"featured_media":5721,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[78,143,34],"tags":[],"class_list":["post-5717","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-net","category-agent-framework","category-python-2"],"acf":[],"blog_post_summary":"<p>Your agents can now be built on a stable, batteries-included harness &#8211; the loop, planning, memory, context management, approvals, and telemetry that turn a model into an agent that actually does things &#8211; in both Python and .NET. What is an agent harness? An agent harness is the scaffolding that turns a language model into [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/posts\/5717","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/users\/162052"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/comments?post=5717"}],"version-history":[{"count":1,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/posts\/5717\/revisions"}],"predecessor-version":[{"id":5729,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/posts\/5717\/revisions\/5729"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/media\/5721"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/media?parent=5717"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/categories?post=5717"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/agent-framework\/wp-json\/wp\/v2\/tags?post=5717"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}