Skip to content

feat(lens): ocr (offline multimodal) + opt-in mcp-scan & garak wrappers - #5

Merged
eric-sabe merged 4 commits into
mainfrom
feat/external-lenses
Jul 8, 2026
Merged

feat(lens): ocr (offline multimodal) + opt-in mcp-scan & garak wrappers#5
eric-sabe merged 4 commits into
mainfrom
feat/external-lenses

Conversation

@eric-sabe

Copy link
Copy Markdown
Owner

Stacked on #4#3#2#1 (the top of the stack). Review/merge in order.

Three more lenses from the research, per the opt-in / offline-by-default choice:

ocr — offline multimodal (SkillCamo) defense

OCRs images bundled in agent skills (tesseract) and flags hidden instruction/exfil text — the blind spot text scanners can't see. Self-skips if tesseract is absent. Feeds images via stdin (some leptonica builds mis-read absolute paths — found and worked around). Verified on fixtures: two images with hidden "ignore previous instructions" / "curl … | bash" caught; a plain "Architecture Diagram" image not flagged.

mcp-scan — opt-in, external (cloud)

Wraps Invariant/Snyk Agent Scan (hybrid rules+model analysis). It phones home, so it stays inert unless HONEY_ENABLE_MCP_SCAN=1 and never runs in the default cycle. honey's native offline mcp lens (#4) covers the no-network path. Defensive JSON normalization (schema tuned on first real run).

garak — opt-in, external (live-model probe)

Wraps NVIDIA garak. Doubly gated (HONEY_ENABLE_GARAK=1 + HONEY_GARAK_TARGET) — it's a live-model red-team, not a file scan, so it's never part of the offline cycle.

Notes

All three are contract-compliant lenses, so the baseline and verdict policy apply to their findings. The two external lenses default OFF and were verified on their skip paths (not installed here); ocr was fully tested end-to-end on both bash + pwsh. shellcheck clean; PSScriptAnalyzer clean. doctor/doctor.ps1 report each lens's tool/enable state; README gains the three rows, config vars, and an offline-vs-external section.

🤖 Generated with Claude Code

eric-sabe and others added 4 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>
Three more lenses from the research, per the "opt-in, offline by default" choice:

• ocr (offline, native) — the multimodal/SkillCamo defense. OCRs images bundled
  in agent skills (tesseract) and flags hidden instruction/exfil text — the
  blind spot text scanners can't see. Self-skips if tesseract is absent. Feeds
  images via stdin (some leptonica builds mis-read absolute paths). Verified on
  fixtures: two images with hidden "ignore previous instructions" / "curl … |
  bash" caught; a plain diagram not flagged.

• mcp-scan (opt-in, external) — wraps Invariant/Snyk Agent Scan (hybrid
  rules+model analysis). It phones home, so it stays inert unless
  HONEY_ENABLE_MCP_SCAN=1 and never runs in the default cycle. honey's native
  offline `mcp` lens covers the no-network path. Defensive JSON normalization.

• garak (opt-in, external) — wraps NVIDIA garak (live-model probing). Doubly
  gated (HONEY_ENABLE_GARAK=1 + HONEY_GARAK_TARGET); it's a live-model red-team,
  not a file scan, so it's never part of the offline cycle.

All three are contract-compliant lenses (baseline + verdict policy apply). The
two external ones default OFF and were verified on their skip paths (tools not
installed here). shellcheck clean; PSScriptAnalyzer clean. doctor/doctor.ps1
report each lens's tool/enable state; README lens table + config + an
offline-vs-external note added.

Stacked on feat/mcp-lens.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@eric-sabe
eric-sabe force-pushed the feat/external-lenses branch from f550532 to 37a3c4b Compare July 7, 2026 23:40
@eric-sabe
eric-sabe changed the base branch from feat/mcp-lens to main July 8, 2026 03:12
@eric-sabe
eric-sabe merged commit 4aeb553 into main Jul 8, 2026
2 checks passed
@eric-sabe
eric-sabe deleted the feat/external-lenses 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