agent-sanitizer 2.48.0 → 2.48.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.
|
@@ -24,8 +24,10 @@ import { randomBytes } from "node:crypto";
|
|
|
24
24
|
import { basename, join } from "node:path";
|
|
25
25
|
import { homedir, tmpdir, userInfo } from "node:os";
|
|
26
26
|
import {
|
|
27
|
+
hookgateMarkerPath,
|
|
27
28
|
lazyImport,
|
|
28
29
|
markerIsTrusted,
|
|
30
|
+
probeSetupAlive,
|
|
29
31
|
PROJECT_DIR,
|
|
30
32
|
PROJECT_HASH,
|
|
31
33
|
scrubUntrustedText,
|
|
@@ -442,8 +444,9 @@ function userGlobalLaunchHasContent(env = process.env) {
|
|
|
442
444
|
|
|
443
445
|
/**
|
|
444
446
|
* The one-time context line for a session where no InstructionsLoaded scan ran,
|
|
445
|
-
* or null when the scan has been seen, the notice already ran this session,
|
|
446
|
-
*
|
|
447
|
+
* or null when the scan has been seen, the notice already ran this session, the
|
|
448
|
+
* host's cold-start marker says setup is still running, or neither launch nor
|
|
449
|
+
* `touchedDir` could have fired the event.
|
|
447
450
|
*
|
|
448
451
|
* PURE for the notice: nothing is recorded until the caller confirms it landed
|
|
449
452
|
* in a returned response. Launch-emptiness is cached once found — fixed for the
|
|
@@ -472,6 +475,15 @@ export function instructionsLoadedGapNotice(
|
|
|
472
475
|
) {
|
|
473
476
|
if (instructionsLoadedSeen(sessionId)) return null;
|
|
474
477
|
if (markerIsTrusted(instructionsLoadedNoticeFile(sessionId))) return null;
|
|
478
|
+
// The host's setup script is still provisioning this session, so the scanner
|
|
479
|
+
// may not have been able to run yet: a launch event fires within a second of
|
|
480
|
+
// SessionStart, and a hook whose file or dependency setup has not written yet
|
|
481
|
+
// never reached the marker. Every cause below would be wrong, so say nothing
|
|
482
|
+
// while setup RUNS. Liveness, not the marker alone: a setup killed mid-install
|
|
483
|
+
// leaves its marker behind, and a marker test alone would then silence this
|
|
484
|
+
// notice for every later session on the host.
|
|
485
|
+
const marker = hookgateMarkerPath();
|
|
486
|
+
if (markerIsTrusted(marker) && probeSetupAlive(marker)) return null;
|
|
475
487
|
const launchCached = markerIsTrusted(launchEmptyFile(sessionId));
|
|
476
488
|
const launchHasBytes =
|
|
477
489
|
!launchCached &&
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-sanitizer",
|
|
3
|
-
"version": "2.48.
|
|
3
|
+
"version": "2.48.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": {
|
|
@@ -99,8 +99,9 @@ export function launchEmptyFile(sessionId?: string): string;
|
|
|
99
99
|
export function launchInstructionFiles(dir: string): string[];
|
|
100
100
|
/**
|
|
101
101
|
* The one-time context line for a session where no InstructionsLoaded scan ran,
|
|
102
|
-
* or null when the scan has been seen, the notice already ran this session,
|
|
103
|
-
*
|
|
102
|
+
* or null when the scan has been seen, the notice already ran this session, the
|
|
103
|
+
* host's cold-start marker says setup is still running, or neither launch nor
|
|
104
|
+
* `touchedDir` could have fired the event.
|
|
104
105
|
*
|
|
105
106
|
* PURE for the notice: nothing is recorded until the caller confirms it landed
|
|
106
107
|
* in a returned response. Launch-emptiness is cached once found — fixed for the
|