nsauditor-ai 0.1.33 → 0.1.35

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
@@ -15,6 +15,52 @@ NSAuditor AI is the open-source core of a privacy-first security intelligence pl
15
15
 
16
16
  **Zero Data Exfiltration by design.** NSAuditor AI works fully offline. AI analysis, CVE correlation, and continuous monitoring all happen locally. External calls (to AI APIs, NVD, etc.) are opt-in and use your own API keys. We never see your scan data.
17
17
 
18
+ ## What's New (0.1.35) — CLI provenance footer matches MCP response (so the comparison actually works)
19
+
20
+ 0.1.34 added the version-provenance block to the MCP server's `list_plugins` response, but **the CLI baseline (`license --plugins` / `license --status`) didn't show versions** — so customers couldn't easily compare. 0.1.35 fixes that asymmetry.
21
+
22
+ Both CLI commands now emit an identical provenance block:
23
+
24
+ ```
25
+ ── Installation provenance ──
26
+ nsauditor-ai (CE): 0.1.35
27
+ @nsasoft/nsauditor-ai-ee (EE): 0.3.4 (loaded)
28
+ ```
29
+
30
+ **Customer hallucination-detection workflow (5 seconds, no log archeology):**
31
+
32
+ 1. In Claude Desktop: ask "list plugins" → receive a response that should end with the provenance block
33
+ 2. In your terminal: run `nsauditor-ai license --plugins`
34
+ 3. Compare the two `── Installation provenance ──` blocks character-for-character
35
+ 4. **Match** → real MCP `tools/call` happened, response is trustworthy
36
+ 5. **Mismatch / missing block** → Claude fabricated the response (see CE 0.1.33 advisory)
37
+
38
+ This is the v1 mitigation; the v2 (Thread L Phase 2) adds per-call cryptographic sentinel UUIDs that the customer can grep against the server log directly. v1 catches the common case where Claude either omits the block entirely (unlikely to fabricate the new structure verbatim) or includes a stale version pulled from training data.
39
+
40
+ ---
41
+
42
+ ## What's New (0.1.34) — list_plugins now embeds CE+EE versions for hallucination detection
43
+
44
+ Companion to the 0.1.33 advisory. The `list_plugins` MCP tool's response now appends the actual installed CE + EE version numbers, so customers can verify a Claude Desktop response in **5 seconds** without log archeology:
45
+
46
+ ```
47
+ ── Installation provenance (verify against your shell) ──
48
+ nsauditor-ai (CE): 0.1.34
49
+ @nsasoft/nsauditor-ai-ee (EE): 0.3.4 (loaded)
50
+ Verify: nsauditor-ai --version && npm list -g @nsasoft/nsauditor-ai-ee
51
+ If versions in this response don't match your shell, the response was
52
+ AI-generated rather than retrieved from the MCP server (see CE 0.1.33 advisory).
53
+ ```
54
+
55
+ How it works as a hallucination detector:
56
+ - The MCP server reads `process.execPath`'s package.json + tries to resolve `@nsasoft/nsauditor-ai-ee/package.json` at request time. Both are real machine-specific values.
57
+ - Claude Desktop fabricated responses in the wild have shown stale version numbers from training data, missing version lines entirely, or different counts each time the same question is asked (observed 32→32→31 plugin counts in three consecutive hallucinations on 2026-05-10).
58
+ - A real tool response will exactly match `nsauditor-ai --version` + `npm list -g @nsasoft/nsauditor-ai-ee`. Mismatch = hallucinated.
59
+
60
+ This is a v1 mitigation — the v2 (Thread L in `tasks/todo.md`) adds per-call cryptographic sentinel UUIDs that the customer can grep against the server log.
61
+
62
+ ---
63
+
18
64
  ## What's New (0.1.33) — ⚠ MCP integration with Claude Desktop is unreliable
19
65
 
20
66
  **Critical advisory for customers using NSAuditor AI through Claude Desktop's MCP integration.** During the maintainer's own integration test on 2026-05-10, we discovered that **Claude Desktop's AI fabricates scan results, plugin lists, vulnerability findings, and tier information without actually invoking the MCP tools** for our specific server. Other MCP servers in the same Claude Desktop config receive real `tools/call` invocations; ours does not.
package/cli.mjs CHANGED
@@ -5,8 +5,10 @@ import { buildHtmlReport } from './utils/report_html.mjs';
5
5
  import fsp from 'node:fs/promises';
6
6
  import { dirname } from 'node:path';
7
7
  import { fileURLToPath } from 'node:url';
8
+ import { createRequire } from 'node:module';
8
9
 
9
10
  const __dirname = dirname(fileURLToPath(import.meta.url));
11
+ const _require = createRequire(import.meta.url);
10
12
  import path from 'node:path';
11
13
  import { platform } from 'node:os';
12
14
  import { openaiSimplePrompt, openaiPrompt as openaiProPrompt, openaiPromptOptimized } from './utils/prompts.mjs';
@@ -931,6 +933,20 @@ Docs: https://www.nsauditor.com/ai/ | Pricing: https://www.nsauditor.com/ai/
931
933
  console.log('\n→ Start a free 14-day Pro trial: https://www.nsauditor.com/ai/trial');
932
934
  }
933
935
  }
