{"slug": "the-microsoft-agent-framework-harness-is-now-released", "title": "The Microsoft Agent Framework Harness is now released", "summary": "Microsoft has released the Agent Framework Harness, a stable, batteries-included runtime for building agents in Python and .NET that provides loop, planning, memory, context management, approvals, and telemetry out of the box. The harness turns a language model into an agent capable of autonomous work such as research, data analysis, and task automation by wrapping a chat client with a complete agentic pipeline. Developers supply their own chat client, instructions, and optional tools, while the harness adds function invocation, history persistence, compaction, planning, web search, and telemetry with sensible defaults.", "body_md": "Your agents can now be built on a **stable, batteries-included harness** – the loop, planning, memory, context management, approvals, and telemetry that turn a model into an agent that actually *does* things – in both **Python** and **.NET**.\n\n## What is an agent harness?\n\nAn *agent harness* 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 – and that runtime is the harness.\n\nAgent Framework ships a ready-made one so you don’t have to build that scaffolding yourself. It’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’s just a chat-client agent (`Agent`\n\nin Python, `ChatClientAgent`\n\nin .NET) with a curated set of Agent Framework features added – each enabled by default and individually customizable or removable:\n\n**Function invocation**– the automatic tool-calling loop, with a configurable iteration limit.** Per-service-call history persistence**– chat history saved after every model call for crash\n\nrecovery and mid-run inspection.\n\n**Compaction**– context-window management so long tool-calling loops don’t overflow.** Todo & agent-mode providers**– a persistent todo list plus plan/execute mode tracking, so the agent plans work then executes it.\n\n**File memory**– durable session notes and artifacts that survive across turns.** Skills**– progressive discovery and loading of packaged domain expertise.** Web search**– enables the inference service’s built-in web search tool, when the underlying service provides one, so the agent can ground answers in current information.\n\n**Tool approval**– “don’t ask again” standing rules plus heuristic auto-approval for safe calls.** Telemetry**– built-in OpenTelemetry.\n\nYou supply your own chat client and only configure what makes the agent *yours* – its instructions and its tools. Everything else has a sensible default.\n\n## What you can do with it\n\nHere are some examples of the types of agents you can build with it:\n\n**Research assistants** that plan a topic into todos, switch between plan and execute modes, search the web, and work autonomously through the plan.\n\n**Data-processing agents** that read and analyze a folder of files with approval-gated file tools.**Domain assistants**– like a personal-finance “claw” – that combine custom tools, memory, skills, and planning into a single agent you can grow feature by feature.\n\n## A basic harness agent\n\nThe 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.\n\n**.NET**\n\n```\nusing Azure.AI.Projects;\nusing Azure.Identity;\nusing Microsoft.Agents.AI;\nusing Microsoft.Extensions.AI;\n\nvar endpoint = Environment.GetEnvironmentVariable(\"FOUNDRY_PROJECT_ENDPOINT\")\n    ?? throw new InvalidOperationException(\"FOUNDRY_PROJECT_ENDPOINT is not set.\");\nvar deploymentName = Environment.GetEnvironmentVariable(\"FOUNDRY_MODEL\") ?? \"gpt-5.4\";\n\n// Build an IChatClient backed by a Microsoft Foundry project...\nIChatClient chatClient =\n    new AIProjectClient(new Uri(endpoint), new DefaultAzureCredential())\n        .GetProjectOpenAIClient()\n        .GetResponsesClient()\n        .AsIChatClient(deploymentName);\n\n// ...then wrap it in the harness. One call gives you the full agentic pipeline.\nAIAgent agent = chatClient.AsHarnessAgent(new HarnessAgentOptions\n{\n    ChatOptions = new ChatOptions\n    {\n        Instructions = \"You are a helpful research assistant. Plan your work, then execute it.\",\n        Tools = [/* your custom AIFunction tools */],\n    },\n});\n\nAgentRunResponse response = await agent.RunAsync(\"Research the outlook for renewable energy stocks.\");\nConsole.WriteLine(response.Text);\n```\n\n**Python**\n\n``` python\nimport asyncio\n\nfrom agent_framework import create_harness_agent\nfrom agent_framework.foundry import FoundryChatClient\nfrom azure.identity import AzureCliCredential\n\nasync def main() -> None:\n    # FoundryChatClient reads FOUNDRY_PROJECT_ENDPOINT and FOUNDRY_MODEL from the environment.\n    client = FoundryChatClient(credential=AzureCliCredential())\n\n    # One call builds a batteries-included agent: planning, history persistence,\n    # compaction, approvals, web search, and telemetry are all wired in for you.\n    agent = create_harness_agent(\n        client=client,\n        agent_instructions=\"You are a helpful research assistant. Plan your work, then execute it.\",\n        tools=[],  # add your own callable tools here\n    )\n\n    response = await agent.run(\"Research the outlook for renewable energy stocks.\")\n    print(response.text)\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\nThat 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 – all on by default and each configurable. You only supplied the instructions and your tools.\n\n## Build a real one, step by step\n\nWhy not build your own personal-finance assistant using the Agent Framework harness. You can add: custom tools, memory, skills, shell, CodeAct, background agents, governance, and Foundry hosted deployment,\n\nSee the [Build your own claw and agent harness with Microsoft Agent Framework](https://devblogs.microsoft.com/agent-framework/build-your-own-claw-and-agent-harness-with-microsoft-agent-framework) series.\n\n## Coming soon\n\nWhile we are releasing the core harness, there are a few opt-in features that we are not releasing yet. It’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. Until such time, you will get a warning when opting into these features:\n\n**Background agents**– delegate sub-tasks to other agents concurrently.** File access**– read/write file tools scoped to a working directory.** Looping**– automatically re-invoke the agent until a completion condition is met.** Shell tooling**– run shell commands (from the alpha-stage tools package).\n\n## Conclusion\n\nWith 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.\n\n## Get started\n\n**Documentation:**[Agent Harnesses on Microsoft Learn](https://learn.microsoft.com/agent-framework/agents/harness)** Samples:**- .NET –\n`dotnet/samples/02-agents/Harness`\n\n- Python –\n`python/samples/02-agents/harness`\n\n- .NET –", "url": "https://wpnews.pro/news/the-microsoft-agent-framework-harness-is-now-released", "canonical_source": "https://devblogs.microsoft.com/agent-framework/the-microsoft-agent-framework-harness-is-now-released/", "published_at": "2026-07-23 01:06:09+00:00", "updated_at": "2026-07-23 01:22:27.297409+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "artificial-intelligence"], "entities": ["Microsoft", "Agent Framework", "Python", ".NET", "OpenTelemetry", "Microsoft Foundry"], "alternates": {"html": "https://wpnews.pro/news/the-microsoft-agent-framework-harness-is-now-released", "markdown": "https://wpnews.pro/news/the-microsoft-agent-framework-harness-is-now-released.md", "text": "https://wpnews.pro/news/the-microsoft-agent-framework-harness-is-now-released.txt", "jsonld": "https://wpnews.pro/news/the-microsoft-agent-framework-harness-is-now-released.jsonld"}}