Repository navigation
Description
The situation
Follow-up to #789 and the RugSnare reference. Current main already has tool-definition SHA-256 pinning in internal/mcp/check_pins.go. This extends that implementation.
What works today, and why it is not enough
Live checks pin names, descriptions and input schemas, preserve changed baselines until --accept-tools, and use locked atomic writes. They currently establish the first baseline automatically, cannot explain contract changes, and identify a baseline by root/server name rather than its configured connection. The tool-list loop also returns success at its page cap even when a continuation cursor remains.
Ask
Two draft reference implementations, in merge order:
- MCP contract security 1/2: complete bounded inventories; strict response validation; full contract fingerprints and conservative directional diffs; existing audit rules applied to descriptor text; connection-bound, revision-checked explicit acceptance through the CLI and dashboard. Extend
tool-pins.jsonwith versioned records and retain old entries as legacy evidence. Static checks and sync do not approve tools. - MCP contract security 2/2: optional Ed25519 signatures on the same atomic store, using explicitly supplied external verification/signing keys. No automatic key provisioning. Unsigned migration preserves unselected records as legacy evidence rather than silently approving them.
These detect advertised contract changes at check time. They do not block tool calls, detect a malicious implementation behind unchanged contracts, or prevent replay of an older valid signed store. No proxy, runtime quarantine, telemetry, or production configuration changes.
Primary prior art: RugSnare, Apache-2.0. Tirith informs independently written requirements only; no AGPL code or fixtures will be copied or translated. Skillshare's native hash profile will be documented without claiming PIN-SPEC/RFC 8785 interoperability.
This is a design note and draft reference contribution, pending maintainer feature approval. Local test infrastructure is unavailable; draft PRs will state which checks have not run and use normal remote review/CI evidence. No passing-test or approved-label claim is implied.
Refs #789. The remaining five topics in that issue are outside this series.
Activity
salmonumbrella commentedon Nov 9, 2026
The first two drafts remain point-in-time contract review (#803) and signed approval state (#804). A third draft will add an explicitly opted-in, native tools-only guard for calls that actually pass through it.
The proposed
mcp guardcommand will expose stdio to the client and connect to one configured stdio or Streamable HTTP upstream. It will require an externally verified signed approval before upstream startup, capture a complete matching inventory before every call, and stop admitting calls after observed drift, an incomplete refresh, a lost notification channel or a changed session. It will not reapprove tools or write pin state. Only complete synchronous tool calls and the supported lifecycle will be exposed; unsupported tasks, routing extensions and interactive callbacks will be refused.Configuration output will be a print-only native snippet for later manual adoption. There is no automatic client configuration change, service deployment or key provisioning. Normal sync may report a conflict with a manually adopted wrapper, and explicit replacement or a direct connection can bypass it. A committed call can already have effects; unchanged-contract malicious implementation, startup effects, output meaning and calls bypassing the guard remain outside the protection.
This extends the proposed merge order to contract review → signed baselines → runtime guard. The third draft will stack on #804. The native implementation will be independently authored from the existing contracts and prior-art requirements, with no Tirith AGPL code or fixture reuse. Source-based feasibility and an independent security/design review support this bounded approach; runtime implementation and verification are still to come.
This remains a draft reference proposal pending maintainer feature approval. It does not claim the existing drafts provide call-time protection, or that the new guard has passed tests.