Production agents runtime

harness-foundry

Practical, composable harness engineering for production agents.
The missing runtime layer between model and reliable behaviour.

Harness Foundry — Model → Primitives → Runtime → Trace → Evidence
CI npm Node MIT

One session, end to end

Compose harnesses from declarative primitives. Run sessions, record traces, evolve stacks from real runs — with human gates.

Model
interface
Primitives
compose
Runtime
session
Trace
jsonl
Evidence
outerloop

Where it sits

Design the loop. Execute the harness. Govern the outcome.

Try it now

Zero-config minimal stack — validate, run, inspect the trace.

# scaffold
npx @cobusgreyling/harness-foundry init --from minimal
foundry validate
foundry run --goal "Verify harness wiring"
foundry sessions list
foundry trace show --session <id>
foundry evolve report --session <id>

# IDE hosts
foundry host integrate cursor    # or claude-code

# full monorepo demo
git clone https://github.com/cobusgreyling/harness-foundry.git
cd harness-foundry && pnpm install && pnpm build && pnpm demo

Five ways to use it

From CI smoke tests to full governance — pick a stack and grow.

01 · MINIMAL

60-second smoke stack

Smallest reliable harness for CI and first exploration.

npx @cobusgreyling/harness-foundry init --from minimal
foundry validate && foundry run --goal "Hello"
02 · IMPLEMENTER

Production-shaped loops

Git worktrees, test recovery, evidence emission.

foundry init --from implementer --name my-app
foundry run --goal "Implement feature X" --turns 2
foundry evolve proposal --session <id>
03 · OUTERLOOP

Runtime + governance

Evidence → verdict → answerability in one flow.

foundry run --goal "Implement with evidence"
outerloop verdict review <evidence-id>
outerloop ledger why <evidence-id>
04 · IDE HOSTS

Cursor & Claude Code

Same versioned stack inside your IDE — not a one-off prompt.

foundry host integrate cursor
foundry host detect
foundry run --goal "…" --host cursor
05 · EVOLVE

Trace-driven evolution

Turn runs into stack improvements — with human gates.

foundry evolve report --session <id>     # L1
foundry evolve proposal --session <id>   # L2
# human reviews before stack.yaml change
CI · GATE

Validate stacks in PRs

Reusable workflow for stack validation on every pull request.

jobs:
  foundry-gate:
    uses: cobusgreyling/harness-foundry/
      .github/workflows/foundry-gate.yml@main

Primitive layers

Versioned, declarative, swappable. Browse with foundry primitives list.

LayerPrimitives
Interfacemodel/mock, model/anthropic, model/openai, model/grok
Compositioncontext/*, tools/mcp-stdio, tools/search-grep, memory/file-log
Executioncontrol/*, sandbox/*, policy/*
Reliabilityobservability/*, emit/outerloop-evidence, recovery/*

Don’t want to touch TypeScript? Propose a primitive.

vs alternatives

ApproachStrengthGap foundry fills
Raw Agent SDKModel accessNo composable taxonomy, traces, or governance seam
LangGraph / ADKGraph orchestrationGraph-first, not primitive-first harness engineering
Cursor / Claude CodeIDE agentsHost-specific; hard to version and evolve
loop-engineeringLoop patternsPatterns without executable runtime
outerloopEvidence & verdictsGovernance without inner-loop execution

Full comparison →

Get involved