936
+ // CE 0.1.35 (Thread L mitigation v2): version provenance footer
937
+ // matches the MCP server's list_plugins suffix exactly. Customer
938
+ // verification flow: read versions in Claude Desktop's MCP
939
+ // response → compare against `license --status` output here.
940
+ // Mismatch ⇒ Claude hallucinated.
941
+ let _eeVersion = 'not installed';
942
+ try {
943
+ const ee = _require('@nsasoft/nsauditor-ai-ee/package.json');
944
+ _eeVersion = ee && ee.version ? `${ee.version} (loaded)` : 'unknown (loaded)';
945
+ } catch { /* CE-only — fine */ }
946
+ console.log('');
947
+ console.log('── Installation provenance ──');
948
+ console.log(` nsauditor-ai (CE): ${TOOL_VERSION}`);
949
+ console.log(` @nsasoft/nsauditor-ai-ee (EE): ${_eeVersion}`);
934
950
  } else if (rawArgs.includes('--capabilities')) {
935
951
  const tier = getTierFromEnv();
936
952
  const caps = resolveCapabilities(tier);
@@ -1004,6 +1020,24 @@ Docs: https://www.nsauditor.com/ai/ | Pricing: https://www.nsauditor.com/ai/
1004
1020
  console.log('');
1005
1021
  console.log(` ${totalRendered} plugin${totalRendered === 1 ? '' : 's'} total · current tier: ${tier}`);
1006
1022
  }
1023
+
1024
+ // CE 0.1.35 (Thread L mitigation v2): emit installation provenance
1025
+ // identical in shape to the MCP server's list_plugins suffix.
1026
+ // Customers comparing Claude Desktop's MCP response against the
1027
+ // CLI baseline now see the SAME version block in both places.
1028
+ // Mismatch → Claude hallucinated. Match → real tool call.
1029
+ const ceVersion = TOOL_VERSION;
1030
+ let eeVersion = 'not installed';
1031
+ try {
1032
+ const eeManifest = _require('@nsasoft/nsauditor-ai-ee/package.json');
1033
+ eeVersion = eeManifest && eeManifest.version
1034
+ ? `${eeManifest.version} (loaded)`
1035
+ : 'unknown (loaded)';
1036
+ } catch { /* CE-only install — fine */ }
1037
+ console.log('');
1038
+ console.log('── Installation provenance ──');
1039
+ console.log(` nsauditor-ai (CE): ${ceVersion}`);
1040
+ console.log(` @nsasoft/nsauditor-ai-ee (EE): ${eeVersion}`);
1007
1041
  } else if (rawArgs.includes('install')) {
1008
1042
  // CE-0.1.30.4 — install command. Verify the JWT FIRST, then persist
1009
1043
  // to a platform-appropriate location (macOS Keychain / file).
package/mcp_server.mjs CHANGED
@@ -366,12 +366,49 @@ export function createServer() {
366
366
  try {
367
367
  const result = await handler(args ?? {});
368
368
 
369
- // Append tier info to list_plugins response
369
+ // Append tier info + version provenance to list_plugins response.
370
+ //
371
+ // CE 0.1.34 (Thread L MITIGATION): the response now embeds the
372
+ // ACTUAL versions of CE + EE (when EE is loaded) so customers
373
+ // can detect Claude Desktop hallucinations. Background: Claude
374
+ // Desktop has been observed (2026-05-10) silently fabricating
375
+ // list_plugins responses without invoking the MCP server (per-
376
+ // server log shows zero `tools/call` while Claude reports
377
+ // detailed plugin lists). With version numbers in the response,
378
+ // a hallucinated answer will either omit the version line OR
379
+ // include a stale/wrong version pulled from training data.
380
+ // Customer verification (5 seconds, no log archeology):
381
+ // nsauditor-ai --version
382
+ // npm list -g @nsasoft/nsauditor-ai-ee
383
+ // If the versions in Claude Desktop's output don't match these
384
+ // commands, the response was AI-generated, not a real tool call.
370
385
  if (name === 'list_plugins') {
371
386
  const tierLabel = { ce: 'Community Edition (CE)', pro: 'Pro', enterprise: 'Enterprise' };
387
+
388
+ // Detect EE version (best-effort; absent on CE-only installs).
389
+ let eeVersion = 'not installed';
390
+ try {
391
+ const eeManifest = _require('@nsasoft/nsauditor-ai-ee/package.json');
392
+ eeVersion = eeManifest && eeManifest.version
393
+ ? `${eeManifest.version} (loaded)`
394
+ : 'unknown (loaded)';
395
+ } catch {
396
+ // EE package not installed or not resolvable — common for CE-only customers.
397
+ eeVersion = 'not installed';
398
+ }
399
+
400
+ const versionLines =
401
+ `\n\n── Installation provenance (verify against your shell) ──\n` +
402
+ `nsauditor-ai (CE): ${TOOL_VERSION}\n` +
403
+ `@nsasoft/nsauditor-ai-ee (EE): ${eeVersion}\n` +
404
+ `Verify: nsauditor-ai --version && npm list -g @nsasoft/nsauditor-ai-ee\n` +
405
+ `If versions in this response don't match your shell, the response was\n` +
406
+ `AI-generated rather than retrieved from the MCP server (see CE 0.1.33 advisory).`;
407
+
372
408
  const tierSuffix = `\n\nCurrent tier: ${tierLabel[_tier] ?? _tier}. ${_capabilities.proMCP ? '' : 'Upgrade to Pro for probe_service, get_vulnerabilities, risk_summary, and more.'}`;
409
+
373
410
  return {
374
- content: [{ type: 'text', text: JSON.stringify(result, null, 2) + tierSuffix }],
411
+ content: [{ type: 'text', text: JSON.stringify(result, null, 2) + tierSuffix + versionLines }],
375
412
  };
376
413
  }
377
414
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nsauditor-ai",
3
- "version": "0.1.33",
3
+ "version": "0.1.35",
4
4
  "description": "Modular AI-assisted network security audit platform — Community Edition",
5
5
  "type": "module",
6
6
  "private": false,