@bryan-thompson/inspector-assessment 1.22.13 → 1.22.16

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 (45) hide show
  1. package/README.md +3 -0
  2. package/cli/build/assess-full.js +13 -23
  3. package/client/dist/assets/{OAuthCallback-CZrJlcLn.js → OAuthCallback-DNYBkA2C.js} +1 -1
  4. package/client/dist/assets/{OAuthDebugCallback-DjI-YxME.js → OAuthDebugCallback-EhdSHXee.js} +1 -1
  5. package/client/dist/assets/{index-_w0OL9Gt.js → index-BRiFDs-g.js} +21 -14
  6. package/client/dist/index.html +1 -1
  7. package/client/lib/lib/assessment/configTypes.d.ts +70 -0
  8. package/client/lib/lib/assessment/configTypes.d.ts.map +1 -0
  9. package/client/lib/lib/assessment/configTypes.js +194 -0
  10. package/client/lib/lib/assessment/constants.d.ts +10 -0
  11. package/client/lib/lib/assessment/constants.d.ts.map +1 -0
  12. package/client/lib/lib/assessment/constants.js +61 -0
  13. package/client/lib/lib/assessment/coreTypes.d.ts +159 -0
  14. package/client/lib/lib/assessment/coreTypes.d.ts.map +1 -0
  15. package/client/lib/lib/assessment/coreTypes.js +101 -0
  16. package/client/lib/lib/assessment/extendedTypes.d.ts +415 -0
  17. package/client/lib/lib/assessment/extendedTypes.d.ts.map +1 -0
  18. package/client/lib/lib/assessment/extendedTypes.js +9 -0
  19. package/client/lib/lib/assessment/index.d.ts +23 -0
  20. package/client/lib/lib/assessment/index.d.ts.map +1 -0
  21. package/client/lib/lib/assessment/index.js +48 -0
  22. package/client/lib/lib/assessment/progressTypes.d.ts +160 -0
  23. package/client/lib/lib/assessment/progressTypes.d.ts.map +1 -0
  24. package/client/lib/lib/assessment/progressTypes.js +9 -0
  25. package/client/lib/lib/assessment/resultTypes.d.ts +568 -0
  26. package/client/lib/lib/assessment/resultTypes.d.ts.map +1 -0
  27. package/client/lib/lib/assessment/resultTypes.js +9 -0
  28. package/client/lib/lib/assessmentTypes.d.ts +20 -1248
  29. package/client/lib/lib/assessmentTypes.d.ts.map +1 -1
  30. package/client/lib/lib/assessmentTypes.js +21 -287
  31. package/client/lib/services/assessment/AssessmentOrchestrator.d.ts +5 -0
  32. package/client/lib/services/assessment/AssessmentOrchestrator.d.ts.map +1 -1
  33. package/client/lib/services/assessment/AssessmentOrchestrator.js +24 -6
  34. package/client/lib/services/assessment/lib/concurrencyLimit.d.ts +12 -0
  35. package/client/lib/services/assessment/lib/concurrencyLimit.d.ts.map +1 -1
  36. package/client/lib/services/assessment/lib/concurrencyLimit.js +22 -0
  37. package/client/lib/services/assessment/lib/logger.d.ts +98 -0
  38. package/client/lib/services/assessment/lib/logger.d.ts.map +1 -0
  39. package/client/lib/services/assessment/lib/logger.js +153 -0
  40. package/client/lib/services/assessment/modules/BaseAssessor.d.ts +2 -2
  41. package/client/lib/services/assessment/modules/BaseAssessor.d.ts.map +1 -1
  42. package/client/lib/services/assessment/modules/SecurityAssessor.d.ts.map +1 -1
  43. package/client/lib/services/assessment/modules/SecurityAssessor.js +10 -5
  44. package/client/lib/services/assessment/modules/ToolAnnotationAssessor.js +1 -1
  45. package/package.json +3 -2
package/README.md CHANGED
@@ -416,6 +416,9 @@ Configure assessment behavior through the UI:
416
416
 
417
417
  **Note**: The old numeric "Error Handling Test Limit" has been replaced with the tool selector. The `maxToolsToTestForErrors` config field is deprecated but still works for backward compatibility.
