Open Harness

Open Harness

Signal-based reactive workflows for AI agents

Open Harness

Open Harness is a signal-based reactive workflow system for building production multi-agent AI systems in TypeScript.

Why Open Harness?

  • Reactive Architecture: Agents subscribe to signals with activateOn, emit signals with emits. Workflow emerges from signal flow.
  • Typed State: Full TypeScript autocomplete for state, guards, and outputs. No runtime surprises.
  • Recording/Replay: Event-sourced signals enable deterministic testing. Record once, replay in CI.
  • Parallel Execution: Multiple agents reacting to the same signal run concurrently, automatically.

Quick Example

import { createWorkflow, ClaudeHarness } from "@open-harness/core";

// 1. Define your state type
type State = {
  input: string;
  analysis: string | null;
};

// 2. Create typed workflow factory
const { agent, runReactive } = createWorkflow<State>();

// 3. Define a reactive agent
const analyzer = agent({
  prompt: "Analyze this input: {{ state.input }}",
  activateOn: ["workflow:start"],  // React to workflow start
  emits: ["analysis:complete"],    // Emit when done
  updates: "analysis",             // Update state.analysis with output
});

// 4. Run the workflow
const result = await runReactive({
  agents: { analyzer },
  state: { input: "Hello, world!", analysis: null },
  harness: new ClaudeHarness(),
  endWhen: (s) => s.analysis !== null,
});

console.log(result.state.analysis);
// Signals: workflow:start → agent:activated → harness:end → analysis:complete → workflow:end

Core Concepts

ConceptDescription
SignalAn event that flows through the system (workflow:start, analysis:complete)
AgentA reactive unit that subscribes to signals and produces output
WorkflowA container that coordinates agents and manages state
HarnessAn AI model adapter (Claude, OpenAI) that executes agent prompts

Get Started

Signal Patterns

Agents activate on signal patterns:

// Activate on workflow lifecycle
activateOn: ["workflow:start"]

// Activate on custom signals from other agents
activateOn: ["analysis:complete", "review:done"]

// Activate on harness events (advanced)
activateOn: ["harness:end"]

// Activate on state changes
activateOn: ["state:analysis:changed"]

Installation

bun add @open-harness/core

For testing utilities:

bun add -D @open-harness/vitest

On this page