Skip to content

feat(lens): mcp — MCP manifest inventory + rug-pull (drift) detection - #4

Merged
eric-sabe merged 3 commits into
mainfrom
feat/mcp-lens
Jul 8, 2026
Merged

feat(lens): mcp — MCP manifest inventory + rug-pull (drift) detection#4
eric-sabe merged 3 commits into
mainfrom
feat/mcp-lens

Conversation

@eric-sabe

Copy link
Copy Markdown
Owner

Stacked on #3#2#1. Review/merge in order.

What & why

honey's biggest blind spot: an MCP server defined by a .mcp.json / host config with no SKILL.md is invisible to skillspector. This native lens inventories every MCP server (host configs for Claude/Cursor/VS Code/Windsurf + every .mcp.json under the project roots) and implements the research's #1 rug-pull defense — hash the manifest on first sight and diff every subsequent run:

  • MCP-DRIFT (high) — a known server's definition changed since last run (the manifest-alteration rug-pull vector).
  • MCP-NEW (low) — a server appeared that wasn't there before.
  • MCP-RISKY (medium) — launch command fetches-and-executes remote code (curl|wget | sh/bash, bash -c, eval).

On a real machine it inventories 23 MCP servers across host configs honey could not see before.

Design

  • First run seeds the baseline manifest silently (no drift/new spam on a fresh box); detection starts next run. Content-based RISKY fires every run.
  • Hashes stored in a gitignored .mcp-state.json (HONEY_MCP_STATE).
  • Handles mcpServers, servers, and per-project projects[].mcpServers.
  • Findings ride the baseline (pinnable) and verdict policy like any lens.

Parity & gates

Offline. bash uses jq (deep-sorted canonical via jq walk); Windows mirror uses native .NET (recursive key sort). Verified behavior-identical across bash + pwsh: seed → unchanged → drift + new + risky. shellcheck clean; PSScriptAnalyzer clean. doctor/doctor.ps1 report it; README + .gitignore updated.

🤖 Generated with Claude Code

eric-sabe and others added 3 commits July 7, 2026 19:40
The baseline pins specific reviewed findings; this is the broad dial for the
daily marketplace noise. Two settings, applied after suppression:

  • Provenance: a finding whose location matches HONEY_TRUSTED_PATTERNS
    (default claude-plugins-official) is first-party; the report tags it
    [1st-party].
  • Severity floor: a finding escalates OVERALL only at/above the floor for its
    provenance (HONEY_VERDICT_FLOOR / HONEY_VERDICT_FLOOR_TRUSTED). Below-floor
    findings move to a non-blocking "review" tier — still printed and counted
    (`OVERALL: … (65 review)`), but they don't flip the verdict.

Every classified finding now carries _provenance and _blocking; report.sh /
daily-cycle.sh (and the PowerShell mirrors) share the same classification, so
they agree. A review-only run is CLEAN.

Safe by default: floors default to `none` (everything blocks, as before) — a
security tool must not silently hide findings out of the box. Overrides that
the floor can never mute: bumblebee always blocks (known-compromised catalog),
and a MUTATED pin always blocks (rug-pull tripwire); incomplete/scan_error are
never reclassified.

Multi-OS parity: lib/verdict.sh + win/lib/Verdict.psm1; report/daily-cycle
updated on both sides. shellcheck clean; PSScriptAnalyzer clean; default verdict
unchanged when no floor is set. Docs: docs/VERDICT.plan.md, README (section +
3 config vars), routine-prompt.md + triage-guide.md (the review tier).

Stacked on feat/suppression-baseline.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A honey-native lens targeting the scanner-evasion classes static pattern
scanners (incl. skillspector's frozen patterns) miss, over agent-skill and
instruction files:

  • invisible Unicode — tag chars U+E0000-E007F (ASCII smuggling): no legit
    text use, carry hidden instructions past humans and byte scanners.
  • bidirectional overrides — U+202A-202E / U+2066-2069 (Trojan Source):
    reorder how text renders vs. is interpreted.
  • zero-width — U+200B/200C/2060/180E (excludes the emoji ZWJ U+200D to avoid
    false positives).
  • remote includes — instructions telling the agent to fetch/read a remote URL
    at runtime (content the on-disk scan never sees).

Contract-compliant lens: bash uses perl (self-skips with a "skipped" verdict if
perl is absent — honey's core path unaffected); the Windows mirror uses native
.NET Rune enumeration (no perl). Verified behavior-identical on fixtures
(tag/bidi/zero-width/remote all caught; a clean file with an emoji ZWJ and a
plain URL correctly NOT flagged). Fast: ~0.17s over real skill roots.

Its findings ride the existing baseline + verdict policy (first-party
remote-include docs land in the review tier / can be pinned). doctor.sh +
doctor.ps1 report the lens; README lens table + config updated. shellcheck
clean; PSScriptAnalyzer clean.

Stacked on feat/verdict-policy.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Closes honey's biggest coverage gap: an MCP server defined by a .mcp.json or
host config with no SKILL.md is invisible to skillspector. This native lens
inventories every MCP server (host configs: Claude/Cursor/VS Code/Windsurf, plus
every .mcp.json under the project roots) and implements the canonical rug-pull
defense — "hash the manifest on first sight, diff every subsequent run":

  • MCP-DRIFT  (high)   — a known server's definition CHANGED since last run
                          (the manifest-alteration rug-pull vector).
  • MCP-NEW    (low)    — a server appeared that wasn't there before.
  • MCP-RISKY  (medium) — launch command fetches-and-executes remote code
                          (curl|wget | sh/bash, bash -c, eval).

The first run SEEDS the baseline manifest silently (no drift/new spam on a fresh
box); detection starts the next run. Hashes are stored in a gitignored
.mcp-state.json (HONEY_MCP_STATE). Content-based RISKY fires every run.

On a real machine this inventories 23 MCP servers across host configs that honey
could not see before. Findings ride the baseline + verdict policy like any lens.

Offline: bash uses jq (deep-sorted canonical via `jq walk`); the Windows mirror
uses native .NET (recursive key sort). Verified behavior-identical: seed →
unchanged → drift + new + risky. shellcheck clean; PSScriptAnalyzer clean.
doctor/doctor.ps1 report the lens; README lens table + config + "what each
answers" updated; .gitignore excludes the state file.

Stacked on feat/lens-hardening.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@eric-sabe
eric-sabe force-pushed the feat/lens-hardening branch from 82b6396 to 61fab25 Compare July 7, 2026 23:40
@eric-sabe
eric-sabe changed the base branch from feat/lens-hardening to main July 8, 2026 03:12
@eric-sabe
eric-sabe merged commit 1e4fc0b into main Jul 8, 2026
2 checks passed
@eric-sabe
eric-sabe deleted the feat/mcp-lens branch July 8, 2026 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant