
kcp-harness — KCP compliance proxy
no.cantara由 cantara.no 發布v0.4.1更新於 Oct 24, 2026
MCP compliance proxy between agent and tools: deterministic governance, fail-closed, audit trail.
概覽
一個介於 AI 編碼代理與其工具之間的 MCP 合規代理,以確定性方式治理知識存取並產生稽核產物。
- 可以做什麼
- 攔截代理發出的知識相關工具呼叫,並透過不涉及 LLM 的確定性 14 道閘門規劃器進行路由。提供 kcp_plan、kcp_load、kcp_trace、kcp_validate、harness_status、harness_budget、harness_temporal_check、harness_approvals 與 harness_assess 等治理工具。在代理正常運作時附帶產生決策軌跡、僅可附加的稽核日誌、預算帳本、時間漂移事件與人工核准工單。故障關閉:若請求無法驗證,代理將得不到任何內容。
- 適用情境
- 適用於代理需要對受治理知識進行可稽核、可重現且受預算控制的存取時,例如企業或合規敏感的編碼工作流程。它旨在增加治理層而不取代代理,並支援與 Claude Code、Cursor、Copilot、Windsurf、Cline、Continue、Crush、OpenClaw 與 Pi 等代理整合。
- 執行需求
- 以本機程序透過 stdio 執行,可透過 npm 安裝(npm install -g kcp-harness)或以 npx 執行;亦提供預先建置的原生二進位檔。需要 harness.yaml 設定與 knowledge.yaml 清單。未宣告驗證、環境變數或標頭。僅限桌面端。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 kcp-harness — KCP compliance proxy,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
kcp-harness
🧾 See it run — interactive KCP playground · read the reveal
Deterministic knowledge governance for any AI agent.
Your agent can read every file in your project. Can it prove why it read what it read?
KCP Harness is an MCP compliance proxy that sits between an AI coding agent and its tools. It intercepts knowledge-related calls, routes them through the kcp-agent deterministic planner (14-gate cascade, no LLM), and produces compliance artifacts — decision traces, audit logs, budget ledgers — as a side effect of normal agent operation.
The agent can't bypass governance because it only talks to the proxy's MCP interface. The proxy decides what knowledge is accessible, tracks spend, and logs every decision. Fail-closed: if the harness can't verify a request, the agent gets nothing.
Why
Enterprises need agents that are defensible — auditable, reproducible, budget-controlled, temporally pinned. Today's agents can't prove why they read what they read. The harness adds a compliance layer without replacing the agent.
You sell the compliance layer. The agents are pluggable.
Install
Or use without installing:
Native executables
Pre-built binaries (no Node/Deno required) for Linux x64/arm64, macOS x64/arm64, and Windows x64 — grab them from a release. To build one yourself:
Quick start
1. Initialize
2. Generate agent integration
3. Start coding
Your agent now routes knowledge access through the harness. Every decision is logged.
Supported agents
Each agent has its own MCP config format, rules file, and quirks. The integrate command handles
them all — one governance layer, any agent.
How it works
Every tool call flows through a five-stage pipeline:
Classifier
The classifier examines each tool call and determines whether it targets governed knowledge.
Read("docs/api.md") where docs/ is governed? Route through the planner. Read("package.json")
where package.json isn't governed? Pass through. KCP tools (kcp_plan, kcp_load) are always
governed.
Governor
Two automated modes, plus a human gate that outranks both:
- Plan-first (fast path) — the agent calls
kcp_planfirst. The harness caches the approved plan. Subsequent reads are checked against the cached plan — no re-planning. - Auto-plan (fallback) — the agent reads a governed path without planning. The harness runs
the planner automatically. Slower, but governance is enforced even for agents that don't know
about
kcp_plan. - Human approval — calls matching a
governance.approvalsrule are held for a named reviewer (pending), no matter what the automated paths would decide. Tickets survive restarts and resolve via thekcp-harness approvalsCLI (or any customApprovalProviderchannel). Resolutions require a named reviewer and a policy citation.
The 14-gate cascade
Every knowledge unit is evaluated through 14 deterministic gates, in order:
A unit must pass all gates. The gate that blocks it is recorded in the decision trace. Same inputs → same plan. No model involved.
For the skill_eligibility gate's subject matter — governed kind: skill units — the
authoring conventions, linter, and conformance vectors live in
Cantara/kcp-skill.
MCP tools
Once connected, agents can use these governance tools:
Compliance artifacts
Audit log
Append-only JSONL. Every decision — governed or pass-through — is logged with sequence number, timestamp, tool, targets, and governance decision:
Budget ledger
Append-only itemized spend tracking. Per-currency running totals. Ceiling enforcement — a load that would exceed the budget is rejected atomically (no partial loads).
Temporal governance
Plans are registered with a temporal watcher. On subsequent calls, the watcher re-evaluates against the current time. If units have drifted (expired, newly valid), the harness emits a drift event. Long-running sessions stay honest.
Approval tickets
Calls matching an approval rule open a durable ticket
(pending_review → approved | dismissed | expired, plus used for a consumed one-shot grant). The ticket store survives restarts —
sessions are ephemeral, human review is not. Every resolution records who approved,
when, and which policy it satisfies — evidence generated at approval time, never
reconstructed from logs.
An approval is a bounded grant, never a standing permission. It covers the session that
opened the ticket, the exact tool and target, and the call's arguments digest — and it lapses.
Each rule sets grant: once | session | <duration> (default session), always capped by
governance.approvals.grant_max (default 24h). A call outside a valid grant is denied, audited
as grant_denied (expired, wrong_session, used, ...) and opens a new ticket. A standing
permission is a policy rule, not a click. A grant's window is measured from the store's own
clock, not the reviewer-supplied reviewedAt; the first valid resolution of a ticket wins (a
dismissed ticket cannot be re-approved by an appended line); with
approvals.require_signed_resolutions signatures are verified on every read, not only in
resolve(); and approvals.require_args_binding refuses grants from tickets not bound to the
call's arguments. What the ticket store does not protect — write access to its directory — is
stated in the Ticket store trust model.
See Governance Model.
Confidence verdicts
harness_assess runs kcp-agent's post-synthesis
assess() over a synthesized answer before it may be acted on. The planner gates loading,
grounding gates asserting, this gates acting. Below-threshold verdicts on routed configs
open an approval ticket with the full verdict embedded as evidence.
Configuration
CLI
Library
Architecture
Forking agents puts you in competition. A harness puts you in composition.
Tests
Covers the classifier, governor (incl. approval precedence), approval state machine + providers, confidence-gate wiring, proxy, audit, budget ledger, temporal watch, evidence export, dashboard, and all agent integrations.
License
Apache-2.0 · By eXOReaction AS, hosted under Cantara.
來源:README.md,提交 2c399d2
工具
0版本歷史
1- v0.4.1最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分