418
418
 
419
+ > **Deprecation Notice**: `maxToolsToTestForErrors` will be removed in v2.0.0.
420
+ > Migrate to `selectedToolsForTesting` (undefined = test all, [] = test none).
421
+
419
422
  ### Viewing Assessment Results
420
423
 
421
424
  The Assessment tab provides:
@@ -12,13 +12,19 @@
12
12
  import * as fs from "fs";
13
13
  import * as path from "path";
14
14
  import * as os from "os";
15
+ import { EventEmitter } from "events";
16
+ // Increase max listeners to prevent warning during security testing
17
+ // Full assessment runs 234+ sequential tool calls (6 tools × 13 patterns × 3 payloads)
18
+ // Each call may add listeners to the underlying socket
19
+ EventEmitter.defaultMaxListeners = 300;
20
+ process.setMaxListeners(300);
15
21
  import { Client } from "@modelcontextprotocol/sdk/client/index.js";
16
22
  import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
17
23
  import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
18
24
  import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
19
25
  // Import from local client lib (will use package exports when published)
20
26
  import { AssessmentOrchestrator, } from "../../client/lib/services/assessment/AssessmentOrchestrator.js";
21
- import { DEFAULT_ASSESSMENT_CONFIG, ASSESSMENT_CATEGORY_METADATA, } from "../../client/lib/lib/assessmentTypes.js";
27
+ import { DEFAULT_ASSESSMENT_CONFIG, ASSESSMENT_CATEGORY_METADATA, getAllModulesConfig, } from "../../client/lib/lib/assessmentTypes.js";
22
28
  import { FULL_CLAUDE_CODE_CONFIG } from "../../client/lib/services/assessment/lib/claudeCodeBridge.js";
23
29
  import { createFormatter, } from "../../client/lib/lib/reportFormatters/index.js";
24
30
  import { generatePolicyComplianceReport } from "../../client/lib/services/assessment/PolicyComplianceGenerator.js";
@@ -333,30 +339,14 @@ function buildConfig(options) {
333
339
  enableExtendedAssessment: options.fullAssessment !== false,
334
340
  parallelTesting: true,
335
341
  testTimeout: 30000,
336
- enableSourceCodeAnalysis: !!options.sourceCodePath,
342
+ enableSourceCodeAnalysis: Boolean(options.sourceCodePath),
337
343
  };
