I
Agentic Intelligence · Infomly
Jun 19, 2026
1:01 PM
Agentic AI

Mastra just shipped the harness primitive your coding agent was missing

Every agent framework gives you a loop. None give you the runtime around it.

Mastra just open-sourced `Harness` — a session controller that sits above the agent loop and handles everything you've been building yourself: conversation threads, mode switching, tool approvals, subagent spawning, and observational memory.

Shipped in @mastra/core@1.43.0.

The architecture is simple but overdue. A Harness owns a Session. The Session tracks the active thread, mode, model, permission grants, follow-up queue, and token usage. You subscribe once, then send messages in and read everything back — as a single event stream that stays open for as long as the thread lives.

35 signals. `agent_start`, `tool_suspended`, `subagent_text_delta`, `follow_up_queued`, `usage_update`. All collapse into a `HarnessDisplayState` object your UI consumes directly.

The tool approval chain is the part most teams get wrong. Per-tool deny → YOLO mode → session grants → category policy → ask. One approval carries across the entire session. Grant permission for a category once and the agent stops asking.

Subagents come in two flavors. Isolated — inherits nothing, reasons clean. Forked — clones the parent's conversation and picks up on a warm prompt cache. You choose based on whether context matters for the task.

Modes are where this gets production-grade. Plan and Execute live in the same session. Give plan a `transitionsTo: "execute"` and the session auto-switches after approval. No manual wiring. No state loss between phases.

Observational memory is the crown jewel. Instead of lossy compaction when you hit context limits, an observer agent compresses messages into structured observations. A reflector agent condenses them later, merging related items while preserving what matters.

If you're building coding agents, security scanners, accounting agents, or anything that runs for more than a few minutes — this is the harness primitive you've been assembling from scratch.

Audit your agent architecture. If you're managing threads, approvals, and mode switching in application code, you're rebuilding what Mastra just shipped.

SOURCE: https://mastra.ai/blog/announcing-agent-harness
VERIFIED: https://mastra.ai/docs/harness/overview, https://mastra.ai/reference/harness/harness-class
SIGNAL: The agent harness is becoming a distinct infrastructure layer — separate from the agent itself. Mastra is the first to ship it as a reusable primitive. This changes how teams architect long-running agent systems.
1 views
Agentic AI — filtered for signal, not noise The AI briefing CTOs read before their morning meeting 3 minutes. Zero fluff. Only what moves the needle. $5/mo — your cheapest competitive edge
Subscribe — $5/mo

0 Comments

No comments yet. Be the first.