shield-llm 0.7.0 → 0.7.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/dist/{chunk-WGJYDA2Q.js → chunk-YAILR7N5.js} +5 -2
- package/dist/cli.js +12 -4
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __cjs_createRequire } from "module"; import { fileURLToPath as __cjs_fileURLToPath } from "url"; import { dirname as __cjs_dirname } from "path"; const __filename = __cjs_fileURLToPath(import.meta.url); const __dirname = __cjs_dirname(__filename); const require = __cjs_createRequire(import.meta.url);
|
|
2
2
|
|
|
3
3
|
// package.json
|
|
4
|
-
var version = "0.7.
|
|
4
|
+
var version = "0.7.1";
|
|
5
5
|
|
|
6
6
|
// src/config/schema.ts
|
|
7
7
|
import { z as z2 } from "zod";
|
|
@@ -10399,7 +10399,10 @@ var Scanner = class {
|
|
|
10399
10399
|
// detect a degraded scan without parsing reasoning text.
|
|
10400
10400
|
...evalResult.llmResult.judgeError && {
|
|
10401
10401
|
judgeError: evalResult.llmResult.judgeError
|
|
10402
|
-
}
|
|
10402
|
+
},
|
|
10403
|
+
// The judge that produced this verdict: the scan's judgeVersion is
|
|
10404
|
+
// composed from these, and a checkpoint keeps it for a resumed scan.
|
|
10405
|
+
...evalResult.judgeId && { judgeId: evalResult.judgeId }
|
|
10403
10406
|
};
|
|
10404
10407
|
}
|
|
10405
10408
|
createSkippedResult(attack, reason, isRateLimited) {
|
package/dist/cli.js
CHANGED
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
sha256Hex,
|
|
68
68
|
summarizeAttackErrors,
|
|
69
69
|
version
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-YAILR7N5.js";
|
|
71
71
|
|
|
72
72
|
// src/load-env.ts
|
|
73
73
|
try {
|
|
@@ -1360,7 +1360,9 @@ var BackendEvaluator = class {
|
|
|
1360
1360
|
}
|
|
1361
1361
|
throw new Error(userMessage);
|
|
1362
1362
|
}
|
|
1363
|
-
|
|
1363
|
+
const result = await response.json();
|
|
1364
|
+
const judgeId = result.meta?.judgeId;
|
|
1365
|
+
return typeof judgeId === "string" ? { ...result, judgeId } : result;
|
|
1364
1366
|
}
|
|
1365
1367
|
}
|
|
1366
1368
|
/** Backoff for one retry: a 429 Retry-After (seconds) when present, else
|
|
@@ -2552,8 +2554,8 @@ function incompleteScan(report, judged, total) {
|
|
|
2552
2554
|
}
|
|
2553
2555
|
|
|
2554
2556
|
// src/commands/scan.ts
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
+
function buildUploadVulnerabilities(attacks) {
|
|
2558
|
+
return scoredAttacks(attacks).map((a) => ({
|
|
2557
2559
|
// attackId lets the backend validate against its known catalogue + the
|
|
2558
2560
|
// user's custom tests, rejecting fabricated vulnerability rows.
|
|
2559
2561
|
attackId: a.id,
|
|
@@ -2571,10 +2573,16 @@ async function uploadReportToBackend(report, credentials, scanId, attackPackVers
|
|
|
2571
2573
|
}) : void 0,
|
|
2572
2574
|
status: a.vulnerable ? "DETECTED" : "PASSED",
|
|
2573
2575
|
evaluationMethod: a.llmEvaluation?.evaluationMethod,
|
|
2576
|
+
// The judge that produced this verdict (backend meta.judgeId): the server
|
|
2577
|
+
// composes the scan's judgeVersion from these instead of guessing.
|
|
2578
|
+
judgeId: a.llmEvaluation?.judgeId,
|
|
2574
2579
|
confidence: a.llmEvaluation?.confidence,
|
|
2575
2580
|
reasoning: a.llmEvaluation?.reasoning,
|
|
2576
2581
|
captureStatus: a.captureStatus ?? "captured"
|
|
2577
2582
|
}));
|
|
2583
|
+
}
|
|
2584
|
+
async function uploadReportToBackend(report, credentials, scanId, attackPackVersion) {
|
|
2585
|
+
const vulnerabilities = buildUploadVulnerabilities(report.attacks);
|
|
2578
2586
|
const testsRun = scoredAttacks(report.attacks).length;
|
|
2579
2587
|
const attackErrorSummary = summarizeAttackErrors(report.attacks);
|
|
2580
2588
|
const payload = {
|
package/dist/index.js
CHANGED