shield-llm 0.2.0 → 0.2.1

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 +35 -14
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1087,23 +1087,41 @@ async function scanCommand(opts) {
1087
1087
  }
1088
1088
  const systemPrompt = loadSystemPrompt(config);
1089
1089
  const presetForScan = config.preset ?? "standard";
1090
- const includeCrescendo = config.includeCrescendo ?? config.preset === "full";
1091
- const fetched = await fetchAttacks({
1092
- apiUrl: credentials.apiUrl,
1093
- apiKey: credentials.apiKey,
1094
- preset: presetForScan,
1095
- includeMultiTurn: includeCrescendo
1096
- });
1097
- const multiTurnNote = fetched.multiTurnAttacks.length > 0 ? ` + ${fetched.multiTurnAttacks.length} multi-turn` : "";
1098
- info(
1099
- `Loaded ${fetched.attacks.length} attacks${multiTurnNote} from ${fetched.source} (catalog ${fetched.catalogVersion})`
1100
- );
1090
+ const customOnly = Boolean(opts.customOnly);
1091
+ const includeCrescendo = customOnly ? false : config.includeCrescendo ?? config.preset === "full";
1092
+ let attacks = [];
1093
+ let multiTurnAttacks = [];
1094
+ if (customOnly) {
1095
+ if (!config.customTests || config.customTests.length === 0) {
1096
+ console.error(
1097
+ "--custom-only needs at least one custom test (config.customTests or --load-custom-tests)."
1098
+ );
1099
+ setExitCode(2);
1100
+ return;
1101
+ }
1102
+ info(
1103
+ `Custom-only mode: ${config.customTests.length} custom test(s), no preset attacks sent.`
1104
+ );
1105
+ } else {
1106
+ const fetched = await fetchAttacks({
1107
+ apiUrl: credentials.apiUrl,
1108
+ apiKey: credentials.apiKey,
1109
+ preset: presetForScan,
1110
+ includeMultiTurn: includeCrescendo
1111
+ });
1112
+ attacks = fetched.attacks;
1113
+ multiTurnAttacks = fetched.multiTurnAttacks;
1114
+ const multiTurnNote = fetched.multiTurnAttacks.length > 0 ? ` + ${fetched.multiTurnAttacks.length} multi-turn` : "";
1115
+ info(
1116
+ `Loaded ${fetched.attacks.length} attacks${multiTurnNote} from ${fetched.source} (catalog ${fetched.catalogVersion})`
1117
+ );
1118
+ }
1101
1119
  const scanOptions = {
1102
1120
  target: buildTargetConfig(config),
1103
1121
  systemPrompt,
1104
1122
  preset: presetForScan,
1105
- attacks: fetched.attacks,
1106
- multiTurnAttacks: fetched.multiTurnAttacks,
1123
+ attacks,
1124
+ multiTurnAttacks,
1107
1125
  includeCrescendo,
1108
1126
  customTests: config.customTests,
1109
1127
  concurrency: config.concurrency,
@@ -1389,7 +1407,7 @@ process.on("uncaughtException", (err) => {
1389
1407
  });
1390
1408
  var program = new Command();
1391
1409
  program.exitOverride();
1392
- program.name("shield-llm").description("AI chatbot security scanner \u2014 automated red teaming for LLMs").version("0.2.0");
1410
+ program.name("shield-llm").description("AI chatbot security scanner \u2014 automated red teaming for LLMs").version("0.2.1");
1393
1411
  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(
1394
1412
  "--response-field <path>",
1395
1413
  "Dot-notation path to response text in JSON (default: response)"
@@ -1408,6 +1426,9 @@ program.command("scan").description("Run a security scan against a target chatbo
1408
1426
  ).option(
1409
1427
  "--load-custom-tests",
1410
1428
  "Fetch custom tests from your Shield LLM dashboard"
1429
+ ).option(
1430
+ "--custom-only",
1431
+ "Run ONLY custom tests \u2014 send no preset attack payloads to the target"
1411
1432
  ).option("--eu-ai-act", "Show EU AI Act compliance assessment after scan").option(
1412
1433
  "--compliance-threshold <n>",
1413
1434
  "Minimum compliance score (0-100)",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shield-llm",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "AI chatbot security scanner — automated red teaming for LLMs",
5
5
  "type": "module",
6
6
  "publishConfig": {