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:
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:
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
# 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:
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:
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:
---
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:
{
"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.