Covert Tool

OpenHarness: Open Agent Harness

A comprehensive guide to the open-source infrastructure for building powerful AI agents

Introduction

The world of AI agents is evolving rapidly, but building production-ready agents remains challenging. While Large Language Models provide incredible intelligence, they need infrastructure to interact with the worldβ€”tools to execute actions, memory to persist knowledge, permissions to ensure safety, and coordination to work with other agents.

Enter OpenHarnessβ€”an open-source Python implementation that delivers core lightweight agent infrastructure. It provides the complete "harness" that wraps around an LLM to transform it into a functional agent. The model provides intelligence; the harness provides hands, eyes, memory, and safety boundaries.

OpenHarness is designed for researchers, builders, and the community to understand how production AI agents work, experiment with cutting-edge tools and coordination patterns, extend the harness with custom plugins, and build specialized agents on proven architecture.

What is an Agent Harness?

An Agent Harness is the complete infrastructure that wraps around an LLM to make it a functional agent. Think of it as the difference between having a brilliant mind and having that mind equipped with tools, knowledge, observation capabilities, and the ability to take action safely.

The harness equation is simple yet powerful:

Agent Harness = Tools + Knowledge + Observation + Action + Permissions

OpenHarness implements this equation through a comprehensive set of subsystems that work together to create a robust, production-ready agent platform. Whether you're building a coding assistant, a research agent, or a multi-agent system, OpenHarness provides the foundation you need.

Key Features of OpenHarness

πŸ”„ Agent Loop Engine

The heart of OpenHarness is its streaming tool-call cycle. The engine handles the complete loop: query β†’ stream β†’ tool-call β†’ response. It features API retry with exponential backoff, parallel tool execution, and comprehensive token counting with cost tracking. The model decides what to do; the harness handles howβ€”safely, efficiently, with full observability.

πŸ”§ Comprehensive Toolkit

With 43+ built-in tools covering file I/O, shell operations, search capabilities, web fetching, and Model Context Protocol (MCP) integration, OpenHarness provides everything agents need to interact with their environment. Every tool includes Pydantic input validation, self-describing JSON Schema for model understanding, permission integration, and PreToolUse/PostToolUse hook support.

πŸ“š Skills System

Skills are on-demand knowledgeβ€”loaded only when the model needs them. OpenHarness supports 40+ skills covering development workflows like git commits, code review, debugging, planning, testing, and more. The system is compatible with anthropics/skills, so you can simply copy .md files to your skills directory.

🧠 Context & Memory

OpenHarness includes sophisticated context management with CLAUDE.md discovery and injection, automatic context compression, persistent MEMORY.md for cross-session knowledge, and session resume capabilities. This ensures agents can maintain context across conversations and learn from previous interactions.

πŸ›‘οΈ Governance & Permissions

Safety is paramount. OpenHarness provides multi-level permission modes (Default, Auto, Plan Mode), path-level and command rules, comprehensive hooks for lifecycle events, and interactive approval dialogs. You can control exactly what your agents can do and where they can operate.

🀝 Swarm Coordination

Multi-agent systems are supported through subagent spawning and delegation, team registry and task management, background task lifecycle management, and integration with ClawTeam coordination patterns. This enables complex workflows where multiple agents collaborate on tasks.

Architecture Overview

OpenHarness implements the core Agent Harness pattern with 10 interconnected subsystems:

🧠 Engine

Agent Loop β€” query β†’ stream β†’ tool-call β†’ loop

πŸ”§ Tools

43 Tools β€” file I/O, shell, search, web, MCP

πŸ“š Skills

Knowledge β€” on-demand skill loading (.md files)

πŸ”Œ Plugins

Extensions β€” commands, hooks, agents, MCP servers

πŸ›‘οΈ Permissions

Safety β€” multi-level modes, path rules, command deny

⚑ Hooks

Lifecycle β€” PreToolUse/PostToolUse event hooks

πŸ’¬ Commands

54 Commands β€” /help, /commit, /plan, /resume, ...

🌐 MCP

Model Context Protocol client

🧠 Memory

Persistent cross-session knowledge

🀝 Coordinator

Multi-Agent β€” subagent spawning, team coordination

These components work together through a unified flow: User Prompt β†’ CLI or React TUI β†’ RuntimeBundle β†’ QueryEngine β†’ Anthropic-compatible API Client β†’ Tool Registry β†’ Permissions + Hooks β†’ Execution β†’ Results back to QueryEngine.

Quick Start Guide

