Build A Harness GitHub
OPEN SOURCE · VISUAL CANVAS · APACHE 2.0

Design, test, and deploy
AI agent harnesses.

Pick the nodes your agent needs. Draw the graph. Run on any framework.

A workflow routes prompts. A harness governs what your agent believes, what it's allowed to do, and how it recovers. Build one on a canvas, compile to any framework, trace every decision with Langfuse, and deploy as a REST endpoint, MCP tool, or A2A agent.

LangGraph CrewAI Mastra MS Agent Framework

Diagram: a simple agent loop (input → LLM call → tool call → output) compared with a full Build A Harness — an 11-layer architecture across 27 nodes that adds caller state, a world model, reasoning, a 5-tier control layer, planning, execution, 9-layer verification, recovery, memory, optional learning, and an output reviewer pass.

Simple Agent Loop
Input / Caller
LLM Call
Tool Call↺ loop
Output
prompt in → answer out
no world model · no control state · no verification
vs
Full Harness — Implemented
Caller Stateconstraints · clarification · propagation
World Modelbeliefs · contradictions · generation_id
Reasoningevidence · hypotheses (4 sources) · VOI
Control5-tier resolver · deadlock detectkey
Planningtask graph (6-state) · parallel concurrency
ExecutionVOI · review gate
Verification9 layers
Recovery6 strategies
Memorycompression · journal
Learningexperience store · warm start (optional)
Output & Reviewer Passcontract · 3-lens review
27 nodes · 11 layers · world model + 5-tier control · 9-layer verification
WHY A HARNESS, NOT JUST A WORKFLOW

A harness does what a workflow can't.

A workflow routes prompts from node to node. A harness governs what the AI believes, what it's allowed to do, how it catches its own mistakes, and what it learns for next time. Use three nodes or eleven — the same FlowSpec runs either.

Reasoning, not just prompting

Add a world_model node and your agent tracks typed beliefs, detects contradictions, and evaluates hypotheses from four generation sources before acting — instead of just asking the LLM and hoping.

Control that holds

Drop in a control_state node and your agent gains a five-tier resolver that governs every action — NORMAL → CAUTIOUS → BLOCKED. Diagnostic health vectors drive it; deadlock detection stops it escalating forever.

Verification with teeth

A verify_gate runs nine checks before every action. Pair it with reviewer_pass for adversarial review and contract validation before every return. Trust, but verify — and actually enforce it.

Recovery and learning

Add recovery for six named strategies, typed failure detection, and local vs global replanning. Attach exp_store and your agent reuses successful decompositions across future runs.

27 node types · 14 execution + 13 harness · 4 framework adapters · Langfuse observability

HARNESS NODE LIBRARY

Every layer you need. Use one or all.

27 node types — 14 execution, 13 harness. Use what your agent needs: a minimal harness might be three nodes, the full stack runs to eleven layers. Both are valid FlowSpec.

Diagram: the same node types compose into different harness graphs — a minimal harness (input → llm_call → verify_gate → recovery → output) and a full 11-layer harness — both valid FlowSpec that compile to LangGraph, CrewAI, Mastra, or Microsoft Agent Framework.

Same bricks. Different graphs. · Compose exactly the harness your agent needs — minimal or full.
Minimal · just verification + recovery
input
llm_call
verify_gate9 layers
recovery6 strategies
output
or
Full Harness · all 11 layers
caller_stateconstraints · escalation
world_modelbeliefs · contradictions
reasoninghypotheses · VOI
control_state5-tier resolver
task_graph6-state planning
execution
verify_gate
recovery
memory
learningoptional
reviewer_pass3-lens · adversarial
outputcontract validated
verify_gate and recovery appear in both graphs — same brick, any config · draw on the canvas · FlowSpec compiles to LangGraph, CrewAI, Mastra, or MAF
Execution layer · 14 node types
Mix and match — any subset of nodes is valid FlowSpec
4 framework adapters — same spec, any runtime
Langfuse observability — harness traces, all 4 runtimes
HITL pause/resume · REST/MCP/A2A deploy
FlowSpec v0.2.0 — open, portable JSON format
Process concepts — pre-seeded task graph scaffolds
Harness layer · 13 node types
World model · typed beliefs · contradiction detection
5-tier control state resolver · deadlock detection
Pre-execution review gate · 9-layer verification
6 named recovery strategies · typed failure library
Experience store — cross-run structural reuse
Adversarial reviewer pass · output contract validation
27 nodes · 11 layers · 759 harness-layer tests
Foundation State Architecture
Evidence & Reasoning
World Model & Contradiction
Diagnostics & Control State
Planning & Task Graph
Execution & Verification
Recovery & Memory
Caller State & Escalation
Experience Store
Reviewer Pass & Output Contract
Canvas Integration
E2E Integration & Testing
Start with state and reasoning

