shield-llm 0.12.1 → 0.12.3
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 +1 -1
- package/dist/{chunk-GUNQB5SM.js → chunk-2YC6WMPX.js} +749 -61
- package/dist/cli.js +23 -11
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -24,6 +24,8 @@ import {
|
|
|
24
24
|
RegexOnlyEvaluator,
|
|
25
25
|
Scanner,
|
|
26
26
|
analyzeJudgeHealth,
|
|
27
|
+
articleNumberEn,
|
|
28
|
+
aspectArticleLabel,
|
|
27
29
|
attacksForContract,
|
|
28
30
|
baseAttackId,
|
|
29
31
|
buildAuthFromFlags,
|
|
@@ -51,6 +53,7 @@ import {
|
|
|
51
53
|
formatMarkdown,
|
|
52
54
|
formatSarif,
|
|
53
55
|
formatShareAboveLimit,
|
|
56
|
+
frameworkVersion,
|
|
54
57
|
generatePdf,
|
|
55
58
|
getCrosswalk,
|
|
56
59
|
getMutator,
|
|
@@ -58,6 +61,7 @@ import {
|
|
|
58
61
|
getStructuredRemediation,
|
|
59
62
|
isExpired,
|
|
60
63
|
isFloorConfirmed,
|
|
64
|
+
isHardFailBreach,
|
|
61
65
|
loadConfig,
|
|
62
66
|
loadSystemPrompt,
|
|
63
67
|
mayStampFixed,
|
|
@@ -77,7 +81,7 @@ import {
|
|
|
77
81
|
summarizeObfuscationVariants,
|
|
78
82
|
version,
|
|
79
83
|
withoutScoredApartVariants
|
|
80
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-2YC6WMPX.js";
|
|
81
85
|
|
|
82
86
|
// src/load-env.ts
|
|
83
87
|
try {
|
|
@@ -2345,7 +2349,7 @@ function buildRemediationValidation(claims, scope) {
|
|
|
2345
2349
|
}
|
|
2346
2350
|
|
|
2347
2351
|
// ../../packages/shared/src/compliance/evidence-bundle.ts
|
|
2348
|
-
var EVIDENCE_BUNDLE_FORMAT = "shield-evidence/
|
|
2352
|
+
var EVIDENCE_BUNDLE_FORMAT = "shield-evidence/4";
|
|
2349
2353
|
var EVIDENCE_EXCERPT_LIMIT = 2e3;
|
|
2350
2354
|
var EVIDENCE_TOTAL_EXCERPT_BUDGET = 1e6;
|
|
2351
2355
|
function canonicalize(value) {
|
|
@@ -2393,8 +2397,9 @@ function bundleLimitations(classification, noScoredEvidence = false) {
|
|
|
2393
2397
|
"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.",
|
|
2394
2398
|
"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.",
|
|
2395
2399
|
"Article 50(2) machine-readable marking of synthetic content is out of scope for this scan.",
|
|
2400
|
+
"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).",
|
|
2396
2401
|
"Organizational answers in the structural assessment are self-declared and carry no attached artefact.",
|
|
2397
|
-
"
|
|
2402
|
+
"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."
|
|
2398
2403
|
];
|
|
2399
2404
|
if (noScoredEvidence) {
|
|
2400
2405
|
base.unshift(
|
|
@@ -2457,7 +2462,8 @@ function buildCrosswalkBlock() {
|
|
|
2457
2462
|
frameworks: FRAMEWORK_IDS.map((id) => ({
|
|
2458
2463
|
id,
|
|
2459
2464
|
label: FRAMEWORK_LABELS[id].label,
|
|
2460
|
-
|
|
2465
|
+
// The bundle is English: "Règlement (UE) 2022/2554" was French in it.
|
|
2466
|
+
version: frameworkVersion(id, "en"),
|
|
2461
2467
|
note: { ...FRAMEWORK_LABELS[id].note }
|
|
2462
2468
|
})),
|
|
2463
2469
|
rows: getCrosswalk().map((row) => ({
|
|
@@ -2477,14 +2483,16 @@ function buildCrosswalkBlock() {
|
|
|
2477
2483
|
}))
|
|
2478
2484
|
};
|
|
2479
2485
|
}
|
|
2486
|
+
function observedArticle50Breach(compliance) {
|
|
2487
|
+
return compliance.nonCompliances.some(
|
|
2488
|
+
(nc) => isHardFailBreach(nc) && nc.article.articleNumber === "Article 50"
|
|
2489
|
+
);
|
|
2490
|
+
}
|
|
2480
2491
|
function buildEvidenceBundle(input2) {
|
|
2481
2492
|
const classification = input2.assessment?.riskClassification ?? "undetermined";
|
|
2482
|
-
const observedArticle50 = input2.compliance.nonCompliances.some(
|
|
2483
|
-
(nc) => nc.article.articleNumber === "Article 50"
|
|
2484
|
-
);
|
|
2485
2493
|
const profile = getObligationProfile(
|
|
2486
2494
|
classification,
|
|
2487
|
-
|
|
2495
|
+
observedArticle50Breach(input2.compliance) ? { article50Applies: true } : {}
|
|
2488
2496
|
);
|
|
2489
2497
|
const content = {
|
|
2490
2498
|
format: EVIDENCE_BUNDLE_FORMAT,
|
|
@@ -2498,9 +2506,12 @@ function buildEvidenceBundle(input2) {
|
|
|
2498
2506
|
overallScore: input2.compliance.overallScore,
|
|
2499
2507
|
status: input2.compliance.status,
|
|
2500
2508
|
hardFailedArticles: [...input2.compliance.hardFailedArticles ?? []],
|
|
2509
|
+
// The bundle is an English document, whatever language the result was
|
|
2510
|
+
// computed in: it said "Art. 10 & RGPD" and "RGPD Art. 5 & 32"
|
|
2511
|
+
// (2026-10-30).
|
|
2501
2512
|
aspects: input2.compliance.aspects.map((a) => ({
|
|
2502
2513
|
aspect: a.aspect,
|
|
2503
|
-
articleLabel: a.
|
|
2514
|
+
articleLabel: aspectArticleLabel(a.aspect, "en"),
|
|
2504
2515
|
score: a.score,
|
|
2505
2516
|
totalTests: a.totalTests,
|
|
2506
2517
|
passedTests: a.passedTests,
|
|
@@ -2510,8 +2521,9 @@ function buildEvidenceBundle(input2) {
|
|
|
2510
2521
|
testId: nc.testId,
|
|
2511
2522
|
testName: nc.testName,
|
|
2512
2523
|
severity: nc.severity,
|
|
2513
|
-
articleNumber: nc.article.articleNumber,
|
|
2514
|
-
complianceAspect: nc.article.complianceAspect
|
|
2524
|
+
articleNumber: articleNumberEn(nc.article.articleNumber),
|
|
2525
|
+
complianceAspect: nc.article.complianceAspect,
|
|
2526
|
+
observedBreach: nc.article.observedBreach === true
|
|
2515
2527
|
}))
|
|
2516
2528
|
},
|
|
2517
2529
|
obligations: {
|
package/dist/index.js
CHANGED