338
344
  if (options.fullAssessment !== false) {
339
- // Start with all modules enabled by default
340
- const allModules = {
341
- functionality: true,
342
- security: true,
343
- documentation: true,
344
- errorHandling: true,
345
- usability: true,
346
- mcpSpecCompliance: true,
347
- aupCompliance: true,
348
- toolAnnotations: true,
349
- prohibitedLibraries: true,
350
- manifestValidation: true,
351
- portability: true,
352
- externalAPIScanner: !!options.sourceCodePath,
353
- temporal: !options.skipTemporal, // Enable by default with --full, skip with --skip-temporal
354
- // New capability assessors - always enabled in full mode
355
- resources: true,
356
- prompts: true,
357
- crossCapability: true,
358
- authentication: true,
359
- };
345
+ // Derive module config from ASSESSMENT_CATEGORY_METADATA (single source of truth)
346
+ const allModules = getAllModulesConfig({
347
+ sourceCodePath: Boolean(options.sourceCodePath),
348
+ skipTemporal: options.skipTemporal,
349
+ });
360
350
  // Apply --only-modules filter (whitelist mode)
361
351
  if (options.onlyModules?.length) {
362
352
  for (const key of Object.keys(allModules)) {
@@ -1,4 +1,4 @@
1
- import { u as useToast, r as reactExports, j as jsxRuntimeExports, p as parseOAuthCallbackParams, g as generateOAuthErrorDescription, S as SESSION_KEYS, I as InspectorOAuthClientProvider, a as auth } from "./index-_w0OL9Gt.js";
1
+ import { u as useToast, r as reactExports, j as jsxRuntimeExports, p as parseOAuthCallbackParams, g as generateOAuthErrorDescription, S as SESSION_KEYS, I as InspectorOAuthClientProvider, a as auth } from "./index-BRiFDs-g.js";
2
2
  const OAuthCallback = ({ onConnect }) => {
3
3
  const { toast } = useToast();
4
4
  const hasProcessedRef = reactExports.useRef(false);
@@ -1,4 +1,4 @@
1
- import { r as reactExports, S as SESSION_KEYS, p as parseOAuthCallbackParams, j as jsxRuntimeExports, g as generateOAuthErrorDescription } from "./index-_w0OL9Gt.js";
1
+ import { r as reactExports, S as SESSION_KEYS, p as parseOAuthCallbackParams, j as jsxRuntimeExports, g as generateOAuthErrorDescription } from "./index-BRiFDs-g.js";
2
2
  const OAuthDebugCallback = ({ onConnect }) => {
3
3
  reactExports.useEffect(() => {
4
4
  let isProcessed = false;
@@ -16320,7 +16320,7 @@ object({
16320
16320
  token_type_hint: string().optional()
16321
16321
  }).strip();
16322
16322
  const name = "@bryan-thompson/inspector-assessment-client";
16323
- const version$1 = "1.22.13";
16323
+ const version$1 = "1.22.16";
16324
16324
  const packageJson = {
16325
16325
  name,
16326
16326
  version: version$1
@@ -45352,7 +45352,7 @@ const useTheme = () => {
45352
45352
  [theme, setThemeWithSideEffect]
45353
45353
  );
45354
45354
  };
45355
- const version = "1.22.13";
45355
+ const version = "1.22.16";
45356
45356
  var [createTooltipContext] = createContextScope("Tooltip", [
45357
45357
  createPopperScope
45358
45358
  ]);
@@ -48033,8 +48033,6 @@ const DEFAULT_ASSESSMENT_CONFIG = {
48033
48033
  // Enable MCP Spec Compliance assessment by default
48034
48034
  parallelTesting: false,
48035
48035
  maxParallelTests: 5,
48036
- maxToolsToTestForErrors: -1,
48037
- // Default to test ALL tools for comprehensive compliance
48038
48036
  securityPatternsToTest: 8,
48039
48037
  // Test all security patterns by default
48040
48038
  enableDomainTesting: true,
@@ -48078,8 +48076,6 @@ const REVIEWER_MODE_CONFIG = {
48078
48076
  maxParallelTests: 5,
48079
48077
  scenariosPerTool: 1,
48080
48078
  // Single realistic test per tool
48081
- maxToolsToTestForErrors: 3,
48082
- // Test only first 3 tools for error handling
48083
48079
  securityPatternsToTest: 3,
48084
48080
  // Test only 3 critical security patterns
48085
48081
  enableDomainTesting: false,
@@ -48119,8 +48115,6 @@ const DEVELOPER_MODE_CONFIG = {
48119
48115
  parallelTesting: false,
48120
48116
  // Sequential for easier debugging
48121
48117
  maxParallelTests: 5,
48122
- maxToolsToTestForErrors: -1,
48123
- // Test ALL tools
48124
48118
  securityPatternsToTest: 8,
48125
48119
  // Test all security patterns
48126
48120
  enableDomainTesting: true,
@@ -48836,11 +48830,13 @@ class MCPSpecComplianceAssessor extends BaseAssessor {
48836
48830
  return recommendations;
48837
48831
  }
48838
48832
  }
48833
+ const QUEUE_WARNING_THRESHOLD = 1e4;
48839
48834
  function createConcurrencyLimit(concurrency) {
48840
48835
  if (concurrency < 1) {
48841
48836
  throw new Error("Concurrency must be at least 1");
48842
48837
  }
48843
48838
  let activeCount = 0;
48839
+ let hasWarned = false;
48844
48840
  const queue = [];
48845
48841
  const next = () => {
48846
48842
  if (activeCount < concurrency && queue.length > 0) {
@@ -48864,6 +48860,12 @@ function createConcurrencyLimit(concurrency) {
48864
48860
  resolve: resolve2,
48865
48861
  reject
48866
48862
  });
48863
+ if (queue.length > QUEUE_WARNING_THRESHOLD && !hasWarned) {
48864
+ hasWarned = true;
48865
+ console.warn(
48866
+ `[concurrencyLimit] Queue depth: ${queue.length} (threshold: ${QUEUE_WARNING_THRESHOLD}). Active: ${activeCount}/${concurrency}. This may indicate a slow/stalled server.`
48867
+ );
48868
+ }
48867
48869
  next();
48868
48870
  });
48869
48871
  };
@@ -52458,7 +52460,7 @@ function getPayloadsForAttack(attackName, limit2) {
52458
52460
  );
52459
52461
  if (!pattern2) return [];
52460
52462
  const payloads = pattern2.payloads;
52461
- return payloads;
52463
+ return limit2 ? payloads.slice(0, limit2) : payloads;
52462
52464
  }
52463
52465
  function getAllAttackPatterns() {
52464
52466
  return SECURITY_ATTACK_PATTERNS;
@@ -52801,7 +52803,11 @@ class SecurityAssessor extends BaseAssessor {
52801
52803
  const toolsToTest = this.selectToolsForTesting(context.tools);
52802
52804
  const concurrency = this.config.maxParallelTests ?? 5;
52803
52805
  const limit2 = createConcurrencyLimit(concurrency);
52804
- const totalEstimate = toolsToTest.length * attackPatterns.length * 3;
52806
+ let totalPayloads = 0;
52807
+ for (const pattern2 of attackPatterns) {
52808
+ totalPayloads += getPayloadsForAttack(pattern2.attackName).length;
52809
+ }
52810
+ const totalEstimate = toolsToTest.length * totalPayloads;
52805
52811
  let completedTests = 0;
52806
52812
  let lastBatchTime = Date.now();
52807
52813
  const startTime = Date.now();
@@ -53062,9 +53068,10 @@ class SecurityAssessor extends BaseAssessor {
53062
53068
  evidence: "No compatible parameters for testing"
53063
53069
  };
53064
53070
  }
53071
+ const securityTimeout = this.config.securityTestTimeout ?? 5e3;
53065
53072
  const response = await this.executeWithTimeout(
53066
53073
  callTool(tool.name, params),
53067
- 5e3
53074
+ securityTimeout
53068
53075
  );
53069
53076
  if (this.isConnectionError(response)) {
53070
53077
  return {
@@ -53554,7 +53561,7 @@ class SecurityAssessor extends BaseAssessor {
53554
53561
  * Added for Issue #14: False positives on safe input reflection
53555
53562
  */
53556
53563
  isComputedMathResult(payload, responseText) {
53557
- const simpleMathPattern = /^\s*(\d+)\s*([+\-*\/])\s*(\d+)(?:\s*([+\-*\/])\s*(\d+))?\s*$/;
53564
+ const simpleMathPattern = /^\s*(\d+)\s*([+\-*/])\s*(\d+)(?:\s*([+\-*/])\s*(\d+))?\s*$/;
53558
53565
  const match = payload.match(simpleMathPattern);
53559
53566
  if (!match) {
53560
53567
  return false;
@@ -59266,13 +59273,13 @@ const App = () => {
59266
59273
  ) });
59267
59274
  if (window.location.pathname === "/oauth/callback") {
59268
59275
  const OAuthCallback = React.lazy(
59269
- () => __vitePreload(() => import("./OAuthCallback-CZrJlcLn.js"), true ? [] : void 0)
59276
+ () => __vitePreload(() => import("./OAuthCallback-DNYBkA2C.js"), true ? [] : void 0)
59270
59277
  );
59271
59278
  return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthCallback, { onConnect: onOAuthConnect }) });
59272
59279
  }
59273
59280
  if (window.location.pathname === "/oauth/callback/debug") {
59274
59281
  const OAuthDebugCallback = React.lazy(
59275
- () => __vitePreload(() => import("./OAuthDebugCallback-DjI-YxME.js"), true ? [] : void 0)
59282
+ () => __vitePreload(() => import("./OAuthDebugCallback-EhdSHXee.js"), true ? [] : void 0)
59276
59283
  );
59277
59284
  return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthDebugCallback, { onConnect: onOAuthDebugConnect }) });
59278
59285
  }
@@ -5,7 +5,7 @@
5
5
  <link rel="icon" type="image/svg+xml" href="/mcp.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>MCP Inspector</title>
8
- <script type="module" crossorigin src="/assets/index-_w0OL9Gt.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-BRiFDs-g.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-DiyPO_Zj.css">
10
10
  </head>
11
11
  <body>
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Assessment Configuration Types
3
+ *
4
+ * Configuration interfaces and preset configurations for assessments.
5
+ *
6
+ * @module assessment/configTypes
7
+ */
8
+ /**
9
+ * Claude Code Bridge Configuration
10
+ * Enables integration with Claude Code CLI for intelligent analysis
11
+ */
12
+ export interface ClaudeCodeConfig {
13
+ enabled: boolean;
14
+ features: {
15
+ intelligentTestGeneration: boolean;
16
+ aupSemanticAnalysis: boolean;
17
+ annotationInference: boolean;
18
+ documentationQuality: boolean;
19
+ };
20
+ timeout: number;
21
+ workingDir?: string;
22
+ maxRetries?: number;
23
+ }
24
+ export interface AssessmentConfiguration {
25
+ testTimeout: number;
26
+ /** Security-specific test timeout in ms (default: 5000). Lower than testTimeout for fast payload testing. */
27
+ securityTestTimeout?: number;
28
+ delayBetweenTests?: number;
29
+ skipBrokenTools: boolean;
30
+ reviewerMode?: boolean;
31
+ enableExtendedAssessment?: boolean;
32
+ documentationVerbosity?: "minimal" | "standard" | "verbose";
33
+ parallelTesting?: boolean;
34
+ maxParallelTests?: number;
35
+ scenariosPerTool?: number;
36
+ maxToolsToTestForErrors?: number;
37
+ selectedToolsForTesting?: string[];
38
+ securityPatternsToTest?: number;
39
+ enableDomainTesting?: boolean;
40
+ mcpProtocolVersion?: string;
41
+ enableSourceCodeAnalysis?: boolean;
42
+ patternConfigPath?: string;
43
+ claudeCode?: ClaudeCodeConfig;
44
+ temporalInvocations?: number;
45
+ assessmentCategories?: {
46
+ functionality: boolean;
47
+ security: boolean;
48
+ documentation: boolean;
49
+ errorHandling: boolean;
50
+ usability: boolean;
51
+ mcpSpecCompliance?: boolean;
52
+ aupCompliance?: boolean;
53
+ toolAnnotations?: boolean;
54
+ prohibitedLibraries?: boolean;
55
+ manifestValidation?: boolean;
56
+ portability?: boolean;
57
+ externalAPIScanner?: boolean;
58
+ authentication?: boolean;
59
+ temporal?: boolean;
60
+ resources?: boolean;
61
+ prompts?: boolean;
62
+ crossCapability?: boolean;
63
+ };
64
+ }
65
+ export declare const DEFAULT_ASSESSMENT_CONFIG: AssessmentConfiguration;
66
+ export declare const REVIEWER_MODE_CONFIG: AssessmentConfiguration;
67
+ export declare const DEVELOPER_MODE_CONFIG: AssessmentConfiguration;
68
+ export declare const AUDIT_MODE_CONFIG: AssessmentConfiguration;
69
+ export declare const CLAUDE_ENHANCED_AUDIT_CONFIG: AssessmentConfiguration;
70
+ //# sourceMappingURL=configTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configTypes.d.ts","sourceRoot":"","sources":["../../../src/lib/assessment/configTypes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE;QACR,yBAAyB,EAAE,OAAO,CAAC;QACnC,mBAAmB,EAAE,OAAO,CAAC;QAC7B,mBAAmB,EAAE,OAAO,CAAC;QAC7B,oBAAoB,EAAE,OAAO,CAAC;KAC/B,CAAC;IACF,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,uBAAuB;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,6GAA6G;IAC7G,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,OAAO,CAAC;IAEzB,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAEnC,sBAAsB,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;IAI5D,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,uBAAuB,CAAC,EAAE,MAAM,EAAE,CAAC;IACnC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAEnC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAE9B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,oBAAoB,CAAC,EAAE;QACrB,aAAa,EAAE,OAAO,CAAC;QACvB,QAAQ,EAAE,OAAO,CAAC;QAClB,aAAa,EAAE,OAAO,CAAC;QACvB,aAAa,EAAE,OAAO,CAAC;QACvB,SAAS,EAAE,OAAO,CAAC;QACnB,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAE5B,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;QAEnB,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,eAAe,CAAC,EAAE,OAAO,CAAC;KAC3B,CAAC;CACH;AAMD,eAAO,MAAM,yBAAyB,EAAE,uBAgCvC,CAAC;AAIF,eAAO,MAAM,oBAAoB,EAAE,uBAiClC,CAAC;AAGF,eAAO,MAAM,qBAAqB,EAAE,uBAgCnC,CAAC;AAIF,eAAO,MAAM,iBAAiB,EAAE,uBAgC/B,CAAC;AAIF,eAAO,MAAM,4BAA4B,EAAE,uBA2C1C,CAAC"}
@@ -0,0 +1,194 @@
1
+ /**
2
+ * Assessment Configuration Types
3
+ *
4
+ * Configuration interfaces and preset configurations for assessments.
5
+ *
6
+ * @module assessment/configTypes
7
+ */
8
+ // ============================================================================
9
+ // Configuration Presets
10
+ // ============================================================================
11
+ export const DEFAULT_ASSESSMENT_CONFIG = {
12
+ testTimeout: 30000, // 30 seconds per tool
13
+ delayBetweenTests: 0, // No delay by default
14
+ skipBrokenTools: false,
15
+ reviewerMode: false,
16
+ enableExtendedAssessment: true, // Enable MCP Spec Compliance assessment by default
17
+ parallelTesting: false,
18
+ maxParallelTests: 5,
19
+ securityPatternsToTest: 8, // Test all security patterns by default
20
+ enableDomainTesting: true, // Enable advanced security testing by default (all 8 backend patterns)
21
+ mcpProtocolVersion: "2025-06",
22
+ enableSourceCodeAnalysis: false, // Source code analysis disabled by default (requires sourceCodePath)
23
+ assessmentCategories: {
24
+ functionality: true,
25
+ security: true,
26
+ documentation: true,
27
+ errorHandling: true,
28
+ usability: true,
29
+ mcpSpecCompliance: false,
30
+ // New assessors - disabled by default, enable for MCP Directory compliance audits
31
+ aupCompliance: false,
32
+ toolAnnotations: false,
33
+ prohibitedLibraries: false,
34
+ manifestValidation: false,
35
+ portability: false,
36
+ externalAPIScanner: false,
37
+ authentication: false,
38
+ // New capability assessors - disabled by default
39
+ resources: false,
40
+ prompts: false,
41
+ crossCapability: false,
42
+ },
43
+ };
44
+ // Reviewer mode configuration: optimized for fast, human-assisted reviews
45
+ // Focuses on Anthropic's 5 core requirements only
46
+ export const REVIEWER_MODE_CONFIG = {
47
+ testTimeout: 10000, // 10 seconds per tool (faster)
48
+ delayBetweenTests: 100, // Small delay for rate limiting
49
+ skipBrokenTools: true, // Skip broken tools to save time
50
+ reviewerMode: true,
51
+ enableExtendedAssessment: false, // Disable extended assessments (not required for directory approval)
52
+ parallelTesting: true, // Faster execution
53
+ maxParallelTests: 5,
54
+ scenariosPerTool: 1, // Single realistic test per tool
55
+ securityPatternsToTest: 3, // Test only 3 critical security patterns
56
+ enableDomainTesting: false, // Use basic security testing for speed (3 patterns)
57
+ mcpProtocolVersion: "2025-06",
58
+ enableSourceCodeAnalysis: false,
59
+ assessmentCategories: {
60
+ functionality: true,
61
+ security: true,
62
+ documentation: true,
63
+ errorHandling: true,
64
+ usability: true,
65
+ mcpSpecCompliance: false, // Not part of Anthropic's 5 core requirements
66
+ // New assessors - disabled in reviewer mode for speed
67
+ aupCompliance: false,
68
+ toolAnnotations: false,
69
+ prohibitedLibraries: false,
70
+ manifestValidation: false,
71
+ portability: false,
72
+ externalAPIScanner: false,
73
+ authentication: false,
74
+ // New capability assessors - disabled in reviewer mode for speed
75
+ resources: false,
76
+ prompts: false,
77
+ crossCapability: false,
78
+ },
79
+ };
80
+ // Developer mode configuration: comprehensive testing for debugging
81
+ export const DEVELOPER_MODE_CONFIG = {
82
+ testTimeout: 30000, // 30 seconds per tool
83
+ delayBetweenTests: 500, // Moderate delay for thorough testing
84
+ skipBrokenTools: false,
85
+ reviewerMode: false,
86
+ enableExtendedAssessment: true,
87
+ parallelTesting: false, // Sequential for easier debugging
88
+ maxParallelTests: 5,
89
+ securityPatternsToTest: 8, // Test all security patterns
90
+ enableDomainTesting: true, // Enable advanced security testing (all 8 backend patterns)
91
+ mcpProtocolVersion: "2025-06",
92
+ enableSourceCodeAnalysis: true, // Enable source code analysis if path provided
93
+ assessmentCategories: {
94
+ functionality: true,
95
+ security: true,
96
+ documentation: true,
97
+ errorHandling: true,
98
+ usability: true,
99
+ mcpSpecCompliance: true, // Include extended assessments
100
+ // New assessors - enabled in developer mode for comprehensive testing
101
+ aupCompliance: true,
102
+ toolAnnotations: true,
103
+ prohibitedLibraries: true,
104
+ manifestValidation: false, // MCPB bundle-specific, disabled by default
105
+ portability: false, // MCPB bundle-specific, disabled by default
106
+ externalAPIScanner: true,
107
+ authentication: true,
108
+ // New capability assessors - enabled in developer mode
109
+ resources: true,
110
+ prompts: true,
111
+ crossCapability: true,
112
+ },
113
+ };
114
+ // MCP Directory Audit mode: focuses on compliance gap assessors
115
+ // Use for pre-submission validation to Anthropic MCP Directory
116
+ export const AUDIT_MODE_CONFIG = {
117
+ testTimeout: 30000,
118
+ delayBetweenTests: 100,
119
+ skipBrokenTools: false,
120
+ reviewerMode: false,
121
+ enableExtendedAssessment: true,
122
+ parallelTesting: true, // Parallel for faster audits
123
+ maxParallelTests: 5,
124
+ securityPatternsToTest: 8,
125
+ enableDomainTesting: true,
126
+ mcpProtocolVersion: "2025-06",
127
+ enableSourceCodeAnalysis: true, // Deep analysis for audits
128
+ assessmentCategories: {
129
+ functionality: true,
130
+ security: true,
131
+ documentation: true,
132
+ errorHandling: true,
133
+ usability: true,
134
+ mcpSpecCompliance: true,
135
+ // All new assessors enabled for audit mode
136
+ aupCompliance: true,
137
+ toolAnnotations: true,
138
+ prohibitedLibraries: true,
139
+ manifestValidation: false, // MCPB bundle-specific, disabled by default
140
+ portability: false, // MCPB bundle-specific, disabled by default
141
+ externalAPIScanner: true,
142
+ authentication: true,
143
+ // New capability assessors - enabled in audit mode
144
+ resources: true,
145
+ prompts: true,
146
+ crossCapability: true,
147
+ },
148
+ };
149
+ // Claude-enhanced audit mode: uses Claude Code for intelligent analysis
150
+ // Reduces false positives in AUP scanning and improves test quality
151
+ export const CLAUDE_ENHANCED_AUDIT_CONFIG = {
152
+ testTimeout: 30000,
153
+ delayBetweenTests: 100,
154
+ skipBrokenTools: false,
155
+ reviewerMode: false,
156
+ enableExtendedAssessment: true,
157
+ parallelTesting: false, // Sequential when using Claude to avoid rate limiting
158
+ maxParallelTests: 1,
159
+ securityPatternsToTest: 8,
160
+ enableDomainTesting: true,
161
+ mcpProtocolVersion: "2025-06",
162
+ enableSourceCodeAnalysis: true,
163
+ // Claude Code integration enabled
164
+ claudeCode: {
165
+ enabled: true,
166
+ features: {
167
+ intelligentTestGeneration: true, // Generate semantically meaningful test params
168
+ aupSemanticAnalysis: true, // Reduce false positives in AUP scanning
169
+ annotationInference: true, // Detect annotation misalignments
170
+ documentationQuality: true, // Assess documentation quality semantically
171
+ },
172
+ timeout: 90000, // 90 seconds for Claude calls
173
+ maxRetries: 2,
174
+ },
175
+ assessmentCategories: {
176
+ functionality: true,
177
+ security: true,
178
+ documentation: true,
179
+ errorHandling: true,
180
+ usability: true,
181
+ mcpSpecCompliance: true,
182
+ aupCompliance: true,
183
+ toolAnnotations: true,
184
+ prohibitedLibraries: true,
185
+ manifestValidation: false, // MCPB bundle-specific, disabled by default
186
+ portability: false, // MCPB bundle-specific, disabled by default
187
+ externalAPIScanner: true,
188
+ authentication: true,
189
+ // New capability assessors - enabled in Claude mode
190
+ resources: true,
191
+ prompts: true,
192
+ crossCapability: true,
193
+ },
194
+ };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Assessment Constants
3
+ *
4
+ * Constant values used in security testing.
5
+ *
6
+ * @module assessment/constants
7
+ */
8
+ import type { SecurityTestResult } from "./resultTypes.js";
9
+ export declare const PROMPT_INJECTION_TESTS: Omit<SecurityTestResult, "vulnerable" | "evidence">[];
10
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/lib/assessment/constants.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGxD,eAAO,MAAM,sBAAsB,EAAE,IAAI,CACvC,kBAAkB,EAClB,YAAY,GAAG,UAAU,CAC1B,EAqDA,CAAC"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Assessment Constants
3
+ *
4
+ * Constant values used in security testing.
5
+ *
6
+ * @module assessment/constants
7
+ */
8
+ // Backend API security patterns (8 total) - tests API security, not LLM behaviors
9
+ export const PROMPT_INJECTION_TESTS = [
10
+ // Critical Injection (3)
11
+ {
12
+ testName: "Command Injection",
13
+ description: "Test if tool executes system commands",
14
+ payload: "; rm -rf /; echo 'test'",
15
+ riskLevel: "HIGH",
16
+ },
17
+ {
18
+ testName: "SQL Injection",
19
+ description: "Test if tool properly escapes SQL commands",
20
+ payload: "'; DROP TABLE users;--",
21
+ riskLevel: "HIGH",
22
+ },
23
+ {
24
+ testName: "Path Traversal",
25
+ description: "Test if tool allows access to files outside intended directory",
26
+ payload: "../../../etc/passwd",
27
+ riskLevel: "HIGH",
28
+ },
29
+ // Input Validation (3)
30
+ {
31
+ testName: "Type Safety",
32
+ description: "Test if tool validates parameter types correctly",
33
+ payload: "not_a_number",
34
+ riskLevel: "MEDIUM",
35
+ },
36
+ {
37
+ testName: "Boundary Testing",
38
+ description: "Test edge cases and boundary conditions",
39
+ payload: "",
40
+ riskLevel: "LOW",
41
+ },
42
+ {
43
+ testName: "Required Fields",
44
+ description: "Test if tool validates required parameters",
45
+ payload: "MISSING_REQUIRED",
46
+ riskLevel: "MEDIUM",
47
+ },
48
+ // Protocol Compliance (2)
49
+ {
50
+ testName: "MCP Error Format",
51
+ description: "Verify errors follow MCP protocol specification",
52
+ payload: "INVALID_TRIGGER_ERROR",
53
+ riskLevel: "LOW",
54
+ },
55
+ {
56
+ testName: "Timeout Handling",
57
+ description: "Test if tool handles long operations gracefully",
58
+ payload: "SIMULATE_LONG_OPERATION",
59
+ riskLevel: "LOW",
60
+ },
61
+ ];