Repository navigation
Releases
Harness v0.6.2
Patch release; no API changes.
Updated dependencies:
github.com/anthropics/anthropic-sdk-gov1.35.0 → v1.78.0google.golang.org/genaiv1.49.0 → v1.72.0github.com/modelcontextprotocol/go-sdkv1.5.0 → v1.8.0
Applications that also import these modules will be raised to at least these versions by Go's minimum version selection.
Also includes v0.6.1: when an MCP tool returns its result only as structuredContent (no text block), the MCP adapter passes the JSON to the agent instead of an empty result. Text still wins when present.
Requires Go 1.26, as introduced in v0.5.0.
Validation: Linux and Intel macOS CI passed the qualify gate.
Harness v0.6.0
New:
tools/web:ExaSearchTool(exa_search), backed by the Exa Search API. Returns ranked results with query-relevant highlights from each page, with optional search type (auto,fast,instant,deep-lite), category, include/exclude domain, and published-date filters. Requires an Exa API key (ExaSearchTool{APIKey: ...}); requests use the shared SSRF-safe search client.
Requires Go 1.26, as introduced in v0.5.0.
Validation: Linux and Intel macOS CI passed the qualify gate.
Harness v0.5.0
Breaking: Harness now requires Go 1.26. The module declares go 1.26.0, required by the Stagehand SDK. With the default GOTOOLCHAIN=auto, older local toolchains download 1.26 automatically; CI images or Dockerfiles pinned to Go 1.25 must be updated.
New:
tools/stagehand: a natural-language browser tool built on the Stagehand Go SDK. Actions:navigate,act,observe,extract(JSON, optional schema),get_text,screenshot,close, with persistent named sessions. Runs on local Chrome by default, or Browserbase whenConfig.BrowserbaseAPIKeyis set. Stagehand's internal inference runs through your harnessLLMProviderviaNewGenerateFunc, sharing the agent's usage observers and admission guards.- PDF attachments are sent to Anthropic as
documentblocks. - Opus 5.5 gets adaptive low-effort thinking when reasoning is off.
WebFetchTooloutput cap raised to ~1M tokens.
Dependency updates: invopop/jsonschema v0.13.0 → v0.14.0, golang.org/x/mod v0.33.0 → v0.38.0.
Validation: full test suite and vet passed locally on Go 1.26.0, tools/stagehand passed race tests and a live local-Chrome run; Linux and Intel macOS CI passed the qualify gate.
Harness v0.4.2
Fixes required by Hand v0.3.4:
- Preserve OpenAI-compatible finish reasons and trailing usage.
- Reject empty and output-truncated answers rather than reporting completion; the agent loop retries generic empty responses once without increasing the output allowance or replaying tools.
- Preserve conversation history when a summary is truncated.
- Emit complete tool-call arguments before execution so interfaces can display command previews.
Validation: affected packages passed local race tests; Linux and Intel macOS CI passed build, vet, the full race/coverage test gate and repeated lifecycle checks.
v0.4.1
Harness v0.4.0
Harness v0.4.0 adds explicit container execution, durable session graphs and recovery, request-level usage and budgets, and stronger cancellation and process cleanup.
Upgrade notes
- Anthropic
Usage.InputTokensincludes cache-read and cache-creation tokens. Do not add those subsets again or count request events and terminal aggregates twice. Unknown usage is not zero cost. SeeUSAGE.md. - New sessions use a version-1 identity header. Legacy sessions remain readable without mutation; explicit migration retains original backups. See
SESSION_FORMAT.md. - Back up sessions, attachments, configuration and the prior consumer binary before migration. To roll back, restore compatible pre-migration state; do not assume v0.3.9 can read rewritten state.
- Container execution fails closed when unavailable. Provider requests and explicitly trusted host-side MCP/extensions remain distinct from the tool container boundary.
Qualification
All four release PR/push checks passed before merge. Hosted Linux and Intel macOS each passed 1,114 test records and 80 lifecycle repetition records with zero skipped tests or gate errors. The tag targets tested commit 5d4632ffe3fdfeb171bb217a45ae75bef056811e. Raw results, platform identity and immutable fixture image IDs are retained in workflow artifacts.
This release does not claim coding-quality superiority to Pi or completion of Hand's original evaluation plan.
Harness v0.3.9
Changes
Consolidates v0.3.7–v0.3.9 (all landed within the same working session);
v0.3.7 and v0.3.8 were not individually released.
- Replace the Qwen provider with
litellmandopenrouter— both
thin OpenAI-compatible constructors, no new request/stream code. - Add
Runtime.DynamicIdentityHint: caller-set text resent fresh every
turn's system prompt, for facts (like an active model name) that need
to win against a model's own prior in-conversation statements. - Add a regression test proving a mid-session model switch actually
changes the request sent to the LLM, not just the system prompt text. - Add a
localprovider (providers/local,NewLocalProvider) for
locally-served models — Ollama, LM Studio, llama.cpp's server, vLLM —
no API key, defaults to Ollama's endpoint. (Briefly shipped as
providers/ollamain v0.3.8, renamed before anything else depended
on that name.) - Generalize Gemini context-window detection by tier.
Full Changelog: v0.3.6...v0.3.9
Harness v0.3.6
Changes
- Preserve native Anthropic thinking and output configuration when Harness is used as a protocol proxy.
- Preserve explicit zero temperature separately from an omitted temperature.
- Add regression coverage for adaptive, enabled, and disabled thinking modes.
v0.3.2
Accumulated changes since v0.3.1 — headlined by a token-accounting correctness fix, plus a batch of security, provider-correctness, and runtime hardening.
Headline
Run-total token usage on terminal EventDone
Runtime.Run previously emitted only the last turn's token usage on its terminal EventDone, so multi-turn runs under-reported tokens to any consumer metering AgentEvent.Usage. It now accumulates usage across all turns (summing input, output, and both cache fields via a pure, non-mutating addUsage helper) and emits the run total. RunTurn is unchanged (one turn per call). The calibrator still uses per-turn figures. Behavior preserved for usage-less providers (stays nil) and single-turn runs.
Security / SSRF hardening
SafeHTTPClientwith an IP-pinning transport;web_fetchand allweb_searchbackends now pin a validated IP.isPrivateIPblocks0.0.0.0/8, CGNAT, and reserved ranges; dual-stack fallback dials all validated IPs.- Browser tool blocks private-IP resolution via host-resolver-rules.
- Bash allowlist mode: reject real newline/CR and redirection; treat background
&as a command separator (S1 bypass closed).
Provider correctness
- Anthropic: surface in-band stream errors; Builder accumulation.
- Gemini: emit a single
EventDonewith final usage; recognize 429/5xx as retryable via typedAPIError. - OpenAI / Qwen: index-order tool emission for prompt-cache determinism;
strings.Builderfor tool-arg accumulation; Qwen requests usage stats. - Retry classifier scoped to bounded 429/529 forms.
Runtime & tools
- Single-turn
RunTurnAPI; bounded-synchronous KG recall and KG ingest on exchange completion. - Recover from pre-first-token stream errors; surface and recover from model refusals.
- Atomic file writes (
write_file/edit_file0600, preserve mode);read_file/edit_filesize caps to prevent OOM; honor ctx cancellation. - Calibrator recomputes estimate at
EventDone(stale-estimate fix); session persistence ordering and degraded-persistence warnings. - Token estimation: count attached images; 1M context window for Fable 5 / Mythos 5 / Opus 4.6+ / Sonnet 4.6.
- Configurable per-tool-result truncation cap; MCP
Pingon Client.
See docs/ and package-level docs for details.
v0.1.0 — first tagged release
First tagged release of Harness, a reusable Go agentic platform for building LLM agents.
What's in v0.1.0
A complete, in-process, library-shaped agent harness covering 11 of the 13 standard agent-harness components:
- Streaming agent loop (
runtime.Runtime.Run) — single goroutine,<-chan AgentEventfor everything (text deltas, tool calls, tool results, done/error/aborted). - Four LLM providers under one
llm.LLMProviderinterface: Anthropic (with prompt caching), OpenAI / OpenAI-compatible / local Ollama, Google Gemini, Alibaba Qwen. - Tool registry & permissions with concurrency-safe partitioning (
Tool.IsConcurrencySafe+LoopConfig.MaxToolConcurrency, default 10) andtool.PermissionCheckergating both at dispatch and at tool-list-assembly time. - Context compaction (
compaction.Manager) — summarize-and-splice at clean user-message boundaries; tool-result pruning at request time; structured 9-section summary inside<analysis>+<summary>tags. - Cacheable system prompt assembly via
llm.SystemPromptPart— splits the static cacheable prefix from the per-turn dynamic suffix; the request build is a pure function so the non-streaming retry path keeps the cache prefix valid byte-for-byte. - Sub-agents via
runtime.SubagentResolver+tool.TaskTool, capped at depth 3 by default. - Lifecycle hooks (
runtime.LifecycleHooksonLoopConfig.Hooks) — five typed Go callbacks:OnUserPromptSubmit,OnSessionStart,BeforeToolUse(gating, same shape asPermissionChecker),AfterToolUse,OnStop(with reason ∈ {completed, max_turns, error, aborted}). - MCP integration (
tools/mcppackage) — adapts external MCP servers' tools astool.Tools namespaced asmcp__<server>__<tool>. Stdio + Streamable HTTP transports via the officialgithub.com/modelcontextprotocol/go-sdkv1.5.0+. HTTP knobs includeHeaders(auth) andHTTPClient(mTLS, OAuth viagolang.org/x/oauth2, custom RoundTripper). First-classAgentSpec.MCPServersfor declarative wiring;Runtime.Close()releases sessions. - Skills (
runtime.SkillProvider) — auto-registers aload_skilltool; index goes in the cacheable system-prompt prefix, body loads on demand. Thesupport-agentexample shows the//go:embed kb/*.mdpattern. - Sessions — append-only
session.Sessionin memory by default, optionalsession.Storefor JSONL persistence and cross-process resume.
Examples
Four runnable agents in examples/:
| Example | What it shows |
|---|---|
minimal/ |
Smallest useful agent — file + bash + web tools, REPL, ~80 lines |
data-agent/ |
BYO custom tools hitting Singapore's open-data APIs |
lta-agent/ |
Same shape as data-agent, demonstrates parallel tool dispatch |
support-agent/ |
Skills + Permission + LifecycleHooks (audit log) wired together |
Documentation
README.md— packages, Quick Start, components, design notesdeveloper.md— step-by-step guide with composition + per-Run diagrams
Install
go get github.com/sausheong/harness@v0.1.0Requires Go 1.25.1+.
Non-goals
Harness is a library, not a product. No CLI, no UI, no channel adapters, no shell-command hooks, no skill marketplace. You own the binary; harness owns the loop. See the README's Non-goals section for the full list.
Stability
The v0.x line follows Go module semver: minor bumps may break API, patch bumps are bug-fix only.
License
MIT.