shield-llm 0.3.1 → 0.5.0

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 CHANGED
@@ -18,6 +18,7 @@ logic — so adding new attacks server-side reaches every install instantly, wit
18
18
  no upgrade.
19
19
 
20
20
  > A backend connection is required. Two modes, same binary:
21
+ >
21
22
  > - **SaaS** — `https://shield-llm.com` (default)
22
23
  > - **License / self-hosted** — your own instance via `--api-url`
23
24
 
@@ -29,8 +30,16 @@ npm install -g shield-llm
29
30
  npx shield-llm --help
30
31
  ```
31
32
 
32
- Requires Node.js >= 22. PDF reports need Puppeteer (installed automatically as
33
- an optional dependency; set `PUPPETEER_EXECUTABLE_PATH` to use a system Chrome).
33
+ Requires Node.js >= 22.
34
+
35
+ PDF reports (`--output pdf`) need Puppeteer, which is not installed by default
36
+ to keep the CLI install small and dependency-light:
37
+
38
+ ```bash
39
+ npm install -g puppeteer # one-time, only if you use --output pdf
40
+ ```
41
+
42
+ Set `PUPPETEER_EXECUTABLE_PATH` to use a system Chrome instead of the bundled one.
34
43
 
35
44
  ## Quick start
36
45
 
@@ -69,30 +78,50 @@ shield-llm scan --preset owasp
69
78
  - Auth: `bearer`, `api-key`, or `oauth2` (use `$ENV_VAR` to read secrets from
70
79
  the environment instead of hard-coding them).
71
80
  - CLI flags override config values.
81
+ - `knownSecrets` (optional canary) — list any secret your chatbot must never
82
+ reveal (a password, an API key, or a unique **canary token** you plant in its
83
+ system prompt). The judge deterministically flags any response that leaks one,
84
+ even base64/rot13/encoded, catching prompt-leak / data-exfil that an LLM judge
85
+ alone can miss:
86
+
87
+ ```json
88
+ {
89
+ "endpoint": {
90
+ "url": "https://api.example.com/chat",
91
+ "request": { "method": "POST", "body": { "message": "{{prompt}}" } },
92
+ "response": { "field": "data.reply" },
93
+ "knownSecrets": ["CANARY-7f3a9b2c1d4e"]
94
+ },
95
+ "preset": "standard"
96
+ }
97
+ ```
98
+
99
+ Use a long, high-entropy value (min 8 chars). It only ever raises a finding to
100
+ vulnerable and is ignored when unset — it never affects other tests.
72
101
 
73
102
  ## Commands
74
103
 
75
- | Command | Description |
76
- |---------|-------------|
77
- | `scan` | Run a security scan against a target chatbot |
78
- | `init` | Interactive wizard → generates `shield.config.json` |
79
- | `test-connection` | Send one benign message to check your config works (no attacks) |
80
- | `login` / `logout` | Manage your API key credentials |
81
- | `attacks` | Show the attack catalogue summary for your plan (counts, from your backend) |
82
- | `presets` | List available scan presets |
83
- | `tests` | List custom tests (local config and/or `--remote`) |
84
- | `validate` | Validate a `shield.config.json` without scanning |
85
- | `report <scanId>` | Fetch a past scan from your dashboard |
104
+ | Command | Description |
105
+ | ------------------ | --------------------------------------------------------------------------- |
106
+ | `scan` | Run a security scan against a target chatbot |
107
+ | `init` | Interactive wizard → generates `shield.config.json` |
108
+ | `test-connection` | Send one benign message to check your config works (no attacks) |
109
+ | `login` / `logout` | Manage your API key credentials |
110
+ | `attacks` | Show the attack catalogue summary for your plan (counts, from your backend) |
111
+ | `presets` | List available scan presets |
112
+ | `tests` | List custom tests (local config and/or `--remote`) |
113
+ | `validate` | Validate a `shield.config.json` without scanning |
114
+ | `report <scanId>` | Fetch a past scan from your dashboard |
86
115
 
87
116
  ## Presets
88
117
 
89
- | Preset | Scope |
90
- |--------|-------|
91
- | `dev` | quick smoke test |
92
- | `quick` | fast triage |
93
- | `owasp` | one test per OWASP LLM Top 10 category |
94
- | `standard` | broad coverage |
95
- | `full` | full catalogue + multi-turn (crescendo / memory) attacks |
118
+ | Preset | Scope |
119
+ | ---------- | -------------------------------------------------------- |
120
+ | `dev` | quick smoke test |
121
+ | `quick` | fast triage |
122
+ | `owasp` | one test per OWASP LLM Top 10 category |
123
+ | `standard` | broad coverage |
124
+ | `full` | full catalogue + multi-turn (crescendo / memory) attacks |
96
125
 
97
126
  Available presets depend on your plan; the backend filters them.
98
127
 
@@ -2,7 +2,7 @@ import { createRequire as __cjs_createRequire } from "module"; import { fileURLT
2
2
  import {
3
3
  __commonJS,
4
4
  __require
5
- } from "./chunk-WM5Z3SXV.js";
5
+ } from "./chunk-I7M3BZK7.js";
6
6
 
7
7
  // ../../node_modules/.pnpm/@vercel+oidc@3.2.0/node_modules/@vercel/oidc/dist/token-error.js
8
8
  var require_token_error = __commonJS({
@@ -7,7 +7,11 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
7
7
  throw Error('Dynamic require of "' + x + '" is not supported');
8
8
  });
9
9
  var __commonJS = (cb, mod) => function __require2() {
10
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ try {
11
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
+ } catch (e) {
13
+ throw mod = 0, e;
14
+ }
11
15
  };
12
16
 
13
17
  export {