agent-sanitizer 2.45.8 → 2.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -11
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -60,17 +60,18 @@ Split into subpaths so the heavy HTML dependency stays opt-in. **Seam** names
|
|
|
60
60
|
the callback you inject for the agent-specific concern; `—` is a pure transform,
|
|
61
61
|
`fs (direct)` does its own file I/O instead of taking one.
|
|
62
62
|
|
|
63
|
-
| # | Import | Purpose
|
|
64
|
-
| --- | --------------- |
|
|
65
|
-
| 1 | `/invisible` | Strip zero-width, bidi, variation-selector and tag chars + ANSI/SGR escapes. Preserves ZWNJ/ZWJ for Arabic/Indic/emoji. Zero deps.
|
|
66
|
-
|
|
|
67
|
-
|
|
|
68
|
-
|
|
|
69
|
-
|
|
|
70
|
-
|
|
|
71
|
-
|
|
|
72
|
-
|
|
|
73
|
-
|
|
|
63
|
+
| # | Import | Purpose | Seam |
|
|
64
|
+
| --- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------- |
|
|
65
|
+
| 1 | `/invisible` | Strip zero-width, bidi, variation-selector and tag chars + ANSI/SGR escapes. Preserves ZWNJ/ZWJ for Arabic/Indic/emoji. Zero deps. | — |
|
|
66
|
+
| 1 | `/layer1` | Apply Layer 1 as one transform — strip payload-capable invisible chars, then every ANSI/terminal control sequence — returning the exact model-facing view the other layers build on. Zero deps. | — |
|
|
67
|
+
| 2 | `/html` | Splice out HTML comments and elements hidden via `display:none`, off-screen, white-on-white, `hidden`. Each splice leaves a keyed, round-trippable placeholder. | — |
|
|
68
|
+
| 3 | `/html` | Detect exfil-shaped URLs (payloads in query/path, embedded creds, `data:`/`javascript:`, off-origin redirects) and confusable HOSTS (`аpple.com`). Reports only — never rewrites. | — |
|
|
69
|
+
| 4 | `/confusables` | Fold look-alike glyphs in tool-call input (paths, commands) to ASCII, closing a cross-script deny-rule bypass. Gated per token, so non-Latin prose passes through unfolded. | `scan` (optional) |
|
|
70
|
+
| 5 | `/instructions` | Scan/auto-clean `CLAUDE.md`, `AGENTS.md`, `SKILL.md`, etc., decoding Unicode-tag + zero-width-binary payloads. | `fs` (direct) |
|
|
71
|
+
| 6 | `/prompt` | Classify a prompt pass / note / block on payload-capable invisible/ANSI content (inert escapes get the note). | — |
|
|
72
|
+
| 7 | `/output` | Run Layers 1–4 over structured tool output, preserving shape. The Layer-5 slot takes a delete-only filter. | `redact`, `filterInjection` |
|
|
73
|
+
| 8 | `/rehydrate` | Re-anchor a model Edit or whole-file Write composed from the _sanitized_ view back onto real bytes; gate MultiEdit on a verified view==disk; deny anything ambiguous or secret-exposing. | `io` |
|
|
74
|
+
| — | `/view-map` | Pure offset/text machinery mapping a file's on-disk bytes ↔ the sanitized view (Layer-1 deletions, Layer-4 redactions). No I/O — consumed by `/rehydrate`. | — |
|
|
74
75
|
|
|
75
76
|
See [`THREAT-MODEL.md`](./THREAT-MODEL.md) for per-vector detail.
|
|
76
77
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-sanitizer",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.46.0",
|
|
4
4
|
"description": "Defend an agent against hidden-content injection: strip payload-capable invisible Unicode and ANSI, splice out human-invisible HTML, and flag data-exfil URLs in untrusted text before any model sees it.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -98,6 +98,10 @@
|
|
|
98
98
|
"types": "./types/invisible.d.mts",
|
|
99
99
|
"default": "./src/invisible.mjs"
|
|
100
100
|
},
|
|
101
|
+
"./layer1": {
|
|
102
|
+
"types": "./types/layer1.d.mts",
|
|
103
|
+
"default": "./src/layer1.mjs"
|
|
104
|
+
},
|
|
101
105
|
"./html": {
|
|
102
106
|
"types": "./types/html.d.mts",
|
|
103
107
|
"default": "./src/html.mjs"
|