world_model, hypothesis_set, evidence_store, control_state, and a six-state task_graph — the infrastructure for an agent that thinks before it acts.

Add verification and recovery

verify_gate with nine layers, pre-execution review gate, six named recovery strategies via recovery, context compression, exp_store for cross-run reuse, and adversarial reviewer_pass.

Draw, compile, and deploy

Thirteen harness node types on the canvas, Langfuse tracing with harness-specific spans, framework adapters for all four runtimes, and end-to-end tests across every combination.

GET STARTED

Up and running in two commands.

Build A Harness runs entirely on your machine via Docker. No cloud account, no sign-up — clone the repo, run two commands, and you're drawing harnesses in minutes.

terminal
# 1. Generate secrets and configure your environment
./scripts/setup-env.sh

# 2. Start all services
docker compose up

What starts up

Canvas — localhost:3000

The visual harness editor. Design with 27 node types — 14 execution nodes and 13 harness nodes including world model, control state, verify gate, and recovery.

API — localhost:8000

Compiles FlowSpec to LangGraph, CrewAI, Mastra, or Microsoft Agent Framework and runs your harnesses. Publishes each harness simultaneously as a REST endpoint, MCP tool, and A2A agent.

Langfuse — localhost:3001

Harness-aware observability dashboard. Every run traced automatically across all 4 frameworks — including world model transitions, control state changes, and recovery strategy activations.

Nine services in total. scripts/setup-env.sh handles all the secrets and configuration automatically — you only need to provide your LLM API key (or skip it and use a free local model instead).

AI MODELS

Use OpenAI, Claude, or run completely free locally.

Build A Harness routes all AI calls through LiteLLM — a proxy that works with any model provider. You pick the model in your workflow; the rest is handled automatically.

OpenAI

Add your OPENAI_API_KEY and use gpt-4o or gpt-4o-mini in any flow.

Anthropic

Add your ANTHROPIC_API_KEY and use claude-sonnet, claude-haiku, or claude-opus.

Ollama — free & local

Run mistral, qwen3, or qwen2.5-coder locally. No API key, no cost, no data leaving your machine.

Any custom model

Edit one config file to add any OpenAI-compatible model or endpoint — including self-hosted or fine-tuned models.

Want to try it without an API key? Install Ollama, pull a model (ollama pull mistral), and run ./scripts/setup-ollama.sh — it tests all four frameworks end-to-end with no paid account needed.

HOW IT WORKS

Draw your harness once. Run it on any engine.

Build A Harness stores every harness in FlowSpec — an open JSON format you own. Draw on the canvas and the spec is written for you. The same file compiles to LangGraph, CrewAI, Mastra, or MAF. Add harness nodes like verify_gate, world_model, or recovery and they compile too — no rewriting, no lock-in.

support-triage.flow.json
{
  "workflow": "support-triage",

  "nodes": [
    {
      "type": "llm_call",
      "prompt": "Classify severity"
    },
    {
      "type": "condition",
      "route": "high_priority"
    },
    {
      "type": "human_review"
    }
  ],

  "telemetry": {
    "provider": "langfuse"
  }
}

What you can build

Composable harness graphs

