HarnessRouter/harnessrouter

HarnessRouter Community Edition: the self-hosted, Apache-2.0 edition of the unified interface for agent harnesses. Run Codex, Claude Code, Hermes, PI, DSH, and more through one API, with sessions, streaming, files, cancellation, and failure handling. Implements the Unified Harness Protocol (UHP), an open standard. Your keys, your infrastructure.

What it solves

Building a product that uses AI agents usually means wiring each agent tool (like Codex or Claude Code) into your backend separately — every harness has its own API, quirks, and integration work. HarnessRouter removes that burden: it's an infrastructure layer that turns existing agent harnesses into plug-and-play backends behind one API. Your product talks to a single interface and can switch between harnesses (or add new ones) without redoing integrations.

How it works

HarnessRouter runs as a self-hosted Docker container with three internal parts: a Console (web UI on port 3000), a Gateway (the API on port 8080), and a Runner (port 8081) that executes harnesses in isolated session workspaces. Data — database, files, secrets, workspaces — lives in a named volume.

You start it with one Docker command, sign into the Console, and connect a model provider by pasting your own API key. Then you describe what your agent should do, and HarnessRouter builds the setup: it writes the agent's instructions, picks a harness and model, and leaves an example request ready to run.

For product integration, you call an OpenAI Responses-compatible API at /v1/responses, selecting which harness to use via metadata.harness_id. The API supports starting tasks, continuing sessions, streaming progress, attaching files, cancelling, and structured errors. It also offers idempotency (retry without double-running), W3C trace context propagation, and secret redaction.

Who it's for

Teams building agent-powered products who don't want to maintain integrations for each agent harness. Also developers who want to self-host their agent infrastructure and keep provider keys, sessions, and files under their control. It supports 31 harness bases including Codex, Claude Code, Aider, OpenHands, and Gemini CLI.

Highlights

  • One API for 31 agent harnesses (Codex, Claude Code, Aider, OpenHands, Gemini CLI, and more), switchable per task
  • OpenAI Responses-compatible API with streaming, files, cancellation, and structured failures
  • Self-hosted Community Edition: one Docker command, ~4 GB disk, your own provider keys, no account required
  • Idempotent retries so a task never runs twice
  • W3C trace context joins your provider's logs with your task's trace
  • Secret redaction: values passed via env references are scrubbed from responses, streams, traces, and stored records
  • Starter kits (Slides, Sheets, Dashboards, Videos, Harness Bot) show harnesses as pluggable backends
  • Benchmarks show up to 99.8% lower cost and 3.2x faster latency between harness/model configurations on the same task
  • Apache 2.0 license

Related

  • Project
  • Project
  • Project
  • Project
  • Project