shield-llm 0.2.1 → 0.2.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.
Files changed (2) hide show
  1. package/dist/cli.js +32 -10
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -172,22 +172,44 @@ async function attacksCommand(opts) {
172
172
  (a) => !wanted || a.severity.toLowerCase() === wanted
173
173
  );
174
174
  const total = singleTurn.length + multiTurn.length;
175
+ const SEVERITY_ORDER = [
176
+ "CRITICAL",
177
+ "HIGH",
178
+ "MEDIUM",
179
+ "LOW",
180
+ "CRESCENDO",
181
+ "COMBO"
182
+ ];
183
+ const countBySeverity = (arr) => {
184
+ const counts = {};
185
+ for (const a of arr) counts[a.severity] = (counts[a.severity] ?? 0) + 1;
186
+ const keys = Object.keys(counts).sort(
187
+ (a, b) => (SEVERITY_ORDER.indexOf(a) + 1 || 99) - (SEVERITY_ORDER.indexOf(b) + 1 || 99)
188
+ );
189
+ return keys.map((s) => `${s} ${counts[s]}`).join(", ") || "\u2014";
190
+ };
191
+ const special = singleTurn.filter(
192
+ (a) => a.requiresMcpHarness || a.requiresVisionTarget || a.requiresMultiAgent
193
+ ).length;
175
194
  console.log(
176
195
  `
177
- Available attacks (${total}) \u2014 catalog ${fetched.catalogVersion}:
196
+ Attack catalogue \u2014 ${total} attack(s)${wanted ? ` (severity: ${wanted})` : ""}, catalog ${fetched.catalogVersion}:
178
197
  `
179
198
  );
180
- for (const attack of [...singleTurn, ...multiTurn]) {
181
- const flags = [];
182
- if (attack.requiresMcpHarness) flags.push("mcp");
183
- if (attack.requiresVisionTarget) flags.push("vision");
184
- if (attack.requiresMultiAgent) flags.push("multi-agent");
185
- const flagStr = flags.length ? ` [needs: ${flags.join(", ")}]` : "";
199
+ console.log(
200
+ ` Single-turn (${singleTurn.length}) ${countBySeverity(singleTurn)}`
201
+ );
202
+ console.log(
203
+ ` Multi-turn (${multiTurn.length}) ${countBySeverity(multiTurn)}`
204
+ );
205
+ if (special) {
186
206
  console.log(
187
- ` ${attack.id.padEnd(38)} ${attack.severity.padEnd(10)} ${attack.name}${flagStr}`
207
+ ` ${special} need a special harness (MCP / vision / multi-agent)`
188
208
  );
189
209
  }
190
- console.log("");
210
+ console.log(
211
+ "\n Per-attack payloads stay server-side \u2014 run `shield-llm scan` to exercise them.\n"
212
+ );
191
213
  }
192
214
 
193
215
  // src/commands/init.ts
@@ -1407,7 +1429,7 @@ process.on("uncaughtException", (err) => {
1407
1429
  });
1408
1430
  var program = new Command();
1409
1431
  program.exitOverride();
1410
- program.name("shield-llm").description("AI chatbot security scanner \u2014 automated red teaming for LLMs").version("0.2.1");
1432
+ program.name("shield-llm").description("AI chatbot security scanner \u2014 automated red teaming for LLMs").version("0.2.2");
1411
1433
  program.command("scan").description("Run a security scan against a target chatbot").option("-c, --config <path>", "Path to shield.config.json").option("-p, --provider <name>", "Target provider (openai, mistral)").option("-m, --model <name>", "Target model name").option("-e, --endpoint <url>", "Target chatbot HTTP endpoint URL").option("--auth <type>", "Auth type: bearer, api-key, oauth2").option("--token <value>", "Bearer token or API key value").option("--auth-header <name>", "Custom auth header name (for api-key auth)").option(
1412
1434
  "--response-field <path>",
1413
1435
  "Dot-notation path to response text in JSON (default: response)"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shield-llm",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "AI chatbot security scanner — automated red teaming for LLMs",
5
5
  "type": "module",
6
6
  "publishConfig": {