Plugins distributed from the agent-sanitizer repo.
Trending marketplaces
7-day visitors to each marketplace page
npx claudepluginhub alexandermattturner/agent-sanitizerFive hooks over everything crossing a Claude Code session. SessionStart scans the instruction files that load at launch — CLAUDE.md, AGENTS.md, the .claude/ context files and the CLAUDE.md chain above the project — for hidden-Unicode payloads and cleans what it can. InstructionsLoaded scans every other instruction file at the moment Claude Code loads it, so a nested CLAUDE.md or a path-scoped rule is checked without walking the tree at startup. UserPromptSubmit blocks prompts carrying payload-capable invisible Unicode or ANSI escapes. PreToolUse normalizes confusable paths and commands and strips stego and terminal-control sequences from model-authored content. PostToolUse strips invisibles and ANSI, splices hidden HTML out of web and MCP output, and flags exfil-shaped URLs — a hex value one digest wide is exempt under a generic parameter name, and AGENT_SANITIZER_FLAG_DIGEST_VALUES=1 reports it too. Secret redaction via detect-secrets is opt-in (AGENT_SANITIZER_SECRETS_ENABLED=1). A hook that cannot run passes the guarded action through with a loud warning by default; AGENT_SANITIZER_FAIL_OPEN=0 makes it block instead, and AGENT_SANITIZER_DISABLED_HOOKS turns individual hooks off. All local and deterministic: no inference key is read and no request leaves the machine.
agent-sanitizerCleans untrusted text before your agent reads it. An attacker hides a payload where a person cannot see it but the model still reads it: invisible Unicode, ANSI escapes, human-hidden HTML, confusable glyphs, look-alike hosts, and exfil-shaped URLs. This library handles each channel. Easy to use as a Claude Code plugin.
/plugin marketplace add AlexanderMattTurner/agent-sanitizer
/plugin install agent-sanitizer@agent-sanitizer
Finally, navigate: /plugin → Marketplaces → agent-sanitizer → Enable auto-update.
What installing entails covers the footprint of each path and how a failure looks; Using it with Claude Code covers each hook and hand-wiring.
import { sanitize } from "agent-sanitizer";
// Layer 1 (invisible chars + ANSI), zero heavy deps:
const { cleaned, found, warnings, notes } = await sanitize(untrustedText);
// Opt into the HTML layers for web ingress (lazy-loads ~200 ms of deps):
const result = await sanitize(pageSource, { html: true });
// Layer 3 alone: flag exfil-shaped URLs without splicing anything (for text
// that must stay byte-faithful, e.g. a PR diff). Implied by `html: true`.
const scanned = await sanitize(diffText, { exfilScan: true });
// Layer 3 reads an exact-digest-length hex value under a generic parameter
// name (`?v=<md5>`, an ETag, a commit id) as a fingerprint. `flagDigestValues`
// reports it as payload instead — more false positives, no 16-to-64-byte
// channel under a name the caller picks. For monitors, not for splicing.
const strict = await sanitize(logText, {
exfilScan: true,
flagDigestValues: true,
});
sanitize never throws and never silently drops content—any change comes with
at least one warnings or notes entry. found names the neutralized category
codes (e.g. ["cf-format", "hidden-html"]); cleaned is the safe text, with
placeholders where hidden HTML was spliced out. See warnings vs
notes for which findings land where.
Split into subpaths so the heavy HTML dependency stays opt-in. Seam names
the callback you inject for the agent-specific concern; — is a pure transform,
fs (direct) does its own file I/O instead of taking one.
| Layer | Import | Purpose | Seam |
|---|---|---|---|
| 1 | /invisible | Strip zero-width, bidi, variation-selector and tag chars + ANSI/SGR escapes. Preserves ZWNJ/ZWJ for Arabic/Indic/emoji. Zero deps. | — |
| 1 | /layer1 | Layer 1 in one call: the invisible-char and ANSI strips run to a FIXED POINT over each other (either removal can reconstitute what the other matches), then a residual control-introducer sweep closes it — not a two-step pipeline a caller can reproduce in a fixed order. applyLayer1 leaves an unpaired UTF-16 surrogate in place; applyLayer1WellFormed also maps it to U+FFFD, which is the string /output shows a model — take that one when the result feeds a redactor, an offset calculation or a view map. Zero deps. | — |
7-day visitors to each marketplace page
Harness-native ECC skills, hooks, rules, MCP conventions, and operator workflows
Anthropic's Claude Code plugins, installed from the claude-plugins-official repository
RuFlo Marketplace: Claude Code native agents, swarms, workers, and MCP tools for continuous software engineering