A minimal harness is just input → llm_call → output. Add verify_gate and recovery when you want them. Every combination is valid FlowSpec.

Safe by construction

Guardrails, retry logic, and HITL approval checkpoints are first-class node types — not wrappers you bolt on afterwards.

Shareable and portable

Your harness is a JSON file. Check it in, share it, load it on any canvas, or import into your CI pipeline.

Observable by default

Langfuse traces every step across all four frameworks — prompts, tool calls, harness transitions, failures, and costs — without any setup.

node taxonomy · execution layer14 types
i/o
inputoutput
llm
llm_call
tools
tool_invoke
agents
agent_roleagent_debate
flow control
conditionparallel_forkparallel_join
human
hitl_breakpoint
memory
memory_readmemory_write
composition
subgraphtransform
Harness node palette — 13 node types
world_model hypothesis_set control_state task_graph verify_gate recovery evidence_store exp_store reviewer_pass gather_evidence apply_tool_rel update_wm process_concept
SUPPORTED FRAMEWORKS

Use the AI framework your team already knows.

Every other visual canvas is tied to one runtime. Build A Harness separates harness design from execution via FlowSpec — so you can experiment, migrate, or compare runtimes without rebuilding your architecture each time.

LangGraph

Python · JS · MIT

The production standard for stateful agent orchestration. LangGraph's graph model maps cleanly to FlowSpec — conditional edges compile without rewriting, and harness nodes like world_model, control_state, and verify_gate slot in as standard graph nodes with no translation layer.

  • Checkpoint to Postgres or Redis — resume from any node after failure
  • Full token and graph-update streaming
  • Best fit: RAG agents, complex multi-step stateful flows

CrewAI

Python · MIT

The largest community for role-based multi-agent patterns. agent_role nodes map directly to CrewAI Crew, Agent, and Task — your canvas design becomes a crew without translation. parallel_fork for fan-out, memory_read for vector retrieval, and native vector store support included.

  • Role-based agents compile natively — no wrapping needed
  • Full memory (vector) support with top-k and threshold
  • Best fit: specialist agent teams, research crews, parallel review

Mastra

TypeScript · Apache 2.0

The only TypeScript-native orchestrator with first-class harness support. Full HITL pause and resume, full streaming (tokens and graph updates), and native vector memory — all from the same FlowSpec that also runs on LangGraph or CrewAI if you switch later.

  • Full HITL — pause, inspect state, resume from the canvas
  • Full streaming and native vector memory
  • Best fit: TypeScript / Node.js teams, JS-native stacks

Microsoft Agent Framework

C# · Python · Java · MIT

The merger of Semantic Kernel and AutoGen in one SDK, covering enterprise .NET, Python, and Java teams in a single adapter. agent_role and agent_debate map natively to AgentGroupChat; HITL runs via the _HitlPause exception pattern; durable state checkpoints via Dapr or Orleans.

  • AgentGroupChat native — debate and role patterns compile directly
  • Durable execution via Dapr or Orleans
  • Best fit: enterprise .NET, Java, or Python teams
Feature LangGraph CrewAI Mastra MS Agent Framework
llm_call · structured output
Prompt templates, model overrides, validators.
fullfullfullfull
agent_role · agent_debate
Named personas, multi-agent loops. MAF maps natively to AgentGroupChat.
via synthesisrole nativevia synthesisAgentGroupChat native
condition · parallel_fork / join
Branching, fan-out, configurable join reducers.
fullfullfullfull
hitl_breakpoint
Pause, inspect, edit state, resume.
fullpartialfull_HitlPause exception
memory · semantic (vector)
Embeddings, top-k, similarity threshold.
via pluginfullfullfull
streaming · tokens / updates
Token streaming and graph-update events.
fullpartialfullvia adapter
checkpoint · Postgres / Redis
Durable execution, resume from any node.
fullvia pluginfullvia Dapr / Orleans
EXAMPLE HARNESSES

Five ready-made harnesses to fork and build on.

