- Runtime.Run rejects concurrent invocations instead of racing on shared state; panics in tools, hooks, and permission checkers are recovered and surfaced as errors/denials instead of crashing the loop
- AgentSpec.Loop now actually overrides RuntimeDeps.AgentLoop per-agent, as documented
- session.Store validates agent ID / session key as single path components, preventing traversal outside the session directory
- ValidatePathInWorkDir resolves symlinks on the target itself, not just its parent, closing a workspace-escape gap
- bash tool now fails closed on an unrecognized ExecPolicy.Level instead of allowing everything
- browser tool rejects unknown actions instead of silently no-op'ing
Bump README to v0.3.4 and document the AgentSpec.Loop override semantics.
Removes the standalone comparison.md (analysis kept locally only) and
folds its key positioning insights into the README without naming
specific competitors.
Why-Harness section:
- Reframes the substrate-vs-DSL distinction more directly: the
runtime is treated as strategic infrastructure you own, not as
plumbing hidden behind a graph builder.
- Capitalises 'Harness' in prose to match the project name.
New 'What Harness is for' section enumerates the use cases the
runtime is shaped around:
- coding agents
- infrastructure-automation agents
- long-running autonomous loops
- local-first agents
- tool-heavy agents
- developer-tooling agents
Plus a one-paragraph note on why Go's operational profile (static
binary, low memory, native concurrency, embeddability) matters
for these.
New 'When Harness is the wrong fit' section names the workflow
shapes the package isn't optimised for — visual / declarative
workflows, role-based crews, RAG-first products, notebook research,
heavily-regulated enterprise orchestration — without naming any
competing framework.
The existing 'Non-goals' section still covers what the library
doesn't ship (CLI, UI, channel adapters, etc.); the two sections
serve adjacent purposes.
New top-level document comparing Harness's approach against LangGraph,
CrewAI, AutoGen/AG2, Semantic Kernel, OpenAI Agents SDK, Claude Agent
SDK, LlamaIndex, Mastra, and the Go peers eino + langchaingo.
Frames Harness as a runtime-centric, in-process Go library closer in
spirit to coding-agent runtimes (Claude Code, OpenClaw, OpenHands)
than to graph-based or role-based orchestration frameworks. Includes
current GitHub stats, per-framework architectural comparisons, the
language-choice tradeoff, the abstraction-fatigue trend, and where
Harness is the right (and wrong) pick.
README links to it next to the developer.md pointer; .gitignore
whitelists comparison.md alongside the other tracked docs.
Promotes the two remaining "deliberately not in scope" components from
the harness model to first-class subsystems, and overhauls the docs.
Hooks (runtime/types.go, runtime/runtime.go, runtime/hooks_test.go):
- New runtime.LifecycleHooks struct on LoopConfig.Hooks with five
Go callbacks: OnUserPromptSubmit (may rewrite prompt),
OnSessionStart, BeforeToolUse (gating with same shape as
PermissionChecker), AfterToolUse (observe), OnStop (with reason:
completed/max_turns/error/aborted).
- Wired into Run, dispatchTool, executeToolKickoff at all 8 exit
points + both tool-execution paths.
- 8 tests covering each hook firing.
MCP (tools/mcp/, runtime/builder.go, runtime/types.go):
- New tools/mcp package using the official
github.com/modelcontextprotocol/go-sdk v1.5.0. Stdio and
Streamable HTTP transports.
- ServerConfig now exposes Headers + HTTPClient for HTTP auth
(static bearer, OAuth via oauth2.NewClient, mTLS, custom
RoundTripper). Header injection clones requests so SDK retries
see clean params.
- First-class AgentSpec.MCPServers — BuildRuntime connects each
server, registers adapter tools (mcp__<server>__<tool>), stashes
clients on Runtime.
- New Runtime.Close() releases sessions; idempotent.
- 14 tests including end-to-end header propagation through the SDK
via httptest.Server.
Examples:
- support-agent now demonstrates Skills + Permission + LifecycleHooks
together. Audit log via AfterToolUse + OnStop, JSONL output.
- defer rt.Close() added to all four examples (no-op without MCP,
idiomatic).
Docs:
- README expanded: Why harness, Requirements, Install, Examples
table, Configuration (env vars), Non-goals, Testing, expanded
Status. Quick Start fixed to use real BuildRuntime API.
- developer.md mental-model diagram replaced with two correct ones:
composition (how a Runtime is wired) and per-Run sequence (what
rt.Run actually does, including hook fan-out and the tool batch
loop).
- developer.md gains Lifecycle hooks + MCP servers subsections with
full snippets, including Streamable HTTP auth and OAuth recipes
(clientcredentials + authcode flows via golang.org/x/oauth2).
- LICENSE file added (MIT).
All 18 packages build and test green.
Demonstrates two harness surfaces the previous examples skipped:
- SkillProvider: KB articles in examples/support-agent/kb/ are exposed
via runtime.SkillProvider. The runtime auto-registers load_skill and
inlines a compact article index into the static (cacheable) system
prompt; full bodies load on demand.
- PermissionChecker: tickets_update and escalate_to_human are gated on
a 'supervisor' flag. FilterToolDefs hides the gated tools from the
LLM tool list in non-supervisor mode so it doesn't waste turns
inventing calls that would just be denied.
Five concrete tools (kb_search, tickets_get, tickets_create,
tickets_update, escalate_to_human) plus the auto-registered load_skill.
Five seed KB articles cover refund policy, escalation matrix, account
recovery, password reset, and API rate limits — chosen to exercise the
common support patterns each tool involves.
In-memory ticket store (examples/support-agent/store.go) seeded with
four tickets in different states. Webhook delivery for escalations is
optional via SUPPORT_AGENT_WEBHOOK; when unset the tool prints the
escalation banner to stdout, so the demo runs with only
ANTHROPIC_API_KEY set.
Tests (support_test.go) cover store CRUD, defensive copying, the
permission checker's read/write split, and KB indexing/search — all
offline, no API needed.
developer.md: practical guide to writing agents on harness — mental
model, minimum-viable agent, tool authoring rules, provider table,
session persistence, streaming events, LoopConfig knobs, subagents,
and the four optional plug points (Permission, Compaction, Skills/
Memory, KnowledgeGraph). Whitelisted in .gitignore alongside README.md.
Also ignore /examples/<dir>/<binary> so 'go build ./examples/...'
doesn't leave artifacts the next 'git status' has to step around.