shield-llm 0.12.0 → 0.12.2

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/cli.js CHANGED
@@ -51,6 +51,7 @@ import {
51
51
  formatMarkdown,
52
52
  formatSarif,
53
53
  formatShareAboveLimit,
54
+ frameworkVersion,
54
55
  generatePdf,
55
56
  getCrosswalk,
56
57
  getMutator,
@@ -58,6 +59,7 @@ import {
58
59
  getStructuredRemediation,
59
60
  isExpired,
60
61
  isFloorConfirmed,
62
+ isHardFailBreach,
61
63
  loadConfig,
62
64
  loadSystemPrompt,
63
65
  mayStampFixed,
@@ -75,8 +77,9 @@ import {
75
77
  sha256Hex,
76
78
  summarizeAttackErrors,
77
79
  summarizeObfuscationVariants,
78
- version
79
- } from "./chunk-HVLBRBJD.js";
80
+ version,
81
+ withoutScoredApartVariants
82
+ } from "./chunk-4A2UTKN5.js";
80
83
 
81
84
  // src/load-env.ts
82
85
  try {
@@ -1807,6 +1810,14 @@ function printAttackComplete(event) {
1807
1810
  spinner.start();
1808
1811
  }
1809
1812
  }
1813
+ function countsLine(report) {
1814
+ const counted = withoutScoredApartVariants(report.attacks, (a) => a);
1815
+ const vulnerable = counted.filter((a) => a.vulnerable);
1816
+ const secure = counted.filter((a) => !a.vulnerable && !a.error);
1817
+ const errors = counted.filter((a) => a.error && !a.judgeUnavailable);
1818
+ const notJudged = counted.filter((a) => a.judgeUnavailable);
1819
+ return ` ${c.red(`${vulnerable.length} vulnerable`)} \xB7 ${c.green(`${secure.length} secure`)} \xB7 ${c.yellow(`${errors.length} errors`)}` + (notJudged.length > 0 ? ` \xB7 ${c.yellow(`${notJudged.length} not judged`)}` : "");
1820
+ }
1810
1821
  function printSummary(report, thresholds, gate) {
1811
1822
  console.log("");
1812
1823
  console.log(c.bold("\u2550\u2550\u2550 Shield LLM Scan Results \u2550\u2550\u2550"));
@@ -1818,11 +1829,7 @@ function printSummary(report, thresholds, gate) {
1818
1829
  console.log("");
1819
1830
  const vulnerable = report.attacks.filter((a) => a.vulnerable);
1820
1831
  const secure = report.attacks.filter((a) => !a.vulnerable && !a.error);
1821
- const errors = report.attacks.filter((a) => a.error && !a.judgeUnavailable);
1822
- const notJudged = report.attacks.filter((a) => a.judgeUnavailable);
1823
- console.log(
1824
- ` ${c.red(`${vulnerable.length} vulnerable`)} \xB7 ${c.green(`${secure.length} secure`)} \xB7 ${c.yellow(`${errors.length} errors`)}` + (notJudged.length > 0 ? ` \xB7 ${c.yellow(`${notJudged.length} not judged`)}` : "")
1825
- );
1832
+ console.log(countsLine(report));
1826
1833
  const evaluated = vulnerable.length + secure.length;
1827
1834
  const total = report.attacks.length;
1828
1835
  if (evaluated < total) {
@@ -2340,7 +2347,7 @@ function buildRemediationValidation(claims, scope) {
2340
2347
  }
2341
2348
 
2342
2349
  // ../../packages/shared/src/compliance/evidence-bundle.ts
2343
- var EVIDENCE_BUNDLE_FORMAT = "shield-evidence/3";
2350
+ var EVIDENCE_BUNDLE_FORMAT = "shield-evidence/4";
2344
2351
  var EVIDENCE_EXCERPT_LIMIT = 2e3;
2345
2352
  var EVIDENCE_TOTAL_EXCERPT_BUDGET = 1e6;
2346
2353
  function canonicalize(value) {
@@ -2388,8 +2395,9 @@ function bundleLimitations(classification, noScoredEvidence = false) {
2388
2395
  "The SHA-256 digest is a checksum over the bundle content. It detects alteration; it does not authenticate the issuer and is not a cryptographic signature.",
2389
2396
  "Article 50(1) disclosure rendered in a user interface (a banner, a chat header, an onboarding screen) is not observable from an HTTP-level scan and is neither tested nor scored here.",
2390
2397
  "Article 50(2) machine-readable marking of synthetic content is out of scope for this scan.",
2398
+ "A non-compliance with observedBreach: false is a weakness scored against its article, not a breach of it, and never floors the status. A false human-authorship label on generated content is one: the Commission's Article 50 guidelines (C(2026) 5054, paragraph 131) place advertising text and a reply seen only by its user outside Article 50(4).",
2391
2399
  "Organizational answers in the structural assessment are self-declared and carry no attached artefact.",
2392
- "As of September 2026 no CEN-CENELEC harmonised standard for the AI Act is cited in the Official Journal, so nothing here grants an Article 40 presumption of conformity."
2400
+ "This bundle grants no Article 40 presumption of conformity: that presumption comes from conformity with a harmonised standard cited in the Official Journal, not from a test result. As of 30 October 2026 the only such standard is EN 18286:2026 on the quality management system (Commission Implementing Decision (EU) 2026/2274, OJ 14.10.2026), which this bundle does not assess."
2393
2401
  ];
2394
2402
  if (noScoredEvidence) {
2395
2403
  base.unshift(
@@ -2452,7 +2460,8 @@ function buildCrosswalkBlock() {
2452
2460
  frameworks: FRAMEWORK_IDS.map((id) => ({
2453
2461
  id,
2454
2462
  label: FRAMEWORK_LABELS[id].label,
2455
- version: FRAMEWORK_LABELS[id].version,
2463
+ // The bundle is English: "Règlement (UE) 2022/2554" was French in it.
2464
+ version: frameworkVersion(id, "en"),
2456
2465
  note: { ...FRAMEWORK_LABELS[id].note }
2457
2466
  })),
2458
2467
  rows: getCrosswalk().map((row) => ({
@@ -2472,14 +2481,16 @@ function buildCrosswalkBlock() {
2472
2481
  }))
2473
2482
  };
2474
2483
  }
2484
+ function observedArticle50Breach(compliance) {
2485
+ return compliance.nonCompliances.some(
2486
+ (nc) => isHardFailBreach(nc) && nc.article.articleNumber === "Article 50"
2487
+ );
2488
+ }
2475
2489
  function buildEvidenceBundle(input2) {
2476
2490
  const classification = input2.assessment?.riskClassification ?? "undetermined";
2477
- const observedArticle50 = input2.compliance.nonCompliances.some(
2478
- (nc) => nc.article.articleNumber === "Article 50"
2479
- );
2480
2491
  const profile = getObligationProfile(
2481
2492
  classification,
2482
- observedArticle50 ? { article50Applies: true } : {}
2493
+ observedArticle50Breach(input2.compliance) ? { article50Applies: true } : {}
2483
2494
  );
2484
2495
  const content = {
2485
2496
  format: EVIDENCE_BUNDLE_FORMAT,
@@ -2506,7 +2517,8 @@ function buildEvidenceBundle(input2) {
2506
2517
  testName: nc.testName,
2507
2518
  severity: nc.severity,
2508
2519
  articleNumber: nc.article.articleNumber,
2509
- complianceAspect: nc.article.complianceAspect
2520
+ complianceAspect: nc.article.complianceAspect,
2521
+ observedBreach: nc.article.observedBreach === true
2510
2522
  }))
2511
2523
  },
2512
2524
  obligations: {
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  generatePdf,
10
10
  loadConfig,
11
11
  loadSystemPrompt
12
- } from "./chunk-HVLBRBJD.js";
12
+ } from "./chunk-4A2UTKN5.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.12.0",
3
+ "version": "0.12.2",
4
4
  "description": "AI chatbot security scanner — automated red teaming for LLMs",
5
5
  "type": "module",
6
6
  "publishConfig": {