The repo ships with five real, working harnesses. Each demonstrates a different composition of node types — open them in the canvas, run them, and modify them for your use case.

Flow Best framework What it shows
RAG Agent
Search a knowledge base, retrieve the most relevant chunks, and generate a grounded answer.
LangGraph Memory read, semantic search, caching
Content Moderation + Human Review
Classify content, auto-approve low-risk items, and pause for a human to review anything flagged as high risk.
Mastra Human-in-the-loop, structured output
Parallel Risk Assessment
Three specialist AI agents review a document simultaneously, then their findings are merged into one report.
CrewAI Parallel agents, fan-out/merge
Research Crew
A team of AI agents collaborate on a research task, with human approval required before any external tool is used.
CrewAI Multi-agent, tool approval
Debate Agent
Multiple AI agents argue different sides of a question until they reach a conclusion — then the flow is also exposed as an A2A agent other systems can call.
MS Agent Framework Multi-agent debate, A2A protocol
LANGFUSE OBSERVABILITY

Know exactly what your AI did — and why it did it.

Langfuse is the open-source observability platform built into Build A Harness. Every run is traced automatically across all four runtimes — no configuration required. One dashboard covers every prompt, tool call, decision, failure, and recovery action.

Build A Harness extends Langfuse with harness-specific spans that no standard tracing library produces:

Standard — every AI framework
llm_call prompt, model, tokens, latency, cost
tool_invoke name, inputs, outputs, duration
error failure type, node, stack, retry count
hitl pause time, who resumed, state diff
memory retrieval query, top-k results, scores
Harness-specific — Build A Harness only
world_model belief delta, generation_id, contradictions
control_state tier transition · NORMAL → CAUTIOUS → BLOCKED
verify_gate which of 9 layers fired, verdict, score
recovery strategy selected, failure type, replanning scope
reviewer_pass 3-lens score, contract verdict, findings

Run the same FlowSpec on LangGraph and Mastra and compare traces side by side. Langfuse runs locally at localhost:3001 — no data leaves your machine.

DEPLOY & INTEGRATE

One click to publish your harness as an API, a Claude tool, or an agent.

One API call publishes your harness three ways at once — a REST endpoint, an MCP tool, and an A2A agent — so whatever system needs it can call it the way that makes sense.

REST endpoint

Any app can trigger your flow with a standard HTTP POST. No special SDK needed — a curl command or a fetch call is all it takes to run the full harness.

MCP tool

The Model Context Protocol (MCP) lets AI assistants call external tools during inference. Publishing as an MCP server means Claude Desktop, Cursor, and any MCP client can invoke the full harness — including its 11-layer control architecture — directly from a prompt, with no extra code.

A2A agent

The Agent-to-Agent (A2A) protocol is an open standard for AI agent interoperability. Publishing as an A2A agent means other agents — built on Google ADK, OpenAI Agents SDK, Claude Agent SDK, or any A2A runtime — can discover your harness via its Agent Card and delegate tasks to it without a custom adapter.

Embeddable canvas

Drop the visual editor into your own app with the @buildaharness/canvas npm package.

MCP · Model Context Protocol

MCP is Anthropic's open standard that lets AI assistants call tools and read context during inference. When Build A Harness publishes a harness as an MCP server, each harness is exposed as a callable tool with a typed input and output schema. Any MCP client — Claude Desktop, Cursor, the Claude Agent SDK — can discover and invoke it with no additional setup.

What this means in practice: a user in Claude Desktop types "summarise this contract and flag unusual clauses" and Claude automatically calls your content-moderation harness — complete with HITL controls, verify_gate, and Langfuse tracing — as if it were a local tool.

A2A · Agent-to-Agent Protocol

A2A is Google's open protocol for AI agent interoperability. An A2A agent publishes an Agent Card — a machine-readable description of its capabilities, inputs, and outputs. Other agents, regardless of their framework, can discover the card and invoke the agent over a standard HTTP interface without needing to know its internal architecture.

