Agent Harness vs Agent Framework vs MCP: Which Layer Owns the Loop, State, Tools, Permissions, and Recovery

Harness, framework, and MCP get used interchangeably in agent architecture discussions. They are not the same thing. They sit at different layers, own different responsibilities, and increasingly overlap at the edges. This article separates the 3 with 1 question. Which layer owns the execution loop, state, tool transport, permissions, and recovery?

The 3 categories

Ownership matrix

The table maps each responsibility to the layer that owns it by default. “Owns” means the layer defines and enforces the behavior. “Exposes” means the layer surfaces a hook but does not decide policy.

Responsibility Agent harness Agent framework MCP
Execution loop Owns: Fixed, product-grade loop with turn limits and compaction. Owns skeleton: You configure termination, handoffs, and turn caps. None: Request/response only.
Agent state and memory Owns: Sessions, resume, fork, file checkpointing. Exposes: Checkpointers, session stores, thread IDs. None at protocol level since 2026-07-28.
Tool transport Consumes: Built-in tools plus MCP client. Consumes: Function tools plus MCP client. Own: JSON-RPC over stdio or Streamable HTTP.
Permissions and approvals Owns: Permission modes, hooks, sandbox. Exposes: Guardrails, interrupts, middleware. Delegates to host: Cannot enforce.
Recovery Owns: Session resume, checkpoint rewind, compaction. Exposes: Durable execution, replay, retries. Partial: Tasks extension for long-running calls.
Isolation and sandboxing Owns: OS sandbox, worktrees, containers. Optional: Hosted sandboxes or micro-VMs. None.
Multi-agent orchestration Owns patterns: Subagents, dynamic workflows. Owns primitives: Graphs, handoffs, fan-out. None: A2A covers agent-to-agent.

The rest of this article justifies each row with sources.

Who owns the execution loop

Every agent runs a loop. Send context to the model, read the response, execute tool calls, feed results back, repeat. The harness and the framework both implement this loop. They differ in how much you control it.

Who owns state

Who owns tool transport

This is the 1 row MCP owns outright.

MCP defines 3 server-side primitives: tools (functions the model executes), resources (context and data), and prompts (templated workflows). Clients may offer elicitation, which lets a server request more input from the user. Transport is JSON-RPC 2.0 over stdio or Streamable HTTP. The 2026-07-28 revision made Mcp-Method and Mcp-Name headers mandatory on HTTP requests. Gateways and rate limiters can now route on headers without parsing bodies. It also made tools/list responses cacheable with ttlMs and cacheScope, and deprecated the legacy HTTP+SSE transport with a 12-month offramp.

Server-initiated sampling, roots, and logging are now deprecated. Their replacement is Multi Round-Trip Requests (MRTR). A server returns resultType: "input_required", and the client retries the original call with answers attached. This matters for the permissions row below.

Harnesses and frameworks both sit on top of MCP as clients. Claude Code and the Claude Agent SDK connect to MCP servers. They also let you define custom tools through an in-process MCP server. Codex connects to MCP servers, and OpenAI’s Relay sample embeds Codex beside a dashboard driven by application-owned MCP tools. Microsoft Agent Framework 1.0 ships MCP and A2A support. The protocol is the shared substrate. Adoption numbers back that up. The MCP maintainers report close to half a billion SDK downloads per month across Tier 1 SDKs. The TypeScript and Python SDKs have each passed 1 billion total downloads.

Who owns permissions

The MCP specification is unambiguous here. Hosts must obtain explicit user consent before invoking any tool. Tool descriptions and annotations should be treated as untrusted unless the server is trusted. And then the key sentence: “MCP itself cannot enforce these security principles at the protocol level“. Permissions belong to the host.

Harness: Harnesses own the permission model end to end. Claude Code ships 6 permission modes: default, acceptEdits, plan, auto, dontAsk, and bypassPermissions. Deny rules block in every mode except bypassPermissions, which skips the permission layer entirely. auto mode routes each tool call through a background classifier. Hooks add custom logic at PreToolUse and PermissionRequest points. Codex takes the same shape. The app-server can pause a turn and issue an approval request the client must answer before work continues.

Framework: Frameworks give you the hook, not the policy. The OpenAI Agents SDK has input, output, and tool guardrails, and a tripwire halts the run. LangGraph uses interrupt() inside a node to pause for approval and Command(resume=...) to continue. Microsoft Agent Framework adds a ToolApprovalAgent middleware with “don’t ask again” rules. In each case you write the approval logic and the UI.

