epistemic-harness
Provides GitHub Copilot authentication and request adaptation, including GitHub-token exchange for short-lived Copilot tokens, VS Code Chat fingerprint headers, X-Initiator, and derived Copilot base URLs.
Provides a Google AI auth adapter for OpenAI-compatible endpoints, using Bearer and x-goog-api-key credentials.
Supports Google Gemini via API key or Vertex environment credentials through the gateway, without a device-code login flow.
Supports OpenAI-compatible API endpoints through the proxy gateway, forwarding requests to an OpenAI upstream or compatible provider.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Epistemic & Dual-Process Governance Harness
Governance for LLM coding agents: evidence-bound claims, tiered cognition, and loops that exhaust problems instead of ping-ponging them.
中文介绍见 README_ZH.md。 All normative content (rules, contracts, skills) is English-only; Chinese exists only as auxiliary translation.
Communication language
Public-facing content — upstream issues and comments, this repo's issues/PRs, commit messages, and documentation — is written in English by default, unless explicitly stated otherwise for a specific piece. Chinese is kept as supplementary/private reference (e.g. README_ZH.md and internal notes). Existing content stays as-is; the convention applies going forward.
Harness issues
Any harness problem encountered during work — including self-inflicted ones — is filed as a GitHub issue in this repo at the time it is observed, so it can be resolved later instead of being lost in a session transcript.
Related MCP server: agentic-os-mcp
What it does
An LLM agent inside this harness cannot silently:
claim completion without evidence — quantified claims ("100% coverage", "all tests pass") must bind to a check the exit gate executed itself, or the gate blocks the turn (issue #2);
ask you to decide things that are already decided — a raised "decision point" must carry an L4 trade-off or a missing-evidence anchor, otherwise it is bounced as a fabricated decision (issue #3);
dismiss failures — buck-passing phrasing is intercepted only while verification is red, and every failure gets an owner:
code_defect / check_defect / env_missing / underdetermined;cheat the verifier — the verifier's own fingerprint is recorded; a green run right after the verifier changed is flagged;
repeat the same fix forever — a cross-turn ledger escalates identical failure fingerprints to root-cause analysis.
Agents also get: an L1–L5 epistemic memory with weakest-link confidence caps, hybrid retrieval (BM25 + CJK bigrams, per-tier banks that never blend), a data-driven task router (per-category model/effort decisions in YAML, validated against a capability matrix), three dispatch tiers (text-only / read-only sandboxed explorer / full tooled), and Docker-first verification with a declared host fallback.
Quickstart
git clone https://github.com/kylecui/epistemic-harness.git
cd epistemic-harness
python scripts/install.py # detect platform, prerequisites, ASKS FOR API KEYS, smoke test
docker compose up -d --build # start the gateway backend (127.0.0.1:8787)
pi # start Pi in the repo (loads AGENTS.md + MCP)The installer reads the model registry and prompts for exactly the provider keys
your configured models need (Enter keeps existing values; everything is skippable).
Prefer editing by hand? Put keys in .env instead — see
docs/configuration.md.
Two lighter paths if you do not want the full setup yet:
# Fastest: verification only — no venv, no install; the container IS the runtime
docker compose build verify && docker compose run --rm verify
# Minimal on the host: bootstrap python only, then the installer does the rest
python scripts/install.pyVerify at any time — the hvx wrapper resolves the project interpreter for you
(.venv first, then python3/py; verification itself runs in Docker by default):
./scripts/hvx # or: scripts\hvx.ps1 on Windows
./scripts/hvx -p "test_gate*" # unittest discovery patternHow it fits together
Layer | Component | Enforced by |
Contract |
| prompt + gateway |
Exit gate |
| deterministic code |
Verification runner |
| docker-first, host fallback |
Epistemic core |
| MCP tools |
Orchestration |
| MCP tools + gateway routing |
Docs |
|
|
Skills: commands you don't have to remember
harness-verify (./scripts/hvx), harness-status (dispatches / capability matrix /
memory stats), harness-maintain (recompile + revalidate after config edits), and
harness-config (provider keys, default model, pins) are registered in
skills/registry.yaml — matched and auto-attached by code at dispatch time, in
English and Chinese. Query them any time via the orchestrator MCP (query_skills).
Documentation
INSTALL.md — platform detection, prerequisites, full/limited support matrix
docs/configuration.md — LLM provider keys, default model selection, pins
docs/README.md — documentation index
docs/execution-runner.md — why verification runs in Docker first
docs/browser-runner.md — where the browser goes for CDP work
docs/workplan-v0.4.md — v0.4 delivery log with measured evidence
docs/UPGRADE.md — upgrade an existing install (idempotent migrations + rollback)
Development
git clone https://github.com/kylecui/epistemic-harness.git
cd epistemic-harness
./scripts/hvx # 296 tests, docker by default
python evals/run_evals.py --mock # fixture self-test 12/12 (tests the assertions, not models)
python evals/run_real_matrix.py # real-model golden matrix, reports -> evals/reports/
python evals/false_completion/run_experiment.py # false-completion inducement (baseline vs harness)
python evals/memory_effectiveness/run_experiment.py # memory effectiveness: behaviour, not hit rate
python scripts/check_eol.py # line-ending policy
python scripts/check_docs.py # docs/code sync gate (incl. test-count badge alignment)
python scripts/analyze_dispatches.py # what was delegated, to which model, at what effort
python scripts/capability_matrix.py # the (model × effort) schedulable space (estimate_only)
python scripts/controller_metrics.py # measured direct-write vs dispatch rate (not claimed)
python scripts/traces_panel.py # traces/ -> single-file HTML panelv0.5 quality program (2026-11-22)
Hard fixes for the self-deception channels found in the deep review, each with an adversarial suite:
L5 anti-laundering: citations must appear in this session's retrieval trace (GROUNDING_VIOLATION hard error); claim text matching an undeclared L3 heuristic is force-inherited as an implicit dependency and capped at L3 (13/13 attacks intercepted, 0/7 clean claims false-flagged).
Contract substance: boilerplate ("适用: 各种情况") no longer counts; acceptance must be falsifiable, rollback must name a mechanism; a structured
intercepted on both gateway and exit_gate).Real-model measurement: mock 12/12 is demoted to fixture self-test; real golden matrix / false-completion / memory-effectiveness reports land in evals/reports/ and are committed — README numbers must trace to a commit.
MIT licensed. See LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Control plane for autonomous software labor. Agents claim objectives over MCP with audit trail.
Public MCP for agent verification, work discovery and governed interoperability.
LLM cost optimization gateway, repo token-waste auditor & model arbitrage MCP server.
Pre-execution governance for AI agents. Deterministic PASS/FAIL/REVIEW verdicts, replayable proof.
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI agents to interact with a Git-native organizational governance system, supporting proposal-validation workflows, decision-making, and audit trail management through 21 MCP tools over stdio transport.1MIT
- AlicenseAqualityBmaintenanceRead-only MCP server that exposes the agentic-os governance, SDLC, and Quality Engineering methodology to any MCP host. It never writes to your repository and never executes code — it serves the methodology, plans an install, and verifies it, handing any commands back to the host to run.72Apache 2.0
- AlicenseAqualityBmaintenanceEnables supervising and orchestrating local coding agents like Muse and AGY through a client-agnostic MCP interface, with isolated Git worktrees, safe execution, and deterministic verification.1012 npmMIT
- FlicenseNot gradedqualityCmaintenanceEnables a security-first engineering agent with an MCP-style JSON-RPC tool boundary, role-based authorization, and UTC audit events for every decision.-