AutoHarness
AutoHarness is an open-source governance framework that wraps AI agent LLM clients with a structured pipeline for tool safety, context management, cost tracking, and audit logging.
At a Glance
Fully free and open-source under the MIT License. Clone, use, modify, and distribute freely.
Engagement
Available On
Alternatives
Listed May 2026
About AutoHarness
AutoHarness (also called "Aha") is a lightweight, MIT-licensed Python framework published by aiming-lab that adds governance infrastructure around AI agent tool calls. It integrates in as few as two lines of code by wrapping any OpenAI-compatible client, making it immediately usable without restructuring existing agent code. The project reached v0.1.0 in April 2026 and has accumulated 283 stars and 22 forks on GitHub as of May 2026.
What It Is
AutoHarness is a harness engineering framework — a layer that sits between an AI agent's model and its tool execution environment. The core idea, as the project README states, is that "Agent = Model + Harness": the model reasons, and the harness handles everything else. That "everything else" includes context management, tool governance, cost attribution, session persistence, prompt injection defense, and audit logging. The framework is positioned as the infrastructure that separates a demo-ready agent from a production-reliable one.
The Governance Pipeline
The central mechanism is a structured multi-step pipeline that every tool call passes through before and after execution. AutoHarness offers three pipeline modes with increasing levels of governance:
- Core — 6-step pipeline with secret scanner, path guard, and output sanitizer; suited for single-agent lightweight governance
- Standard — 8-step pipeline adding a risk classifier and pre-hooks; suited for production agents with basic profiles
- Enhanced (default) — 14-step pipeline adding a turn governor, alias resolution, failure hooks, and support for Fork/Swarm/Background multi-agent patterns; maximum governance
The 6-step base pipeline flows: Parse & Validate → Risk Classify → Permission Check → Execute → Output Sanitize → Audit Log. Built-in risk patterns detect dangerous operations, secret exposure, and path traversal.
Key Capabilities
- YAML constitution: governance rules are declared in a
constitution.yamlfile, switchable via CLI or code - Token budget management: multi-layer context truncation keeps agents within model limits
- Per-call cost attribution: model-aware pricing tracks spend at the individual tool-call level
- Multi-agent profiles: role-based governance for fork, swarm, and background agent patterns
- JSONL audit trail: every decision is logged with full provenance for compliance
- Trace-based diagnostics: structured traces for debugging agent behavior
- CLI tooling:
autoharness init,autoharness validate,autoharness audit summary,autoharness install --target claude-code, and more
Setup Path
Installation requires Python 3.10+ and is done via pip install -e . from the cloned repository. The quickstart wraps an existing OpenAI client with AutoHarness.wrap(OpenAI()) — no graph DSL or XML configuration required. An AgentLoop class is also available for full agent loop management with a constitution file. The CLI provides an interactive init wizard covering agent type, LLM provider, security level, and pipeline mode.
Update: v0.1.0 Release
The initial public release (v0.1.0) was published on April 2, 2026. It shipped the three-tier pipeline modes, the 6-step governance pipeline, risk pattern matching, YAML constitution support, trace-based diagnostics, multi-agent profiles, and session persistence with cost tracking. The project README reports 958 tests passing at release. The repository was last updated on May 20, 2026, with no open issues at that time. The README notes that some architectural decisions in Enhanced mode were informed by publicly available community analysis of Claude Code's design, and explicitly states that AutoHarness does not contain or redistribute any of Anthropic's proprietary code.
Community Discussions
Be the first to start a conversation about AutoHarness
Share your experience with AutoHarness, ask questions, or help others learn from your insights.
Pricing
Open Source
Fully free and open-source under the MIT License. Clone, use, modify, and distribute freely.
- Full governance pipeline (Core, Standard, Enhanced modes)
- 6-step to 14-step tool call pipeline
- YAML constitution
- Token budget management
- Per-call cost attribution
Capabilities
Key Features
- 6-step governance pipeline for every tool call
- Three pipeline modes: Core, Standard, Enhanced
- YAML constitution for declarative governance rules
- Token budget management and context truncation
- Per-call cost attribution with model-aware pricing
- Multi-agent profiles with role-based governance
- JSONL audit trail with full provenance
- Trace-based diagnostics
- Prompt injection defense
- Secret scanner and path guard
- Output sanitizer
- Risk pattern matching
- Session persistence
- CLI tooling (init, validate, audit, install, export)
- 2-line integration via client wrapping
- AgentLoop for full agent loop management
- Fork, Swarm, and Background multi-agent support
- MIT licensed, zero vendor lock-in