MCP: MCP now carries the approval request across the wire through elicitation over MRTR. Supabase, for instance, plans to use it so tools can confirm cost or a destructive query before acting. The server can ask. Only the host can decide.

Who owns recovery

Harness: Recovery is where harnesses earn their keep. The Claude Agent SDK can resume a session and rewind file changes to a checkpoint. It compacts context when a window fills. Claude Code’s dynamic workflows resume where they left off if a terminal is closed. Anthropic’s harness design post (March 2026) separates a generator from an evaluator agent because self-graded work skews positive. OpenAI’s harness post from February 2026 reports the outcome of this discipline. Codex produced roughly 1,500 merged pull requests in 5 months. The repository reached on the order of 1 million lines of code. The team grew from 3 to 7 engineers, averaging 3.5 PRs per engineer per day. OpenAI also reports a harness effect on ARC-AGI-3. Retained reasoning and context compaction lifted GPT-5.6 Sol from 13.3% to 38.3% while cutting output tokens sixfold . Same model, different harness, different score.

Framework: LangGraph’s durable execution is explicit that recovery depends on determinism. Wrap side effects in tasks, keep nodes idempotent, and a run can resume a week later. The OpenAI Agents SDK exposes error_handlers and preserves completed guardrail results when a run fails. The framework replays. You make replay safe.

MCP: MCP’s answer to long-running work is the io.modelcontextprotocol/tasks extension, contributed by AWS, with poll-based tasks/get and tasks/update. This covers a single long tool call. It does not cover agent-level recovery.

Architecture comparison

                    +------------------------------------------+
  Application       |  Your product: UI, records, business     |
                    |  rules, consent flows                    |
                    +------------------------------------------+
                          |                     |
                          v                     v
  Runtime layer     +----------------+   +-----------------------+
  (pick one, or     |  AGENT HARNESS |   |  AGENT FRAMEWORK      |
   combine)         |  fixed loop    |   |  composable loop      |
                    |  sessions      |   |  checkpointers        |
                    |  permissions   |   |  guardrails/interrupt |
                    |  sandbox       |   |  graphs, handoffs     |
                    |  compaction    |   |  middleware, tracing  |
                    +----------------+   +-----------------------+
                          |                     |
                          +----------+----------+
                                     v
  Transport layer   +------------------------------------------+
                    |  MCP (JSON-RPC 2.0, stdio / Streamable   |
                    |  HTTP): tools, resources, prompts,       |
                    |  elicitation, Tasks extension            |
                    +------------------------------------------+
                                     |
                                     v
  Capability layer  +------------------------------------------+
                    |  MCP servers: GitHub, Figma, Supabase,   |
                    |  Sentry, Linear, internal APIs           |
                    +------------------------------------------+

OpenAI draws a near-identical picture for Relay. The application owns product context, business rules, and tools. Codex app-server provides the agent loop and sandboxed execution.

Where the categories overlap

The boundaries are blurring in 3 directions:

  1. Frameworks are absorbing harnesses: Microsoft Agent Framework now ships an “Agent Harness” layer. It turns any chat client into a full harness with 1 method call. It includes context compaction, file memory, a todo provider, and plan versus execute modes. It also adds background subagents and a sandboxed shell executor. Microsoft describes the harness as “the layer where model reasoning meets real execution.” A framework vendor is conceding that raw primitives are not enough.
  2. Harnesses are becoming platforms: OpenAI open-sourced the Codex harness and now offers 3 integration tiers. codex exec runs bounded jobs, the Codex SDK gives programmatic control, and app-server embeds the loop in a product. Anthropic’s Claude Agent SDK does the same for Claude Code. DeepSeek released DeepSeek Harness v0.1 on August 13, 2026, under the MIT license. Its premise is that every component, including the loop, is a plugin. Once a harness is a library with a documented protocol, it competes with frameworks.
  3. MCP is growing agent-shaped features: Elicitation, MRTR, the Tasks extension, Skills over MCP, and MCP Apps all push the protocol outward. These are interaction patterns that used to live in the runtime. The maintainers have drawn a line, though. Roots, sampling, and logging are deprecated, and the core is now request/response. MCP is standardizing the interface, not becoming the agent.

One term that does not overlap: A2A. Agent-to-agent communication is a separate protocol, now also housed at the Agentic AI Foundation. MCP connects an agent to tools. A2A connects an agent to other agents.

How to assemble the stack

The decision comes down to 3 questions:

Key Takeaways


Sources

The post Agent Harness vs Agent Framework vs MCP: Which Layer Owns the Loop, State, Tools, Permissions, and Recovery appeared first on MarkTechPost.

Exit mobile version