One-Click Install

The fastest way to get startedβ€”a single command handles OS detection, dependency checks, and installation:

Install OpenHarness
curl -fsSL https://raw.githubusercontent.com/HKUDS/OpenHarness/main/scripts/install.sh | bash

Prerequisites

  • Python 3.10+ and [uv](https://docs.astral.sh/uv/)
  • Node.js 18+ (optional, for the React terminal UI)
  • An LLM API key

One-Command Demo

Run OpenHarness
# Example: use Kimi as the backend
export ANTHROPIC_BASE_URL=https://api.moonshot.cn/anthropic
export ANTHROPIC_API_KEY=your_kimi_api_key
export ANTHROPIC_MODEL=kimi-k2.5

# Launch OpenHarness
uv run oh

Configure a Workflow

Use the unified setup flow instead of manually thinking about auth β†’ provider β†’ model:

Setup Workflow
uv run oh setup

This walks through choosing a workflow (Anthropic-Compatible API, Claude Subscription, OpenAI-Compatible API, Codex Subscription, or GitHub Copilot), selecting a backend preset, authenticating if needed, picking a model, and saving the profile.

Provider Compatibility

OpenHarness treats providers as workflows backed by named profiles. It supports a wide range of backends:

Provider Type Examples
Anthropic-Compatible Claude official, Moonshot/Kimi, Zhipu/GLM, MiniMax
OpenAI-Compatible OpenAI, OpenRouter, DashScope, DeepSeek, GitHub Models, SiliconFlow, Groq, Ollama
Subscription Bridges Claude CLI, Codex CLI
OAuth Workflows GitHub Copilot (device flow)

Extending OpenHarness

Add a Custom Tool

Creating custom tools is straightforward with Pydantic-based validation:

custom_tool.py
from pydantic import BaseModel, Field
from openharness.tools.base import BaseTool, ToolExecutionContext, ToolResult

class MyToolInput(BaseModel):
    query: str = Field(description="Search query")

class MyTool(BaseTool):
    name = "my_tool"
    description = "Does something useful"
    input_model = MyToolInput

    async def execute(self, arguments: MyToolInput, context: ToolExecutionContext) -> ToolResult:
        return ToolResult(output=f"Result for: {arguments.query}")

Add a Custom Skill

Create skills as Markdown files with frontmatter metadata:

my-skill.md
---
name: my-skill
description: Expert guidance for my specific domain
---

# My Skill

## When to use
Use when the user asks about [your domain].

## Workflow
1. Step one
2. Step two
...

Add a Plugin

Plugins can include commands, hooks, and agents. Create a plugin structure:

plugin.json
{
  "name": "my-plugin",
  "version": "1.0.0",
  "description": "My custom plugin"
}

OpenHarness is compatible with claude-code plugins and has been tested with 12 official plugins including commit-commands, security-guidance, hookify, feature-dev, code-review, and pr-review-toolkit.

Ecosystem & Integration

OpenHarness is designed to work seamlessly with existing AI development ecosystems:

πŸ–₯️ Terminal UI

The React/Ink TUI provides a full interactive experience with command picker, permission dialogs, mode switcher, session resume, animated spinners, and context-aware keyboard shortcuts.

πŸ§‘β€πŸ’Ό ohmo Personal Agent

A personal-agent app built on top of OpenHarness with its own workspace, gateway, bootstrap prompts, and channel configuration. It supports Telegram, Slack, Discord, and Feishu channels.

🌐 Model Context Protocol

Full MCP client implementation for connecting to external services and resources through the standardized Model Context Protocol.

πŸ“Š Testing & Quality

Test Suite Tests Status
Unit + Integration 114 βœ… All passing
CLI Flags E2E 6 βœ… Real model calls
Harness Features E2E 9 βœ… Retry, skills, parallel, permissions
React TUI E2E 3 βœ… Welcome, conversation, status
Real Skills + Plugins 12 βœ… anthropics/skills + claude-code/plugins

Conclusion

OpenHarness represents a significant step forward in making AI agent development accessible and reproducible. By providing a complete, open-source infrastructure that combines tools, skills, memory, permissions, and multi-agent coordination, it enables developers to focus on building intelligent agents rather than reinventing the foundational infrastructure.

Whether you're a researcher exploring agent architectures, a developer building specialized AI assistants, or an organization looking to standardize your AI agent platform, OpenHarness provides the robust foundation you need. The model is the agent. The code is the harness.

CovertTool Team Building developer tools for the modern web