shield-llm 0.7.1 → 0.7.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/README.md +3 -6
- package/dist/{chunk-YAILR7N5.js → chunk-OLRBOH6L.js} +29 -19
- package/dist/cli.js +4 -5
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,12 +25,9 @@ Which OWASP LLM Top 10 edition your report is labelled with follows the attack
|
|
|
25
25
|
pack your instance serves, not the CLI version. An archived report keeps the
|
|
26
26
|
category names that were current on the day it ran.
|
|
27
27
|
|
|
28
|
-
> A backend connection is required
|
|
29
|
-
>
|
|
30
|
-
>
|
|
31
|
-
> - **Hosted** — `https://shield-llm.com`, the default when you pass no
|
|
32
|
-
> `--api-url`. An evaluation instance, access on request; it is not open for
|
|
33
|
-
> self-service signup.
|
|
28
|
+
> A backend connection is required: your self-hosted Shield instance, named
|
|
29
|
+
> with `--api-url` (or the `SHIELD_API_URL` env var). There is no default
|
|
30
|
+
> backend; without one the CLI stops and says so.
|
|
34
31
|
|
|
35
32
|
## Install
|
|
36
33
|
|
|
@@ -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.2";
|
|
5
5
|
|
|
6
6
|
// src/config/schema.ts
|
|
7
7
|
import { z as z2 } from "zod";
|
|
@@ -999,18 +999,26 @@ function isTimeout(err) {
|
|
|
999
999
|
return typeof err === "object" && err !== null && err.code === "ERR_SCRIPT_EXECUTION_TIMEOUT";
|
|
1000
1000
|
}
|
|
1001
1001
|
function guardedRun(fn, budget) {
|
|
1002
|
-
|
|
1002
|
+
return guardedRunWith(getExec(), fn, budget);
|
|
1003
|
+
}
|
|
1004
|
+
function guardedRunWith(run, fn, budget) {
|
|
1003
1005
|
if (!run || watched) return { completed: true, value: fn() };
|
|
1004
1006
|
const remaining = Math.floor(budget.deadline - performance.now());
|
|
1005
1007
|
if (remaining < 1) {
|
|
1006
1008
|
budget.timedOut = true;
|
|
1007
1009
|
return { completed: false };
|
|
1008
1010
|
}
|
|
1011
|
+
const finished = { done: false };
|
|
1009
1012
|
watched = true;
|
|
1010
1013
|
try {
|
|
1011
|
-
|
|
1014
|
+
run(() => {
|
|
1015
|
+
finished.value = fn();
|
|
1016
|
+
finished.done = true;
|
|
1017
|
+
}, remaining);
|
|
1018
|
+
return { completed: true, value: finished.value };
|
|
1012
1019
|
} catch (err) {
|
|
1013
1020
|
if (!isTimeout(err)) throw err;
|
|
1021
|
+
if (finished.done) return { completed: true, value: finished.value };
|
|
1014
1022
|
budget.timedOut = true;
|
|
1015
1023
|
return { completed: false };
|
|
1016
1024
|
} finally {
|
|
@@ -1026,9 +1034,8 @@ function boundRegexInput(response) {
|
|
|
1026
1034
|
return `${response.slice(0, half)}
|
|
1027
1035
|
${response.slice(-half)}`;
|
|
1028
1036
|
}
|
|
1029
|
-
function analyzeResponse(payload, rawResponse) {
|
|
1037
|
+
function analyzeResponse(payload, rawResponse, budget = regexBudget()) {
|
|
1030
1038
|
const response = boundRegexInput(rawResponse);
|
|
1031
|
-
const budget = regexBudget();
|
|
1032
1039
|
let matchedPattern;
|
|
1033
1040
|
guardedRun(() => {
|
|
1034
1041
|
for (const pattern of payload.detectPatterns) {
|
|
@@ -11345,7 +11352,10 @@ var REPORT_HEAD = `<!DOCTYPE html>
|
|
|
11345
11352
|
Page size: A4 (210mm \xD7 297mm)
|
|
11346
11353
|
============================================ */
|
|
11347
11354
|
|
|
11348
|
-
@import
|
|
11355
|
+
/* No web-font @import: rendering the report must make no network call (it
|
|
11356
|
+
used to fetch Google Fonts). DM Sans / JetBrains Mono are used when
|
|
11357
|
+
installed, otherwise the system stacks below. The CLI ships no font files
|
|
11358
|
+
to keep the npm package small; the web app embeds them. */
|
|
11349
11359
|
|
|
11350
11360
|
@page {
|
|
11351
11361
|
margin: 0;
|
|
@@ -11428,7 +11438,7 @@ var REPORT_HEAD = `<!DOCTYPE html>
|
|
|
11428
11438
|
}
|
|
11429
11439
|
|
|
11430
11440
|
body {
|
|
11431
|
-
font-family: 'DM Sans', sans-serif;
|
|
11441
|
+
font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
|
|
11432
11442
|
color: var(--text-primary);
|
|
11433
11443
|
background: white;
|
|
11434
11444
|
line-height: 1.5;
|
|
@@ -11688,7 +11698,7 @@ var REPORT_HEAD = `<!DOCTYPE html>
|
|
|
11688
11698
|
}
|
|
11689
11699
|
|
|
11690
11700
|
.meta-value.mono {
|
|
11691
|
-
font-family: 'JetBrains Mono', monospace;
|
|
11701
|
+
font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
|
|
11692
11702
|
font-size: 13px;
|
|
11693
11703
|
}
|
|
11694
11704
|
|
|
@@ -11728,14 +11738,14 @@ var REPORT_HEAD = `<!DOCTYPE html>
|
|
|
11728
11738
|
}
|
|
11729
11739
|
|
|
11730
11740
|
.owasp-id {
|
|
11731
|
-
font-family: 'JetBrains Mono', monospace;
|
|
11741
|
+
font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
|
|
11732
11742
|
font-size: 11px;
|
|
11733
11743
|
font-weight: 500;
|
|
11734
11744
|
color: var(--brand-accent);
|
|
11735
11745
|
}
|
|
11736
11746
|
|
|
11737
11747
|
.owasp-score {
|
|
11738
|
-
font-family: 'JetBrains Mono', monospace;
|
|
11748
|
+
font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
|
|
11739
11749
|
font-size: 11px;
|
|
11740
11750
|
font-weight: 600;
|
|
11741
11751
|
}
|
|
@@ -12029,7 +12039,7 @@ var REPORT_HEAD = `<!DOCTYPE html>
|
|
|
12029
12039
|
display: inline-block;
|
|
12030
12040
|
padding: 2px 8px;
|
|
12031
12041
|
border-radius: 3px;
|
|
12032
|
-
font-family: 'JetBrains Mono', monospace;
|
|
12042
|
+
font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
|
|
12033
12043
|
font-size: 10px;
|
|
12034
12044
|
font-weight: 500;
|
|
12035
12045
|
color: var(--brand-accent);
|
|
@@ -12163,7 +12173,7 @@ var REPORT_HEAD = `<!DOCTYPE html>
|
|
|
12163
12173
|
background: var(--brand-dark);
|
|
12164
12174
|
border-radius: 6px;
|
|
12165
12175
|
padding: 12px 16px;
|
|
12166
|
-
font-family: 'JetBrains Mono', monospace;
|
|
12176
|
+
font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
|
|
12167
12177
|
font-size: 11px;
|
|
12168
12178
|
line-height: 1.5;
|
|
12169
12179
|
color: #E2E8F0;
|
|
@@ -12212,7 +12222,7 @@ var REPORT_HEAD = `<!DOCTYPE html>
|
|
|
12212
12222
|
}
|
|
12213
12223
|
|
|
12214
12224
|
.truncation-notice .char-count {
|
|
12215
|
-
font-family: 'JetBrains Mono', monospace;
|
|
12225
|
+
font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
|
|
12216
12226
|
font-size: 10px;
|
|
12217
12227
|
color: #475569;
|
|
12218
12228
|
}
|
|
@@ -12233,7 +12243,7 @@ var REPORT_HEAD = `<!DOCTYPE html>
|
|
|
12233
12243
|
background: var(--brand-dark);
|
|
12234
12244
|
border-radius: 4px;
|
|
12235
12245
|
padding: 8px 14px;
|
|
12236
|
-
font-family: 'JetBrains Mono', monospace;
|
|
12246
|
+
font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
|
|
12237
12247
|
font-size: 11px;
|
|
12238
12248
|
line-height: 1.4;
|
|
12239
12249
|
color: #E2E8F0;
|
|
@@ -12320,7 +12330,7 @@ var REPORT_HEAD = `<!DOCTYPE html>
|
|
|
12320
12330
|
}
|
|
12321
12331
|
|
|
12322
12332
|
.confidence-text {
|
|
12323
|
-
font-family: 'JetBrains Mono', monospace;
|
|
12333
|
+
font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
|
|
12324
12334
|
font-size: 11px;
|
|
12325
12335
|
color: var(--text-secondary);
|
|
12326
12336
|
}
|
|
@@ -12424,7 +12434,7 @@ var REPORT_HEAD = `<!DOCTYPE html>
|
|
|
12424
12434
|
.owasp-ref {
|
|
12425
12435
|
font-size: 10px;
|
|
12426
12436
|
color: var(--text-muted);
|
|
12427
|
-
font-family: 'JetBrains Mono', monospace;
|
|
12437
|
+
font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
|
|
12428
12438
|
margin-left: 4px;
|
|
12429
12439
|
}
|
|
12430
12440
|
|
|
@@ -12505,7 +12515,7 @@ var REPORT_HEAD = `<!DOCTYPE html>
|
|
|
12505
12515
|
}
|
|
12506
12516
|
|
|
12507
12517
|
.eval-method {
|
|
12508
|
-
font-family: 'JetBrains Mono', monospace;
|
|
12518
|
+
font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
|
|
12509
12519
|
font-size: 10px;
|
|
12510
12520
|
color: var(--text-muted);
|
|
12511
12521
|
background: var(--surface-light);
|
|
@@ -12550,7 +12560,7 @@ var REPORT_HEAD = `<!DOCTYPE html>
|
|
|
12550
12560
|
}
|
|
12551
12561
|
|
|
12552
12562
|
.owasp-category-id {
|
|
12553
|
-
font-family: 'JetBrains Mono', monospace;
|
|
12563
|
+
font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
|
|
12554
12564
|
font-size: 12px;
|
|
12555
12565
|
font-weight: 600;
|
|
12556
12566
|
color: var(--brand-accent);
|
|
@@ -12585,7 +12595,7 @@ var REPORT_HEAD = `<!DOCTYPE html>
|
|
|
12585
12595
|
.score-mini-bar-fill.none { background: var(--surface-border); }
|
|
12586
12596
|
|
|
12587
12597
|
.score-mini-text {
|
|
12588
|
-
font-family: 'JetBrains Mono', monospace;
|
|
12598
|
+
font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
|
|
12589
12599
|
font-size: 12px;
|
|
12590
12600
|
font-weight: 600;
|
|
12591
12601
|
min-width: 40px;
|
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-OLRBOH6L.js";
|
|
71
71
|
|
|
72
72
|
// src/load-env.ts
|
|
73
73
|
try {
|
|
@@ -902,7 +902,7 @@ ${issues}`);
|
|
|
902
902
|
`);
|
|
903
903
|
console.log(" Next steps:");
|
|
904
904
|
console.log(
|
|
905
|
-
" shield-llm login Authenticate
|
|
905
|
+
" shield-llm login Authenticate to your Shield instance"
|
|
906
906
|
);
|
|
907
907
|
console.log(" shield-llm validate Verify your configuration");
|
|
908
908
|
console.log(" shield-llm scan Run a scan with your preset");
|
|
@@ -2742,9 +2742,8 @@ async function scanCommand(opts) {
|
|
|
2742
2742
|
const credentials = stored ? { ...stored, apiUrl: resolveApiUrl(stored.apiUrl, opts.apiUrl) } : null;
|
|
2743
2743
|
if (!credentials) {
|
|
2744
2744
|
console.error(
|
|
2745
|
-
`Not logged in.
|
|
2746
|
-
|
|
2747
|
-
License: shield-llm login --key <license-key> --api-url https://your-instance
|
|
2745
|
+
`Not logged in. Point the CLI at your Shield instance:
|
|
2746
|
+
shield-llm login --key <api-key> --api-url <your-instance-url>
|
|
2748
2747
|
`
|
|
2749
2748
|
);
|
|
2750
2749
|
setExitCode(2);
|
package/dist/index.js
CHANGED