@bryan-thompson/inspector-assessment 1.35.0 → 1.35.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.
- package/cli/build/__tests__/stage3-fix-validation.test.js +163 -0
- package/cli/build/__tests__/stage3-fixes.test.js +516 -0
- package/cli/build/lib/cli-parser.js +7 -0
- package/cli/build/lib/cli-parserSchemas.js +3 -0
- package/cli/build/lib/jsonl-events.js +3 -0
- package/cli/build/lib/result-output.js +8 -2
- package/cli/package.json +1 -1
- package/client/dist/assets/{OAuthCallback-DC1cIXHT.js → OAuthCallback-jfmizOMH.js} +1 -1
- package/client/dist/assets/{OAuthDebugCallback-C3gqJjgQ.js → OAuthDebugCallback-bU5kKvnt.js} +1 -1
- package/client/dist/assets/{index-Dn2w887x.js → index-Ce63ds7G.js} +4 -4
- package/client/dist/index.html +1 -1
- package/client/lib/lib/assessment/extendedTypes.d.ts +19 -5
- package/client/lib/lib/assessment/extendedTypes.d.ts.map +1 -1
- package/client/lib/lib/assessment/summarizer/AssessmentSummarizer.d.ts.map +1 -1
- package/client/lib/lib/assessment/summarizer/AssessmentSummarizer.js +14 -1
- package/client/lib/lib/assessment/summarizer/index.d.ts +4 -0
- package/client/lib/lib/assessment/summarizer/index.d.ts.map +1 -1
- package/client/lib/lib/assessment/summarizer/index.js +4 -0
- package/client/lib/lib/assessment/summarizer/stageBEnrichmentBuilder.d.ts +36 -0
- package/client/lib/lib/assessment/summarizer/stageBEnrichmentBuilder.d.ts.map +1 -0
- package/client/lib/lib/assessment/summarizer/stageBEnrichmentBuilder.js +282 -0
- package/client/lib/lib/assessment/summarizer/stageBTypes.d.ts +154 -0
- package/client/lib/lib/assessment/summarizer/stageBTypes.d.ts.map +1 -0
- package/client/lib/lib/assessment/summarizer/stageBTypes.js +24 -0
- package/client/lib/lib/assessment/summarizer/types.d.ts +5 -0
- package/client/lib/lib/assessment/summarizer/types.d.ts.map +1 -1
- package/client/lib/lib/assessment/summarizer/types.js +1 -0
- package/client/lib/lib/moduleScoring.d.ts +2 -1
- package/client/lib/lib/moduleScoring.d.ts.map +1 -1
- package/client/lib/lib/moduleScoring.js +2 -1
- package/client/lib/services/assessment/modules/ManifestValidationAssessor.d.ts +8 -0
- package/client/lib/services/assessment/modules/ManifestValidationAssessor.d.ts.map +1 -1
- package/client/lib/services/assessment/modules/ManifestValidationAssessor.js +51 -8
- package/client/package.json +1 -1
- package/package.json +1 -1
- package/server/package.json +1 -1
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stage B Enrichment Builder
|
|
3
|
+
*
|
|
4
|
+
* Functions to build Stage B enrichment data from assessment results.
|
|
5
|
+
* Extracts evidence, correlations, and confidence details for Claude
|
|
6
|
+
* semantic analysis.
|
|
7
|
+
*
|
|
8
|
+
* Issue #137: Stage A data enrichment for Stage B Claude analysis
|
|
9
|
+
*
|
|
10
|
+
* @module assessment/summarizer/stageBEnrichmentBuilder
|
|
11
|
+
*/
|
|
12
|
+
import { DEFAULT_TIER2_MAX_SAMPLES, DEFAULT_TIER3_MAX_CORRELATIONS, MAX_RESPONSE_LENGTH, MAX_CONTEXT_WINDOW, } from "./stageBTypes.js";
|
|
13
|
+
// ============================================================================
|
|
14
|
+
// Helper Functions
|
|
15
|
+
// ============================================================================
|
|
16
|
+
/**
|
|
17
|
+
* Truncate a string to a maximum length, adding ellipsis if truncated.
|
|
18
|
+
*/
|
|
19
|
+
function truncate(str, maxLength) {
|
|
20
|
+
if (!str)
|
|
21
|
+
return "";
|
|
22
|
+
if (str.length <= maxLength)
|
|
23
|
+
return str;
|
|
24
|
+
return str.slice(0, maxLength - 3) + "...";
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Map test result to classification.
|
|
28
|
+
*/
|
|
29
|
+
function classifyTestResult(test) {
|
|
30
|
+
if (test.connectionError)
|
|
31
|
+
return "error";
|
|
32
|
+
if (test.testReliability === "failed")
|
|
33
|
+
return "error";
|
|
34
|
+
if (test.vulnerable)
|
|
35
|
+
return "vulnerable";
|
|
36
|
+
return "safe";
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Convert SecurityTestResult to PayloadCorrelation.
|
|
40
|
+
*/
|
|
41
|
+
function testToCorrelation(test) {
|
|
42
|
+
return {
|
|
43
|
+
inputPayload: truncate(test.payload, MAX_RESPONSE_LENGTH),
|
|
44
|
+
outputResponse: truncate(test.response, MAX_RESPONSE_LENGTH),
|
|
45
|
+
classification: classifyTestResult(test),
|
|
46
|
+
matchedPatterns: test.vulnerable ? [test.testName] : [],
|
|
47
|
+
toolName: test.toolName || "unknown",
|
|
48
|
+
testName: test.testName,
|
|
49
|
+
confidence: test.confidence,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Convert test result to finding evidence.
|
|
54
|
+
*/
|
|
55
|
+
function testToEvidence(test) {
|
|
56
|
+
const contextSource = test.evidence || test.response;
|
|
57
|
+
const location = test.evidence
|
|
58
|
+
? "evidence"
|
|
59
|
+
: test.response
|
|
60
|
+
? "response"
|
|
61
|
+
: "unknown";
|
|
62
|
+
return {
|
|
63
|
+
raw: truncate(test.payload, MAX_RESPONSE_LENGTH),
|
|
64
|
+
context: truncate(contextSource, MAX_CONTEXT_WINDOW),
|
|
65
|
+
location,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Calculate confidence distribution from tests.
|
|
70
|
+
*/
|
|
71
|
+
function calculateConfidenceBreakdown(tests) {
|
|
72
|
+
const breakdown = { high: 0, medium: 0, low: 0 };
|
|
73
|
+
for (const test of tests) {
|
|
74
|
+
if (test.vulnerable) {
|
|
75
|
+
const confidence = test.confidence || "medium";
|
|
76
|
+
breakdown[confidence]++;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return breakdown;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Calculate pattern distribution from tests.
|
|
83
|
+
*/
|
|
84
|
+
function calculatePatternDistribution(tests) {
|
|
85
|
+
const distribution = {};
|
|
86
|
+
for (const test of tests) {
|
|
87
|
+
if (test.vulnerable) {
|
|
88
|
+
const pattern = test.testName;
|
|
89
|
+
distribution[pattern] = (distribution[pattern] || 0) + 1;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return distribution;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Find the highest risk test (most concerning vulnerability).
|
|
96
|
+
*/
|
|
97
|
+
function findHighestRiskTest(tests) {
|
|
98
|
+
const vulnerableTests = tests.filter((t) => t.vulnerable);
|
|
99
|
+
if (vulnerableTests.length === 0)
|
|
100
|
+
return undefined;
|
|
101
|
+
// Prioritize by risk level, then by confidence
|
|
102
|
+
const riskOrder = { CRITICAL: 0, HIGH: 1, MEDIUM: 2, LOW: 3 };
|
|
103
|
+
const confidenceOrder = { high: 0, medium: 1, low: 2 };
|
|
104
|
+
return vulnerableTests.sort((a, b) => {
|
|
105
|
+
const riskDiff = (riskOrder[a.riskLevel] ?? 4) - (riskOrder[b.riskLevel] ?? 4);
|
|
106
|
+
if (riskDiff !== 0)
|
|
107
|
+
return riskDiff;
|
|
108
|
+
return ((confidenceOrder[a.confidence || "medium"] ?? 1) -
|
|
109
|
+
(confidenceOrder[b.confidence || "medium"] ?? 1));
|
|
110
|
+
})[0];
|
|
111
|
+
}
|
|
112
|
+
// ============================================================================
|
|
113
|
+
// Tier 2: Tool Summary Enrichment Builder
|
|
114
|
+
// ============================================================================
|
|
115
|
+
/**
|
|
116
|
+
* Build Stage B enrichment for Tier 2 tool summaries.
|
|
117
|
+
*
|
|
118
|
+
* @param toolName - Name of the tool
|
|
119
|
+
* @param tests - Security test results for this tool
|
|
120
|
+
* @param maxSamples - Maximum evidence samples to include
|
|
121
|
+
* @returns Tool summary Stage B enrichment
|
|
122
|
+
*/
|
|
123
|
+
export function buildToolSummaryStageBEnrichment(toolName, tests, maxSamples = DEFAULT_TIER2_MAX_SAMPLES) {
|
|
124
|
+
// Filter to only tests for this tool
|
|
125
|
+
const toolTests = tests.filter((t) => t.toolName === toolName);
|
|
126
|
+
// Get vulnerable tests for evidence sampling
|
|
127
|
+
const vulnerableTests = toolTests.filter((t) => t.vulnerable);
|
|
128
|
+
// Sample evidence from highest-risk vulnerabilities
|
|
129
|
+
const sortedVulnerable = [...vulnerableTests].sort((a, b) => {
|
|
130
|
+
const riskOrder = { CRITICAL: 0, HIGH: 1, MEDIUM: 2, LOW: 3 };
|
|
131
|
+
return (riskOrder[a.riskLevel] ?? 4) - (riskOrder[b.riskLevel] ?? 4);
|
|
132
|
+
});
|
|
133
|
+
const sampleEvidence = sortedVulnerable
|
|
134
|
+
.slice(0, maxSamples)
|
|
135
|
+
.map(testToEvidence);
|
|
136
|
+
// Calculate confidence breakdown
|
|
137
|
+
const confidenceBreakdown = calculateConfidenceBreakdown(toolTests);
|
|
138
|
+
// Find highest risk correlation
|
|
139
|
+
const highestRiskTest = findHighestRiskTest(toolTests);
|
|
140
|
+
const highestRiskCorrelation = highestRiskTest
|
|
141
|
+
? testToCorrelation(highestRiskTest)
|
|
142
|
+
: undefined;
|
|
143
|
+
// Calculate pattern distribution
|
|
144
|
+
const patternDistribution = calculatePatternDistribution(toolTests);
|
|
145
|
+
// Check for sanitization detection
|
|
146
|
+
const sanitizationDetected = toolTests.some((t) => t.sanitizationDetected);
|
|
147
|
+
// Check auth failure mode
|
|
148
|
+
const authTests = toolTests.filter((t) => t.authFailureMode);
|
|
149
|
+
const authFailureMode = authTests.length > 0 ? authTests[0].authFailureMode : undefined;
|
|
150
|
+
return {
|
|
151
|
+
sampleEvidence,
|
|
152
|
+
confidenceBreakdown,
|
|
153
|
+
highestRiskCorrelation,
|
|
154
|
+
patternDistribution,
|
|
155
|
+
sanitizationDetected: sanitizationDetected || undefined,
|
|
156
|
+
authFailureMode,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
// ============================================================================
|
|
160
|
+
// Tier 3: Tool Detail Enrichment Builder
|
|
161
|
+
// ============================================================================
|
|
162
|
+
/**
|
|
163
|
+
* Build Stage B enrichment for Tier 3 per-tool detail files.
|
|
164
|
+
*
|
|
165
|
+
* @param toolName - Name of the tool
|
|
166
|
+
* @param tests - Security test results for this tool
|
|
167
|
+
* @param annotationResult - Tool annotation result (if available)
|
|
168
|
+
* @param aupViolations - AUP violations for this tool (if any)
|
|
169
|
+
* @param maxCorrelations - Maximum correlations to include
|
|
170
|
+
* @returns Tool detail Stage B enrichment
|
|
171
|
+
*/
|
|
172
|
+
export function buildToolDetailStageBEnrichment(toolName, tests, annotationResult, aupViolations, maxCorrelations = DEFAULT_TIER3_MAX_CORRELATIONS) {
|
|
173
|
+
// Filter to only tests for this tool
|
|
174
|
+
const toolTests = tests.filter((t) => t.toolName === toolName);
|
|
175
|
+
// Build payload correlations (prioritize vulnerable, then errors, then safe)
|
|
176
|
+
const sortedTests = [...toolTests].sort((a, b) => {
|
|
177
|
+
if (a.vulnerable && !b.vulnerable)
|
|
178
|
+
return -1;
|
|
179
|
+
if (!a.vulnerable && b.vulnerable)
|
|
180
|
+
return 1;
|
|
181
|
+
if (a.connectionError && !b.connectionError)
|
|
182
|
+
return -1;
|
|
183
|
+
if (!a.connectionError && b.connectionError)
|
|
184
|
+
return 1;
|
|
185
|
+
return 0;
|
|
186
|
+
});
|
|
187
|
+
const payloadCorrelations = sortedTests
|
|
188
|
+
.slice(0, maxCorrelations)
|
|
189
|
+
.map(testToCorrelation);
|
|
190
|
+
// Pattern distribution
|
|
191
|
+
const patternDistribution = calculatePatternDistribution(toolTests);
|
|
192
|
+
// Build context windows from evidence
|
|
193
|
+
const contextWindows = {};
|
|
194
|
+
for (const test of toolTests.filter((t) => t.vulnerable && t.evidence)) {
|
|
195
|
+
const key = `${test.testName}:${test.payload.slice(0, 30)}`;
|
|
196
|
+
if (!contextWindows[key]) {
|
|
197
|
+
contextWindows[key] = truncate(test.evidence, MAX_CONTEXT_WINDOW);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
// Calculate confidence details
|
|
201
|
+
const confidenceBreakdown = calculateConfidenceBreakdown(toolTests);
|
|
202
|
+
const totalVulnerable = confidenceBreakdown.high +
|
|
203
|
+
confidenceBreakdown.medium +
|
|
204
|
+
confidenceBreakdown.low;
|
|
205
|
+
const overallConfidence = totalVulnerable > 0
|
|
206
|
+
? Math.round(((confidenceBreakdown.high * 100 +
|
|
207
|
+
confidenceBreakdown.medium * 70 +
|
|
208
|
+
confidenceBreakdown.low * 40) /
|
|
209
|
+
totalVulnerable /
|
|
210
|
+
100) *
|
|
211
|
+
100)
|
|
212
|
+
: 100; // 100% confidence if no vulnerabilities
|
|
213
|
+
const confidenceDetails = {
|
|
214
|
+
overall: overallConfidence,
|
|
215
|
+
byCategory: patternDistribution,
|
|
216
|
+
requiresManualReview: toolTests.filter((t) => t.requiresManualReview)
|
|
217
|
+
.length,
|
|
218
|
+
};
|
|
219
|
+
// Security details
|
|
220
|
+
const vulnerableCount = toolTests.filter((t) => t.vulnerable).length;
|
|
221
|
+
const safeCount = toolTests.filter((t) => !t.vulnerable && !t.connectionError).length;
|
|
222
|
+
const errorCount = toolTests.filter((t) => t.connectionError).length;
|
|
223
|
+
// Collect sanitization libraries
|
|
224
|
+
const sanitizationLibraries = [
|
|
225
|
+
...new Set(toolTests.flatMap((t) => t.sanitizationLibraries || []).filter(Boolean)),
|
|
226
|
+
];
|
|
227
|
+
// Auth bypass evidence
|
|
228
|
+
const authBypassTest = toolTests.find((t) => t.authBypassDetected);
|
|
229
|
+
const authBypassEvidence = authBypassTest?.authBypassEvidence;
|
|
230
|
+
const securityDetails = {
|
|
231
|
+
vulnerableCount,
|
|
232
|
+
safeCount,
|
|
233
|
+
errorCount,
|
|
234
|
+
sanitizationLibraries,
|
|
235
|
+
authBypassEvidence,
|
|
236
|
+
};
|
|
237
|
+
// Annotation details
|
|
238
|
+
let annotationDetails;
|
|
239
|
+
if (annotationResult) {
|
|
240
|
+
annotationDetails = {
|
|
241
|
+
hasAnnotations: annotationResult.hasAnnotations,
|
|
242
|
+
alignmentStatus: annotationResult.alignmentStatus,
|
|
243
|
+
inferredBehavior: annotationResult.inferredBehavior
|
|
244
|
+
? {
|
|
245
|
+
expectedReadOnly: annotationResult.inferredBehavior.expectedReadOnly,
|
|
246
|
+
expectedDestructive: annotationResult.inferredBehavior.expectedDestructive,
|
|
247
|
+
reason: annotationResult.inferredBehavior.reason,
|
|
248
|
+
}
|
|
249
|
+
: undefined,
|
|
250
|
+
descriptionPoisoning: annotationResult.descriptionPoisoning
|
|
251
|
+
? {
|
|
252
|
+
detected: annotationResult.descriptionPoisoning.detected,
|
|
253
|
+
patterns: annotationResult.descriptionPoisoning.patterns.map((p) => ({
|
|
254
|
+
name: p.name,
|
|
255
|
+
evidence: truncate(p.evidence, MAX_CONTEXT_WINDOW),
|
|
256
|
+
severity: p.severity,
|
|
257
|
+
})),
|
|
258
|
+
}
|
|
259
|
+
: undefined,
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
// AUP violations for this tool
|
|
263
|
+
const toolAupViolations = aupViolations
|
|
264
|
+
?.filter((v) => v.location?.includes(toolName))
|
|
265
|
+
.map((v) => ({
|
|
266
|
+
pattern: v.pattern,
|
|
267
|
+
matchedText: truncate(v.matchedText, MAX_CONTEXT_WINDOW),
|
|
268
|
+
severity: v.severity,
|
|
269
|
+
location: v.location,
|
|
270
|
+
}));
|
|
271
|
+
return {
|
|
272
|
+
payloadCorrelations,
|
|
273
|
+
patternDistribution,
|
|
274
|
+
contextWindows,
|
|
275
|
+
confidenceDetails,
|
|
276
|
+
securityDetails,
|
|
277
|
+
annotationDetails,
|
|
278
|
+
aupViolations: toolAupViolations && toolAupViolations.length > 0
|
|
279
|
+
? toolAupViolations
|
|
280
|
+
: undefined,
|
|
281
|
+
};
|
|
282
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stage B Enrichment Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for Stage B (Claude semantic analysis) data enrichment.
|
|
5
|
+
* These types extend the tiered output with evidence, correlations, and
|
|
6
|
+
* confidence details for better LLM semantic analysis.
|
|
7
|
+
*
|
|
8
|
+
* Issue #137: Stage A data enrichment for Stage B Claude analysis
|
|
9
|
+
*
|
|
10
|
+
* @module assessment/summarizer/stageBTypes
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Evidence structure for individual findings.
|
|
14
|
+
* Provides raw data and context for Claude to analyze.
|
|
15
|
+
*/
|
|
16
|
+
export interface FindingEvidence {
|
|
17
|
+
/** Actual data that triggered the finding (payload or matched text) */
|
|
18
|
+
raw: string;
|
|
19
|
+
/** Surrounding context for better understanding */
|
|
20
|
+
context: string;
|
|
21
|
+
/** Location in response (e.g., "response.content[0].text", "description") */
|
|
22
|
+
location: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Payload correlation linking input to output.
|
|
26
|
+
* Enables Claude to understand cause-effect relationships.
|
|
27
|
+
*/
|
|
28
|
+
export interface PayloadCorrelation {
|
|
29
|
+
/** The test payload that was sent */
|
|
30
|
+
inputPayload: string;
|
|
31
|
+
/** The response received (may be truncated) */
|
|
32
|
+
outputResponse: string;
|
|
33
|
+
/** Classification of the result */
|
|
34
|
+
classification: "vulnerable" | "safe" | "error" | "timeout";
|
|
35
|
+
/** Patterns that matched this response */
|
|
36
|
+
matchedPatterns: string[];
|
|
37
|
+
/** Tool this correlation belongs to */
|
|
38
|
+
toolName: string;
|
|
39
|
+
/** Test name/pattern that triggered this */
|
|
40
|
+
testName: string;
|
|
41
|
+
/** Confidence level of the detection */
|
|
42
|
+
confidence?: "high" | "medium" | "low";
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Stage B enrichment for Tier 2 tool summaries.
|
|
46
|
+
* Provides sampled evidence for quick Claude analysis.
|
|
47
|
+
*/
|
|
48
|
+
export interface ToolSummaryStageBEnrichment {
|
|
49
|
+
/** Top evidence samples for this tool (limited for token efficiency) */
|
|
50
|
+
sampleEvidence: FindingEvidence[];
|
|
51
|
+
/** Confidence breakdown by pattern type */
|
|
52
|
+
confidenceBreakdown: {
|
|
53
|
+
high: number;
|
|
54
|
+
medium: number;
|
|
55
|
+
low: number;
|
|
56
|
+
};
|
|
57
|
+
/** Highest risk correlation for this tool (if vulnerable) */
|
|
58
|
+
highestRiskCorrelation?: PayloadCorrelation;
|
|
59
|
+
/** Pattern distribution showing which attack types were detected */
|
|
60
|
+
patternDistribution: Record<string, number>;
|
|
61
|
+
/** Whether this tool has sanitization detected */
|
|
62
|
+
sanitizationDetected?: boolean;
|
|
63
|
+
/** Auth bypass mode if detected */
|
|
64
|
+
authFailureMode?: "FAIL_OPEN" | "FAIL_CLOSED" | "UNKNOWN";
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Stage B enrichment for Tier 3 per-tool detail files.
|
|
68
|
+
* Provides comprehensive evidence for deep-dive analysis.
|
|
69
|
+
*/
|
|
70
|
+
export interface ToolDetailStageBEnrichment {
|
|
71
|
+
/** All payload correlations for this tool */
|
|
72
|
+
payloadCorrelations: PayloadCorrelation[];
|
|
73
|
+
/** Full pattern distribution with counts */
|
|
74
|
+
patternDistribution: Record<string, number>;
|
|
75
|
+
/** Context windows for key locations */
|
|
76
|
+
contextWindows: Record<string, string>;
|
|
77
|
+
/** Detailed confidence breakdown */
|
|
78
|
+
confidenceDetails: {
|
|
79
|
+
/** Overall confidence score (0-100) */
|
|
80
|
+
overall: number;
|
|
81
|
+
/** Confidence by attack category */
|
|
82
|
+
byCategory: Record<string, number>;
|
|
83
|
+
/** Number of tests with manual review recommended */
|
|
84
|
+
requiresManualReview: number;
|
|
85
|
+
};
|
|
86
|
+
/** Security-specific details */
|
|
87
|
+
securityDetails: {
|
|
88
|
+
/** Total vulnerabilities found */
|
|
89
|
+
vulnerableCount: number;
|
|
90
|
+
/** Total safe tests */
|
|
91
|
+
safeCount: number;
|
|
92
|
+
/** Tests with connection errors */
|
|
93
|
+
errorCount: number;
|
|
94
|
+
/** Sanitization libraries detected */
|
|
95
|
+
sanitizationLibraries: string[];
|
|
96
|
+
/** Auth bypass evidence if detected */
|
|
97
|
+
authBypassEvidence?: string;
|
|
98
|
+
};
|
|
99
|
+
/** Annotation alignment details (if available) */
|
|
100
|
+
annotationDetails?: {
|
|
101
|
+
/** Whether tool has annotations */
|
|
102
|
+
hasAnnotations: boolean;
|
|
103
|
+
/** Alignment status */
|
|
104
|
+
alignmentStatus?: "ALIGNED" | "MISALIGNED" | "MISSING";
|
|
105
|
+
/** Inferred behavior from patterns */
|
|
106
|
+
inferredBehavior?: {
|
|
107
|
+
expectedReadOnly: boolean;
|
|
108
|
+
expectedDestructive: boolean;
|
|
109
|
+
reason: string;
|
|
110
|
+
};
|
|
111
|
+
/** Description poisoning if detected */
|
|
112
|
+
descriptionPoisoning?: {
|
|
113
|
+
detected: boolean;
|
|
114
|
+
patterns: Array<{
|
|
115
|
+
name: string;
|
|
116
|
+
evidence: string;
|
|
117
|
+
severity: "LOW" | "MEDIUM" | "HIGH";
|
|
118
|
+
}>;
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
/** AUP violations for this tool (if any) */
|
|
122
|
+
aupViolations?: Array<{
|
|
123
|
+
pattern: string;
|
|
124
|
+
matchedText: string;
|
|
125
|
+
severity: string;
|
|
126
|
+
location: string;
|
|
127
|
+
}>;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Combined Stage B enrichment that can be attached to results.
|
|
131
|
+
*/
|
|
132
|
+
export interface StageBEnrichment {
|
|
133
|
+
/** Enrichment version for compatibility tracking */
|
|
134
|
+
version: number;
|
|
135
|
+
/** Whether enrichment was enabled */
|
|
136
|
+
enabled: boolean;
|
|
137
|
+
/** Generation timestamp */
|
|
138
|
+
generatedAt: string;
|
|
139
|
+
/** Tier 2 enrichment (tool summary level) */
|
|
140
|
+
tier2?: ToolSummaryStageBEnrichment;
|
|
141
|
+
/** Tier 3 enrichment (tool detail level) */
|
|
142
|
+
tier3?: ToolDetailStageBEnrichment;
|
|
143
|
+
}
|
|
144
|
+
/** Current Stage B enrichment version */
|
|
145
|
+
export declare const STAGE_B_ENRICHMENT_VERSION = 1;
|
|
146
|
+
/** Default maximum samples for Tier 2 evidence */
|
|
147
|
+
export declare const DEFAULT_TIER2_MAX_SAMPLES = 3;
|
|
148
|
+
/** Default maximum correlations for Tier 3 */
|
|
149
|
+
export declare const DEFAULT_TIER3_MAX_CORRELATIONS = 50;
|
|
150
|
+
/** Maximum response length to include (prevents token explosion) */
|
|
151
|
+
export declare const MAX_RESPONSE_LENGTH = 500;
|
|
152
|
+
/** Maximum context window size (chars before/after) */
|
|
153
|
+
export declare const MAX_CONTEXT_WINDOW = 200;
|
|
154
|
+
//# sourceMappingURL=stageBTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stageBTypes.d.ts","sourceRoot":"","sources":["../../../../src/lib/assessment/summarizer/stageBTypes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,uEAAuE;IACvE,GAAG,EAAE,MAAM,CAAC;IACZ,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB,6EAA6E;IAC7E,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,qCAAqC;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,+CAA+C;IAC/C,cAAc,EAAE,MAAM,CAAC;IACvB,mCAAmC;IACnC,cAAc,EAAE,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;IAC5D,0CAA0C;IAC1C,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,uCAAuC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,CAAC;IACjB,wCAAwC;IACxC,UAAU,CAAC,EAAE,MAAM,GAAG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A8C;AAC9C,eAAO,MAAM,8BAA8B,KAAK,CAAC;AAEjD,oEAAoE;AACpE,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC,uDAAuD;AACvD,eAAO,MAAM,kBAAkB,MAAM,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stage B Enrichment Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for Stage B (Claude semantic analysis) data enrichment.
|
|
5
|
+
* These types extend the tiered output with evidence, correlations, and
|
|
6
|
+
* confidence details for better LLM semantic analysis.
|
|
7
|
+
*
|
|
8
|
+
* Issue #137: Stage A data enrichment for Stage B Claude analysis
|
|
9
|
+
*
|
|
10
|
+
* @module assessment/summarizer/stageBTypes
|
|
11
|
+
*/
|
|
12
|
+
// ============================================================================
|
|
13
|
+
// Constants
|
|
14
|
+
// ============================================================================
|
|
15
|
+
/** Current Stage B enrichment version */
|
|
16
|
+
export const STAGE_B_ENRICHMENT_VERSION = 1;
|
|
17
|
+
/** Default maximum samples for Tier 2 evidence */
|
|
18
|
+
export const DEFAULT_TIER2_MAX_SAMPLES = 3;
|
|
19
|
+
/** Default maximum correlations for Tier 3 */
|
|
20
|
+
export const DEFAULT_TIER3_MAX_CORRELATIONS = 50;
|
|
21
|
+
/** Maximum response length to include (prevents token explosion) */
|
|
22
|
+
export const MAX_RESPONSE_LENGTH = 500;
|
|
23
|
+
/** Maximum context window size (chars before/after) */
|
|
24
|
+
export const MAX_CONTEXT_WINDOW = 200;
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* @module assessment/summarizer/types
|
|
10
10
|
*/
|
|
11
11
|
import type { AssessmentStatus } from "../coreTypes.js";
|
|
12
|
+
import type { ToolSummaryStageBEnrichment } from "./stageBTypes.js";
|
|
12
13
|
/**
|
|
13
14
|
* Output format for assessment results.
|
|
14
15
|
* - "full": Complete JSON output (default, existing behavior)
|
|
@@ -103,6 +104,8 @@ export interface ToolSummary {
|
|
|
103
104
|
hasAnnotations: boolean;
|
|
104
105
|
/** Annotation alignment status if available */
|
|
105
106
|
annotationStatus?: "ALIGNED" | "MISALIGNED" | "MISSING";
|
|
107
|
+
/** Stage B enrichment for Claude semantic analysis (Issue #137) */
|
|
108
|
+
stageBEnrichment?: ToolSummaryStageBEnrichment;
|
|
106
109
|
}
|
|
107
110
|
/**
|
|
108
111
|
* Collection of tool summaries with aggregate metadata.
|
|
@@ -174,6 +177,8 @@ export interface SummarizerConfig {
|
|
|
174
177
|
autoTierThreshold?: number;
|
|
175
178
|
/** Whether to include tool detail files (Tier 3) */
|
|
176
179
|
includeToolDetails?: boolean;
|
|
180
|
+
/** Enable Stage B enrichment for Claude semantic analysis (Issue #137) */
|
|
181
|
+
stageBVerbose?: boolean;
|
|
177
182
|
}
|
|
178
183
|
/**
|
|
179
184
|
* Default summarizer configuration values.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/assessment/summarizer/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/assessment/summarizer/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAMjE;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,cAAc,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;AAM/D;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,kCAAkC;IAClC,UAAU,EAAE,MAAM,CAAC;IAEnB,2DAA2D;IAC3D,aAA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AAE,MAAM,CAAC;QACzB,aAAa,EAAE,MAAM,CAAC;QACtB,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;CACH;AAMD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,wEAAwE;IACxE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B,gEAAgE;IAChE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B,0DAA0D;IAC1D,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,oDAAoD;IACpD,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B,0EAA0E;IAC1E,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,gBAAgB,CAMhE,CAAC"}
|
|
@@ -36,6 +36,7 @@ export declare const INSPECTOR_VERSION: string;
|
|
|
36
36
|
* Version History:
|
|
37
37
|
* - v1: Initial schema
|
|
38
38
|
* - v2: Added TestValidityWarningEvent (Issue #134)
|
|
39
|
+
* - v3: Added Stage B enrichment for Claude semantic analysis (Issue #137)
|
|
39
40
|
*/
|
|
40
|
-
export declare const SCHEMA_VERSION =
|
|
41
|
+
export declare const SCHEMA_VERSION = 3;
|
|
41
42
|
//# sourceMappingURL=moduleScoring.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moduleScoring.d.ts","sourceRoot":"","sources":["../../src/lib/moduleScoring.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAkCnE;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAAsB,CAAC;AAErD
|
|
1
|
+
{"version":3,"file":"moduleScoring.d.ts","sourceRoot":"","sources":["../../src/lib/moduleScoring.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAkCnE;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAAsB,CAAC;AAErD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,IAAI,CAAC"}
|
|
@@ -73,5 +73,6 @@ export const INSPECTOR_VERSION = packageJson.version;
|
|
|
73
73
|
* Version History:
|
|
74
74
|
* - v1: Initial schema
|
|
75
75
|
* - v2: Added TestValidityWarningEvent (Issue #134)
|
|
76
|
+
* - v3: Added Stage B enrichment for Claude semantic analysis (Issue #137)
|
|
76
77
|
*/
|
|
77
|
-
export const SCHEMA_VERSION =
|
|
78
|
+
export const SCHEMA_VERSION = 3;
|
|
@@ -14,6 +14,14 @@ import { BaseAssessor } from "./BaseAssessor.js";
|
|
|
14
14
|
import { AssessmentContext } from "../AssessmentOrchestrator.js";
|
|
15
15
|
import type { ManifestValidationAssessment } from "../../../lib/assessmentTypes.js";
|
|
16
16
|
export declare class ManifestValidationAssessor extends BaseAssessor {
|
|
17
|
+
/**
|
|
18
|
+
* Get mcp_config from manifest (supports both root and nested v0.3 format)
|
|
19
|
+
* Issue #138: Manifest v0.3 places mcp_config under server object
|
|
20
|
+
*
|
|
21
|
+
* @param manifest - The parsed manifest JSON
|
|
22
|
+
* @returns The mcp_config object or undefined if not found in either location
|
|
23
|
+
*/
|
|
24
|
+
private getMcpConfig;
|
|
17
25
|
/**
|
|
18
26
|
* Run manifest validation assessment
|
|
19
27
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManifestValidationAssessor.d.ts","sourceRoot":"","sources":["../../../../src/services/assessment/modules/ManifestValidationAssessor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EACV,4BAA4B,
|
|
1
|
+
{"version":3,"file":"ManifestValidationAssessor.d.ts","sourceRoot":"","sources":["../../../../src/services/assessment/modules/ManifestValidationAssessor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EACV,4BAA4B,EAM7B,MAAM,uBAAuB,CAAC;AAM/B,qBAAa,0BAA2B,SAAQ,YAAY;IAC1D;;;;;;OAMG;IACH,OAAO,CAAC,YAAY;IAcpB;;OAEG;IACG,MAAM,CACV,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,4BAA4B,CAAC;IAqLxC;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAyB9B;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAmB/B;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAgC/B;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAiC7B;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAiChC;;OAEG;IACH,OAAO,CAAC,iBAAiB;IA+CzB;;OAEG;IACH,OAAO,CAAC,YAAY;IAqCpB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IA+B1B;;OAEG;IACH,OAAO,CAAC,qBAAqB;IA8B7B;;OAEG;YACW,yBAAyB;IAqFvC;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAsB/B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IA0C3B;;OAEG;IACH,OAAO,CAAC,uBAAuB;CA+ChC"}
|
|
@@ -15,6 +15,24 @@ const REQUIRED_FIELDS = ["name", "version", "mcp_config"];
|
|
|
15
15
|
const RECOMMENDED_FIELDS = ["description", "author", "repository"];
|
|
16
16
|
const CURRENT_MANIFEST_VERSION = "0.3";
|
|
17
17
|
export class ManifestValidationAssessor extends BaseAssessor {
|
|
18
|
+
/**
|
|
19
|
+
* Get mcp_config from manifest (supports both root and nested v0.3 format)
|
|
20
|
+
* Issue #138: Manifest v0.3 places mcp_config under server object
|
|
21
|
+
*
|
|
22
|
+
* @param manifest - The parsed manifest JSON
|
|
23
|
+
* @returns The mcp_config object or undefined if not found in either location
|
|
24
|
+
*/
|
|
25
|
+
getMcpConfig(manifest) {
|
|
26
|
+
// Check root level first (legacy format)
|
|
27
|
+
if (manifest.mcp_config) {
|
|
28
|
+
return manifest.mcp_config;
|
|
29
|
+
}
|
|
30
|
+
// Check nested under server (v0.3 format)
|
|
31
|
+
if (manifest.server?.mcp_config) {
|
|
32
|
+
return manifest.server.mcp_config;
|
|
33
|
+
}
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
18
36
|
/**
|
|
19
37
|
* Run manifest validation assessment
|
|
20
38
|
*/
|
|
@@ -58,11 +76,35 @@ export class ManifestValidationAssessor extends BaseAssessor {
|
|
|
58
76
|
// Validate required fields
|
|
59
77
|
for (const field of REQUIRED_FIELDS) {
|
|
60
78
|
this.testCount++;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
79
|
+
// Special handling for mcp_config - can be nested under server (Issue #138)
|
|
80
|
+
if (field === "mcp_config") {
|
|
81
|
+
const mcpConfig = this.getMcpConfig(manifest);
|
|
82
|
+
if (!mcpConfig) {
|
|
83
|
+
validationResults.push({
|
|
84
|
+
field: "mcp_config",
|
|
85
|
+
valid: false,
|
|
86
|
+
issue: "Missing required field: mcp_config (checked root and server.mcp_config)",
|
|
87
|
+
severity: "ERROR",
|
|
88
|
+
});
|
|
89
|
+
hasRequiredFields = false;
|
|
90
|
+
missingFields.push(field);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
validationResults.push({
|
|
94
|
+
field: "mcp_config",
|
|
95
|
+
valid: true,
|
|
96
|
+
value: mcpConfig,
|
|
97
|
+
severity: "INFO",
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
const result = this.validateRequiredField(manifest, field);
|
|
103
|
+
validationResults.push(result);
|
|
104
|
+
if (!result.valid) {
|
|
105
|
+
hasRequiredFields = false;
|
|
106
|
+
missingFields.push(field);
|
|
107
|
+
}
|
|
66
108
|
}
|
|
67
109
|
}
|
|
68
110
|
// Validate recommended fields
|
|
@@ -70,10 +112,11 @@ export class ManifestValidationAssessor extends BaseAssessor {
|
|
|
70
112
|
this.testCount++;
|
|
71
113
|
validationResults.push(this.validateRecommendedField(manifest, field));
|
|
72
114
|
}
|
|
73
|
-
// Validate mcp_config structure
|
|
74
|
-
|
|
115
|
+
// Validate mcp_config structure (using helper to support both root and nested paths)
|
|
116
|
+
const mcpConfig = this.getMcpConfig(manifest);
|
|
117
|
+
if (mcpConfig) {
|
|
75
118
|
this.testCount++;
|
|
76
|
-
validationResults.push(this.validateMcpConfig(
|
|
119
|
+
validationResults.push(this.validateMcpConfig(mcpConfig));
|
|
77
120
|
}
|
|
78
121
|
// Check for icon
|
|
79
122
|
this.testCount++;
|
package/client/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bryan-thompson/inspector-assessment-client",
|
|
3
|
-
"version": "1.35.
|
|
3
|
+
"version": "1.35.2",
|
|
4
4
|
"description": "Client-side application for the Enhanced MCP Inspector with assessment capabilities",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Bryan Thompson <bryan@triepod.ai>",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bryan-thompson/inspector-assessment",
|
|
3
|
-
"version": "1.35.
|
|
3
|
+
"version": "1.35.2",
|
|
4
4
|
"description": "Enhanced MCP Inspector with comprehensive assessment capabilities for server validation",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Bryan Thompson <bryan@triepod.ai>",
|