Microsoft Agent Framework (MAF) just shipped its Harness Agent, and it's the piece I've been waiting for. The framework has had a basic chat-client agent since v1.0, but you were on your own for most of what makes an agent actually useful in production: planning, durable memory, context compaction, approvals, telemetry. The announcement, from Principal Software Engineer Wes Steyn, replaces that scaffold-from-scratch work with a single call in both Python and .NET.

What the harness actually does

The Harness wraps a chat client — Agent in Python, ChatClientAgent in .NET — with a curated agentic pipeline, each feature enabled by default and individually removable:

  • Function invocation — the tool-calling loop, with a configurable iteration limit
  • Per-service-call history persistence — chat history saved after every model call, for crash recovery and mid-run inspection
  • Compaction — context-window management so long tool loops don't overflow
  • Todo & agent-mode providers — a persistent todo list plus plan/execute mode tracking
  • File memory — durable session notes and artifacts that survive across turns
  • Skills — progressive discovery of packaged domain expertise
  • Web search — uses the inference service's built-in search tool when available
  • Tool approval — "don't ask again" standing rules plus heuristic auto-approval for safe calls
  • Telemetry — built-in OpenTelemetry

The pitch is that it's tuned for long-running autonomous work: research, data analysis, general task automation.

Python is one call:

from agent_framework import create_harness_agent
from agent_framework.foundry import FoundryChatClient

client = FoundryChatClient(credential=AzureCliCredential())
agent = create_harness_agent(
    client=client,
    agent_instructions="You are a helpful research assistant. Plan your work, then execute it.",
    tools=[],
)
response = await agent.run("Research the outlook for renewable energy stocks.")

.NET mirrors it with chatClient.AsHarnessAgent(new HarnessAgentOptions { ... }) against an IChatClient backed by a Microsoft Foundry project (AIProjectClientGetProjectOpenAIClient()GetResponsesClient().AsIChatClient(deploymentName)), defaulting the model to gpt-5.4.

The distinction that matters

A reader comment on the post asked the obvious question: what's the difference from the existing Agent? Steyn's answer is worth quoting, because it's the design intent: HarnessAgent is built on top of the chat-client agent internally, but with an opinionated configuration and tools/context providers built in. The basic agent is there for people who want something simple or want full control. Harness handles the claw-like experience — plan, execute, remember, approve — out of the box.

That's the right split. The basic agent is a building block; the harness is a default runtime. For a team standing up a research or data-processing agent, choosing the harness means you get persistence and telemetry without deciding which providers to wire. You can peel layers off later.

The catch

Four things are deliberately not in the stable release, even though they're usable today behind a warning:

  • Background agents — delegating sub-tasks to other agents concurrently
  • File access — read/write tools scoped to a working directory
  • Looping — re-invoking the agent until a completion condition is met
  • Shell tooling — running shell commands (alpha-stage tools package)

Steyn says they want more feedback before stabilizing these. That's honest, but it means the two things most teams need for genuinely autonomous agents — background delegation and file access — are not yet production-blessed. Plan for the harness core now, treat those as opt-in experiments.

Where I'd use it

For a .NET shop already on Azure, this is the fastest path to a defensible long-running agent today: FOUNDRY_PROJECT_ENDPOINT env var, DefaultAzureCredential, one call, and you have planning, memory, approvals, and OpenTelemetry wired. The samples live at microsoft/agent-framework under dotnet/samples/02-agents/Harness and python/samples/02-agents/harness, docs on Microsoft Learn.

I'd still reach for a hand-rolled loop when the agent needs bespoke state or unusual tool semantics. But for the standard "plan and execute with a todo list" shape, the harness removes a surprising amount of glue — and the standing approval rules plus heuristic auto-approval are the kind of thing you'd spend days getting right yourself.

Sources: