agent-sanitizer 2.40.0 → 2.40.1
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
CHANGED
|
@@ -241,6 +241,8 @@ To wire them yourself instead, one entry dispatches every mode on `--hook=`:
|
|
|
241
241
|
| `SessionStart` | `scan-invisible-chars` |
|
|
242
242
|
| `InstructionsLoaded` | `scan-loaded-instructions` |
|
|
243
243
|
|
|
244
|
+
**Wire all five.** The instruction-file scan is split across two of them: `SessionStart` covers the files that load at launch, and `InstructionsLoaded` covers every one a subdirectory loads later. A host that wires the first without the second leaves a nested `CLAUDE.md` scanned by nothing, and the one-time PreToolUse coverage notice is the only thing that says so.
|
|
245
|
+
|
|
244
246
|
`require.resolve("agent-sanitizer/claude-hooks")` gives the path without
|
|
245
247
|
hardcoding a layout. Importing the module rather than spawning it is a no-op.
|
|
246
248
|
|
package/THREAT-MODEL.md
CHANGED
|
@@ -303,9 +303,12 @@ neutralization is to strip the payload from disk (so no reload re-reads it) and
|
|
|
303
303
|
tell the model to treat what it just read as untrusted data. Auto-cleaning is
|
|
304
304
|
confined to `CLAUDE_PROJECT_DIR` in both — an ancestor file, or one under
|
|
305
305
|
`~/.claude`, is shared with every other project on the machine, so it is reported
|
|
306
|
-
through the cross-hook alert and never rewritten.
|
|
307
|
-
|
|
308
|
-
|
|
306
|
+
through the cross-hook alert and never rewritten. Three things lose the lazy half
|
|
307
|
+
entirely: a host that never wired the `InstructionsLoaded` event to
|
|
308
|
+
`scan-loaded-instructions`, a Claude Code build that does not emit that event,
|
|
309
|
+
and `scan-loaded-instructions` switched off in `AGENT_SANITIZER_DISABLED_HOOKS`.
|
|
310
|
+
Nothing on disk tells them apart, so the PreToolUse gate names all three, once
|
|
311
|
+
per session, rather than leaving the gap silent.
|
|
309
312
|
|
|
310
313
|
That table is a claim about someone else's product, so the event that names a
|
|
311
314
|
loaded file is also what falsifies it. `contextScopeContradiction` checks every
|
|
@@ -150,10 +150,12 @@ export function recordInstructionsLoaded(sessionId) {
|
|
|
150
150
|
* instruction files that load at launch, and everything a subdirectory loads
|
|
151
151
|
* later is scanned by the event. No scan, and nothing says so.
|
|
152
152
|
*
|
|
153
|
-
* The notice names the OBSERVABLE — no scan ran — and
|
|
154
|
-
* the marker cannot tell a host that never
|
|
155
|
-
*
|
|
156
|
-
*
|
|
153
|
+
* The notice names the OBSERVABLE — no scan ran — and all three causes, because
|
|
154
|
+
* the marker cannot tell them apart: a host that never wired the event to
|
|
155
|
+
* scan-loaded-instructions, a Claude Code that does not emit it, and the hook
|
|
156
|
+
* switched off in AGENT_SANITIZER_DISABLED_HOOKS; asserting one sends a reader
|
|
157
|
+
* who is in another to the wrong fix. The wiring cause leads because it is the
|
|
158
|
+
* only one the reader can repair in this session, and nothing else reports it.
|
|
157
159
|
* @param {string} [sessionId] the harness's session identity, so the answer
|
|
158
160
|
* belongs to THIS session (see instructionsLoadedFile)
|
|
159
161
|
* @returns {string | null}
|
|
@@ -168,9 +170,11 @@ export function instructionsLoadedGapNotice(sessionId) {
|
|
|
168
170
|
"instruction files loaded from SUBDIRECTORIES (a nested CLAUDE.md, a " +
|
|
169
171
|
"directory-scoped rule) are reaching the model unscanned for hidden " +
|
|
170
172
|
"Unicode — the session-start scan covers only the files loaded at launch. " +
|
|
171
|
-
"Tell the user, and name
|
|
172
|
-
"
|
|
173
|
-
"
|
|
173
|
+
"Tell the user, and name all three causes: this host never wired the " +
|
|
174
|
+
"InstructionsLoaded event to scan-loaded-instructions (wiring it restores " +
|
|
175
|
+
"the coverage), a Claude Code that does not emit the event (upgrading " +
|
|
176
|
+
"restores it), or scan-loaded-instructions switched off in " +
|
|
177
|
+
"AGENT_SANITIZER_DISABLED_HOOKS."
|
|
174
178
|
);
|
|
175
179
|
}
|
|
176
180
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-sanitizer",
|
|
3
|
-
"version": "2.40.
|
|
3
|
+
"version": "2.40.1",
|
|
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": {
|
|
@@ -52,10 +52,12 @@ export function recordInstructionsLoaded(sessionId?: string): void;
|
|
|
52
52
|
* instruction files that load at launch, and everything a subdirectory loads
|
|
53
53
|
* later is scanned by the event. No scan, and nothing says so.
|
|
54
54
|
*
|
|
55
|
-
* The notice names the OBSERVABLE — no scan ran — and
|
|
56
|
-
* the marker cannot tell a host that never
|
|
57
|
-
*
|
|
58
|
-
*
|
|
55
|
+
* The notice names the OBSERVABLE — no scan ran — and all three causes, because
|
|
56
|
+
* the marker cannot tell them apart: a host that never wired the event to
|
|
57
|
+
* scan-loaded-instructions, a Claude Code that does not emit it, and the hook
|
|
58
|
+
* switched off in AGENT_SANITIZER_DISABLED_HOOKS; asserting one sends a reader
|
|
59
|
+
* who is in another to the wrong fix. The wiring cause leads because it is the
|
|
60
|
+
* only one the reader can repair in this session, and nothing else reports it.
|
|
59
61
|
* @param {string} [sessionId] the harness's session identity, so the answer
|
|
60
62
|
* belongs to THIS session (see instructionsLoadedFile)
|
|
61
63
|
* @returns {string | null}
|