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.
@@ -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.0";
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-WGJYDA2Q.js";
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
- return response.json();
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
- async function uploadReportToBackend(report, credentials, scanId, attackPackVersion) {
2556
- const vulnerabilities = scoredAttacks(report.attacks).map((a) => ({
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
@@ -9,7 +9,7 @@ import {
9
9
  generatePdf,
10
10
  loadConfig,
11
11
  loadSystemPrompt
12
- } from "./chunk-WGJYDA2Q.js";
12
+ } from "./chunk-YAILR7N5.js";
13
13
  export {
14
14
  ConfigError,
15
15
  ConfigSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shield-llm",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "AI chatbot security scanner — automated red teaming for LLMs",
5
5
  "type": "module",
6
6
  "publishConfig": {