What this means in practice: a research agent built on Google ADK can delegate a "parallel risk assessment" subtask to your Build A Harness flow and receive a structured result — with neither agent needing a custom adapter. Compatible with Google ADK, OpenAI Agents SDK, Claude Agent SDK, and any A2A runtime.

PUBLIC ALPHA · v0.8.0

Build A Harness is in public alpha.
Build with it.

The canvas, framework adapters, observability layer, and the full harness node library are working and ready to use. Your real harnesses, bug reports, and contributions shape what gets fixed and what gets prioritised next.

Public alpha — current and planned work is in the open

The canvas-and-adapters layer is stable but alpha — APIs may shift, Docker Compose behaviour may vary, and edge cases in less-common node combinations aren't fully covered yet. The full harness reasoning and control architecture is implemented and tested. Run it, break it, and tell us what you need. Every report shapes what gets prioritised.

track A · run & report

Run it against real flows

One docker compose up starts all nine services. Point it at a real flow — your actual use case, not a toy example. When something breaks, crashes silently, or produces wrong output, open a bug report with your FlowSpec JSON, the runtime you used, and the full error. The more specific, the faster it gets fixed.

Report a bug →
track B · shape the roadmap

Tell us what you need

Missing a node type? A harness feature that would change how you build? A runtime behaviour that doesn't map cleanly? Open a feature request. Describe what you're building and where Build A Harness falls short — concrete use cases carry far more weight than abstract asks. Phase priority is influenced by community demand.

Request a feature →
track C · build with it

Build a node pack or contribute a phase

FlowSpec v0.2.0 is stable for third-party node packs (@buildaharness/nodes/…). The full harness implementation is public and open for community contribution. The spec, adapter interface, and canvas package are all stable enough to build on today.

Read the spec →
FAQ

Questions, answered.

What is Build A Harness?

Build A Harness is an open-source (Apache 2.0) visual canvas for designing, testing, and deploying production AI agent harnesses. Draw the full architecture using 27 node types — 14 execution nodes plus 13 harness nodes that implement the complete 11-layer control architecture: world model, 5-tier control state, 9-layer verification, 6 recovery strategies, and cross-run learning. A single FlowSpec export compiles the same design to LangGraph, CrewAI, Mastra, or Microsoft Agent Framework without rewriting. Every run is traced automatically via Langfuse, HITL controls let humans pause and resume any flow, and one API call publishes the harness simultaneously as a REST endpoint, an MCP tool, and an A2A agent. Everything runs locally via Docker — no cloud account required.

What's the difference between a harness and a workflow?

A workflow routes prompts from node to node. A harness governs what the agent believes, what it's allowed to do, how it catches its own mistakes, and what it learns for next time. The 5-tier control state knows when to slow down or stop; nine verification layers check outputs before they land; recovery strategies handle failures systematically instead of crashing.

What is FlowSpec?

FlowSpec is Build A Harness's open, runtime-neutral JSON format for describing AI agent workflows. It is the intermediate representation that sits between the visual canvas and any execution runtime. A single FlowSpec file compiles to LangGraph, CrewAI, Mastra, or Microsoft Agent Framework without rewriting. FlowSpec v0.2.0 is stable and open for third-party node packs (@buildaharness/nodes/…).

Why a runtime-neutral FlowSpec?

It decouples the canvas from any single runtime. Adding a new runtime is one adapter file, and canvas features — HITL, observability, versioning — stay independent of your runtime choice. One flow runs across all four supported runtimes without rewriting.

Why these four frameworks?

LangGraph is the production standard for stateful agents. CrewAI has the largest audience for multi-agent team patterns. Mastra is the only TypeScript-native orchestrator with first-class support. Microsoft Agent Framework merged Semantic Kernel and AutoGen, covering enterprise .NET and Python users.

Is it open source?

Yes — Apache 2.0. The canvas, adapters, FlowSpec, and the full harness implementation are all open.

Does it require a cloud account?

No. Everything runs locally via Docker — ./scripts/setup-env.sh && docker compose up. You only need an LLM API key, or skip it and run a free local model with Ollama.