hackmyagent 0.11.14 → 0.12.0
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 +35 -3
- package/dist/.integrity-manifest.json +1 -0
- package/dist/cli.js +79 -5
- package/dist/cli.js.map +1 -1
- package/dist/nanomind-core/analyzers/capability-analyzer.d.ts +40 -0
- package/dist/nanomind-core/analyzers/capability-analyzer.d.ts.map +1 -0
- package/dist/nanomind-core/analyzers/capability-analyzer.js +310 -0
- package/dist/nanomind-core/analyzers/capability-analyzer.js.map +1 -0
- package/dist/nanomind-core/analyzers/code-analyzer.d.ts +21 -0
- package/dist/nanomind-core/analyzers/code-analyzer.d.ts.map +1 -0
- package/dist/nanomind-core/analyzers/code-analyzer.js +350 -0
- package/dist/nanomind-core/analyzers/code-analyzer.js.map +1 -0
- package/dist/nanomind-core/analyzers/credential-analyzer.d.ts +20 -0
- package/dist/nanomind-core/analyzers/credential-analyzer.d.ts.map +1 -0
- package/dist/nanomind-core/analyzers/credential-analyzer.js +317 -0
- package/dist/nanomind-core/analyzers/credential-analyzer.js.map +1 -0
- package/dist/nanomind-core/analyzers/governance-analyzer.d.ts +22 -0
- package/dist/nanomind-core/analyzers/governance-analyzer.d.ts.map +1 -0
- package/dist/nanomind-core/analyzers/governance-analyzer.js +393 -0
- package/dist/nanomind-core/analyzers/governance-analyzer.js.map +1 -0
- package/dist/nanomind-core/analyzers/prompt-analyzer.d.ts +22 -0
- package/dist/nanomind-core/analyzers/prompt-analyzer.d.ts.map +1 -0
- package/dist/nanomind-core/analyzers/prompt-analyzer.js +486 -0
- package/dist/nanomind-core/analyzers/prompt-analyzer.js.map +1 -0
- package/dist/nanomind-core/analyzers/scope-analyzer.d.ts +20 -0
- package/dist/nanomind-core/analyzers/scope-analyzer.d.ts.map +1 -0
- package/dist/nanomind-core/analyzers/scope-analyzer.js +326 -0
- package/dist/nanomind-core/analyzers/scope-analyzer.js.map +1 -0
- package/dist/nanomind-core/compiler/semantic-compiler.d.ts +41 -0
- package/dist/nanomind-core/compiler/semantic-compiler.d.ts.map +1 -0
- package/dist/nanomind-core/compiler/semantic-compiler.js +490 -0
- package/dist/nanomind-core/compiler/semantic-compiler.js.map +1 -0
- package/dist/nanomind-core/index.d.ts +30 -0
- package/dist/nanomind-core/index.d.ts.map +1 -0
- package/dist/nanomind-core/index.js +45 -0
- package/dist/nanomind-core/index.js.map +1 -0
- package/dist/nanomind-core/ingestion/artifact-parser.d.ts +48 -0
- package/dist/nanomind-core/ingestion/artifact-parser.d.ts.map +1 -0
- package/dist/nanomind-core/ingestion/artifact-parser.js +203 -0
- package/dist/nanomind-core/ingestion/artifact-parser.js.map +1 -0
- package/dist/nanomind-core/ingestion/input-sanitizer.d.ts +49 -0
- package/dist/nanomind-core/ingestion/input-sanitizer.d.ts.map +1 -0
- package/dist/nanomind-core/ingestion/input-sanitizer.js +80 -0
- package/dist/nanomind-core/ingestion/input-sanitizer.js.map +1 -0
- package/dist/nanomind-core/scanner-bridge.d.ts +49 -0
- package/dist/nanomind-core/scanner-bridge.d.ts.map +1 -0
- package/dist/nanomind-core/scanner-bridge.js +317 -0
- package/dist/nanomind-core/scanner-bridge.js.map +1 -0
- package/dist/nanomind-core/security/defense-in-depth.d.ts +99 -0
- package/dist/nanomind-core/security/defense-in-depth.d.ts.map +1 -0
- package/dist/nanomind-core/security/defense-in-depth.js +206 -0
- package/dist/nanomind-core/security/defense-in-depth.js.map +1 -0
- package/dist/nanomind-core/security/integrity-verifier.d.ts +132 -0
- package/dist/nanomind-core/security/integrity-verifier.d.ts.map +1 -0
- package/dist/nanomind-core/security/integrity-verifier.js +437 -0
- package/dist/nanomind-core/security/integrity-verifier.js.map +1 -0
- package/dist/nanomind-core/types.d.ts +125 -0
- package/dist/nanomind-core/types.d.ts.map +1 -0
- package/dist/nanomind-core/types.js +22 -0
- package/dist/nanomind-core/types.js.map +1 -0
- package/dist/semantic/index.d.ts +2 -0
- package/dist/semantic/index.d.ts.map +1 -1
- package/dist/semantic/index.js +6 -2
- package/dist/semantic/index.js.map +1 -1
- package/dist/semantic/nanomind-enhancer.d.ts +50 -0
- package/dist/semantic/nanomind-enhancer.d.ts.map +1 -0
- package/dist/semantic/nanomind-enhancer.js +203 -0
- package/dist/semantic/nanomind-enhancer.js.map +1 -0
- package/dist/skills/builder.d.ts +55 -0
- package/dist/skills/builder.d.ts.map +1 -0
- package/dist/skills/builder.js +282 -0
- package/dist/skills/builder.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Scope Analyzer -- AST-based AST-SCOPE-* checks
|
|
4
|
+
*
|
|
5
|
+
* Queries the SecurityAST for MCP tool scope mismatches and A2A exposure.
|
|
6
|
+
* Compares declared capabilities against inferred capabilities to detect
|
|
7
|
+
* wildcard access, undeclared permissions, and scope-purpose mismatches.
|
|
8
|
+
*
|
|
9
|
+
* Checks:
|
|
10
|
+
* AST-SCOPE-001: Wildcard tool access in MCP configurations
|
|
11
|
+
* AST-SCOPE-002: Undeclared tool permissions (inferred but not declared)
|
|
12
|
+
* AST-SCOPE-003: Scope-purpose mismatch (capabilities inconsistent with purpose)
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.analyzeScope = analyzeScope;
|
|
16
|
+
const defense_in_depth_js_1 = require("../security/defense-in-depth.js");
|
|
17
|
+
// ============================================================================
|
|
18
|
+
// Public API
|
|
19
|
+
// ============================================================================
|
|
20
|
+
/**
|
|
21
|
+
* Analyze a SecurityAST for scope and permission issues.
|
|
22
|
+
* Verifies AST integrity before processing.
|
|
23
|
+
*/
|
|
24
|
+
function analyzeScope(ast, verifier) {
|
|
25
|
+
(0, defense_in_depth_js_1.assertASTIntegrity)(ast, verifier);
|
|
26
|
+
const findings = [];
|
|
27
|
+
findings.push(...checkWildcardToolAccess(ast));
|
|
28
|
+
findings.push(...checkUndeclaredPermissions(ast));
|
|
29
|
+
findings.push(...checkScopePurposeMismatch(ast));
|
|
30
|
+
return findings;
|
|
31
|
+
}
|
|
32
|
+
// ============================================================================
|
|
33
|
+
// AST-SCOPE-001: Wildcard tool access
|
|
34
|
+
// ============================================================================
|
|
35
|
+
/**
|
|
36
|
+
* Detects wildcard ("*") tool access in MCP configurations and agent configs.
|
|
37
|
+
* Wildcard access grants the agent unlimited tool permissions, which is
|
|
38
|
+
* the MCP equivalent of running as root.
|
|
39
|
+
*
|
|
40
|
+
* Also detects partial wildcards (e.g., "db.*") that grant broad access
|
|
41
|
+
* within a domain.
|
|
42
|
+
*/
|
|
43
|
+
function checkWildcardToolAccess(ast) {
|
|
44
|
+
const findings = [];
|
|
45
|
+
// Full wildcards: capabilities with "*" in the name
|
|
46
|
+
const fullWildcards = ast.declaredCapabilities.filter(c => c.name.includes('*'));
|
|
47
|
+
for (const cap of fullWildcards) {
|
|
48
|
+
const isFullWildcard = cap.name.endsWith('.*') || cap.name === '*';
|
|
49
|
+
const scope = cap.scope || 'all tools';
|
|
50
|
+
findings.push({
|
|
51
|
+
checkId: 'AST-SCOPE-001',
|
|
52
|
+
name: isFullWildcard ? 'Full Wildcard Tool Access' : 'Partial Wildcard Tool Access',
|
|
53
|
+
description: isFullWildcard
|
|
54
|
+
? `Wildcard capability "${cap.name}" grants unrestricted access to ${scope}. ` +
|
|
55
|
+
'This is the MCP equivalent of running as root. Any tool in the server can be ' +
|
|
56
|
+
'invoked, including dangerous operations like file deletion or code execution.'
|
|
57
|
+
: `Partial wildcard "${cap.name}" grants broad access within ${scope}. ` +
|
|
58
|
+
'While scoped to a domain, this still allows access to every tool in that domain ' +
|
|
59
|
+
'including tools not needed for the declared purpose.',
|
|
60
|
+
category: 'Scope Security',
|
|
61
|
+
severity: isFullWildcard ? 'critical' : 'high',
|
|
62
|
+
passed: false,
|
|
63
|
+
message: `Wildcard access: ${cap.name} (scope: ${scope})`,
|
|
64
|
+
fixable: true,
|
|
65
|
+
file: ast.artifactPath,
|
|
66
|
+
fix: isFullWildcard
|
|
67
|
+
? `Replace wildcard "*" with an explicit allowlist of needed tools. ` +
|
|
68
|
+
`In your MCP config, change "allowedTools": ["*"] to "allowedTools": ["tool1", "tool2"]. ` +
|
|
69
|
+
'Only include tools the agent actually needs.'
|
|
70
|
+
: `Replace partial wildcard "${cap.name}" with specific tool names. ` +
|
|
71
|
+
`List only the ${cap.name.split('.')[0]} tools the agent actually uses.`,
|
|
72
|
+
guidance: 'Principle of least privilege: grant only the minimum permissions needed. ' +
|
|
73
|
+
'Wildcard access means a prompt injection attack can invoke any tool.',
|
|
74
|
+
attackClass: 'SCOPE-WILDCARD',
|
|
75
|
+
confidence: 0.95,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
// Also flag MCP configs where no allowedTools is specified (implicit wildcard)
|
|
79
|
+
if (ast.artifactType === 'mcp_config') {
|
|
80
|
+
const mcpCaps = ast.declaredCapabilities.filter(c => c.name.startsWith('mcp.'));
|
|
81
|
+
// If there are MCP capabilities but none have explicit tool names (all are server-level)
|
|
82
|
+
const hasOnlyServerLevel = mcpCaps.length > 0 && mcpCaps.every(c => {
|
|
83
|
+
const parts = c.name.split('.');
|
|
84
|
+
return parts.length <= 2; // "mcp.servername" without a tool name
|
|
85
|
+
});
|
|
86
|
+
if (hasOnlyServerLevel && fullWildcards.length === 0) {
|
|
87
|
+
// MCP server declared without explicit tool restrictions
|
|
88
|
+
for (const cap of mcpCaps) {
|
|
89
|
+
findings.push({
|
|
90
|
+
checkId: 'AST-SCOPE-001',
|
|
91
|
+
name: 'Implicit Wildcard MCP Access',
|
|
92
|
+
description: `MCP server "${cap.scope}" is configured without an explicit tool allowlist. ` +
|
|
93
|
+
'When no allowedTools is specified, all tools on the server are accessible.',
|
|
94
|
+
category: 'Scope Security',
|
|
95
|
+
severity: 'high',
|
|
96
|
+
passed: false,
|
|
97
|
+
message: `Implicit wildcard: MCP server ${cap.scope}`,
|
|
98
|
+
fixable: true,
|
|
99
|
+
file: ast.artifactPath,
|
|
100
|
+
fix: `Add an "allowedTools" list to the "${cap.scope}" server configuration. ` +
|
|
101
|
+
'Specify only the tools your agent needs.',
|
|
102
|
+
guidance: 'MCP servers can expose dangerous tools (file system, shell execution). ' +
|
|
103
|
+
'Always restrict access to a named allowlist.',
|
|
104
|
+
attackClass: 'SCOPE-WILDCARD',
|
|
105
|
+
confidence: 0.8,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return findings;
|
|
111
|
+
}
|
|
112
|
+
// ============================================================================
|
|
113
|
+
// AST-SCOPE-002: Undeclared tool permissions
|
|
114
|
+
// ============================================================================
|
|
115
|
+
/**
|
|
116
|
+
* Detects capabilities that NanoMind inferred from the artifact content
|
|
117
|
+
* but that were not explicitly declared. Undeclared permissions mean the
|
|
118
|
+
* agent can do more than its manifest claims.
|
|
119
|
+
*
|
|
120
|
+
* This is the scope-specific version of AST-CAP-001 (undeclared capabilities).
|
|
121
|
+
* While CAP-001 flags any undeclared capability, SCOPE-002 focuses on
|
|
122
|
+
* tool permissions and access patterns.
|
|
123
|
+
*/
|
|
124
|
+
function checkUndeclaredPermissions(ast) {
|
|
125
|
+
const findings = [];
|
|
126
|
+
// Build list of declared capability names (normalized)
|
|
127
|
+
const declaredNamesList = ast.declaredCapabilities.map(c => normalizeCapName(c.name));
|
|
128
|
+
// Find inferred capabilities not covered by declarations
|
|
129
|
+
const undeclaredInferred = ast.inferredCapabilities.filter(c => {
|
|
130
|
+
const normalized = normalizeCapName(c.name);
|
|
131
|
+
// Check exact match
|
|
132
|
+
if (declaredNamesList.includes(normalized))
|
|
133
|
+
return false;
|
|
134
|
+
// Check if covered by a broader declared capability (e.g., "db.*" covers "db.read")
|
|
135
|
+
for (const declared of declaredNamesList) {
|
|
136
|
+
if (declared.endsWith('.*') && normalized.startsWith(declared.slice(0, -1))) {
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return true;
|
|
141
|
+
});
|
|
142
|
+
for (const cap of undeclaredInferred) {
|
|
143
|
+
const severity = cap.riskLevel === 'critical'
|
|
144
|
+
? 'critical'
|
|
145
|
+
: cap.riskLevel === 'high'
|
|
146
|
+
? 'high'
|
|
147
|
+
: 'medium';
|
|
148
|
+
findings.push({
|
|
149
|
+
checkId: 'AST-SCOPE-002',
|
|
150
|
+
name: 'Undeclared Tool Permission',
|
|
151
|
+
description: `Tool permission "${cap.name}" (scope: ${cap.scope || 'unscoped'}) was inferred ` +
|
|
152
|
+
'from artifact content but is not declared in the capability manifest. ' +
|
|
153
|
+
'The artifact exercises permissions beyond its declared scope.',
|
|
154
|
+
category: 'Scope Security',
|
|
155
|
+
severity,
|
|
156
|
+
passed: false,
|
|
157
|
+
message: `Undeclared permission: ${cap.name} (${cap.riskLevel}-risk)`,
|
|
158
|
+
fixable: true,
|
|
159
|
+
file: ast.artifactPath,
|
|
160
|
+
fix: `Either declare "${cap.name}" in your capability manifest (if intended) ` +
|
|
161
|
+
'or remove the code/instructions that exercise this permission. ' +
|
|
162
|
+
'If declared, add a governance constraint for this capability.',
|
|
163
|
+
guidance: 'Every tool permission must be explicitly declared. Undeclared permissions are a ' +
|
|
164
|
+
'supply chain risk: users and orchestrators cannot audit what the agent actually does.',
|
|
165
|
+
attackClass: 'SCOPE-UNDECLARED',
|
|
166
|
+
confidence: ast.intentConfidence,
|
|
167
|
+
evidence: cap.evidence,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
return findings;
|
|
171
|
+
}
|
|
172
|
+
// ============================================================================
|
|
173
|
+
// AST-SCOPE-003: Scope-purpose mismatch
|
|
174
|
+
// ============================================================================
|
|
175
|
+
/**
|
|
176
|
+
* Detects capabilities that are inconsistent with the artifact's declared
|
|
177
|
+
* purpose. A "weather lookup" agent with file.delete capabilities is
|
|
178
|
+
* suspicious regardless of whether the capability is declared.
|
|
179
|
+
*
|
|
180
|
+
* Uses semantic comparison between the declared purpose and each capability,
|
|
181
|
+
* considering both declared and inferred capabilities.
|
|
182
|
+
*/
|
|
183
|
+
function checkScopePurposeMismatch(ast) {
|
|
184
|
+
const findings = [];
|
|
185
|
+
const purpose = ast.declaredPurpose.toLowerCase();
|
|
186
|
+
// Skip if purpose is generic / unknown
|
|
187
|
+
if (purpose === 'unknown purpose' ||
|
|
188
|
+
purpose.length < 10 ||
|
|
189
|
+
purpose.includes('does whatever') ||
|
|
190
|
+
purpose.includes('general purpose')) {
|
|
191
|
+
return findings;
|
|
192
|
+
}
|
|
193
|
+
// Extract purpose domain keywords
|
|
194
|
+
const purposeKeywords = extractPurposeKeywords(purpose);
|
|
195
|
+
if (purposeKeywords.size < 2) {
|
|
196
|
+
return findings; // Not enough context to judge mismatch
|
|
197
|
+
}
|
|
198
|
+
// Check all capabilities (declared + inferred) for relevance to purpose
|
|
199
|
+
const allCaps = [...ast.declaredCapabilities, ...ast.inferredCapabilities];
|
|
200
|
+
// Deduplicate by name
|
|
201
|
+
const seen = new Set();
|
|
202
|
+
const uniqueCaps = [];
|
|
203
|
+
for (const cap of allCaps) {
|
|
204
|
+
if (!seen.has(cap.name)) {
|
|
205
|
+
seen.add(cap.name);
|
|
206
|
+
uniqueCaps.push(cap);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
for (const cap of uniqueCaps) {
|
|
210
|
+
// Only flag high/critical risk mismatches
|
|
211
|
+
if (cap.riskLevel !== 'high' && cap.riskLevel !== 'critical') {
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
const capKeywords = extractCapabilityKeywords(cap.name, cap.scope);
|
|
215
|
+
const overlap = setIntersection(purposeKeywords, capKeywords);
|
|
216
|
+
// If zero overlap between purpose and capability keywords, it's a mismatch
|
|
217
|
+
if (overlap.size === 0 && capKeywords.size > 0) {
|
|
218
|
+
findings.push({
|
|
219
|
+
checkId: 'AST-SCOPE-003',
|
|
220
|
+
name: 'Scope-Purpose Mismatch',
|
|
221
|
+
description: `${cap.riskLevel}-risk capability "${cap.name}" (scope: ${cap.scope || 'unscoped'}) ` +
|
|
222
|
+
`does not align with declared purpose: "${truncate(ast.declaredPurpose, 100)}". ` +
|
|
223
|
+
'This could indicate a trojan capability hidden in an otherwise legitimate agent.',
|
|
224
|
+
category: 'Scope Security',
|
|
225
|
+
severity: cap.riskLevel === 'critical' ? 'critical' : 'high',
|
|
226
|
+
passed: false,
|
|
227
|
+
message: `"${cap.name}" does not match purpose "${truncate(ast.declaredPurpose, 50)}"`,
|
|
228
|
+
fixable: true,
|
|
229
|
+
file: ast.artifactPath,
|
|
230
|
+
fix: `Either update the purpose description to explain why "${cap.name}" is needed, ` +
|
|
231
|
+
`or remove this capability if it is not required. ` +
|
|
232
|
+
'A clear purpose statement helps users and scanners trust the agent.',
|
|
233
|
+
guidance: 'Scope-purpose mismatches are a red flag for trojan agents that hide malicious ' +
|
|
234
|
+
'capabilities behind a benign-sounding purpose. Even if the capability is legitimate, ' +
|
|
235
|
+
'the purpose should explain why it is needed.',
|
|
236
|
+
attackClass: 'SEMANTIC-MISMATCH',
|
|
237
|
+
confidence: 0.65,
|
|
238
|
+
evidence: cap.evidence,
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return findings;
|
|
243
|
+
}
|
|
244
|
+
// ============================================================================
|
|
245
|
+
// Helpers
|
|
246
|
+
// ============================================================================
|
|
247
|
+
/**
|
|
248
|
+
* Normalize a capability name for comparison.
|
|
249
|
+
* "MCP.github.issues_list" -> "mcp.github.issues_list"
|
|
250
|
+
*/
|
|
251
|
+
function normalizeCapName(name) {
|
|
252
|
+
return name.toLowerCase().replace(/-/g, '_');
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Extract meaningful keywords from a purpose string.
|
|
256
|
+
* Filters out stop words and short tokens.
|
|
257
|
+
*/
|
|
258
|
+
function extractPurposeKeywords(purpose) {
|
|
259
|
+
const stopWords = new Set([
|
|
260
|
+
'the', 'and', 'for', 'with', 'that', 'this', 'from', 'have', 'will',
|
|
261
|
+
'can', 'not', 'are', 'was', 'been', 'being', 'has', 'had', 'does',
|
|
262
|
+
'did', 'but', 'its', 'they', 'their', 'what', 'which', 'when',
|
|
263
|
+
'where', 'who', 'whom', 'how', 'all', 'each', 'every', 'both',
|
|
264
|
+
'few', 'more', 'most', 'other', 'some', 'such', 'than', 'too',
|
|
265
|
+
'very', 'just', 'about', 'also', 'only', 'then', 'tool', 'agent',
|
|
266
|
+
'help', 'users', 'user',
|
|
267
|
+
]);
|
|
268
|
+
const result = new Set();
|
|
269
|
+
purpose
|
|
270
|
+
.split(/[\s,.;:!?()[\]{}]+/)
|
|
271
|
+
.map(w => w.toLowerCase())
|
|
272
|
+
.filter(w => w.length > 3 && !stopWords.has(w))
|
|
273
|
+
.forEach(w => result.add(w));
|
|
274
|
+
return result;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Extract keywords from a capability name and scope.
|
|
278
|
+
* "db.read" + "customers table" -> {"read", "customers", "table", "database"}
|
|
279
|
+
*/
|
|
280
|
+
function extractCapabilityKeywords(name, scope) {
|
|
281
|
+
const parts = name.split(/[._-]/).filter(p => p.length > 2);
|
|
282
|
+
// Expand abbreviations
|
|
283
|
+
const expansions = {
|
|
284
|
+
db: ['database', 'data'],
|
|
285
|
+
api: ['interface', 'endpoint', 'service'],
|
|
286
|
+
fs: ['file', 'filesystem'],
|
|
287
|
+
mcp: ['tool', 'server'],
|
|
288
|
+
auth: ['authentication', 'credential'],
|
|
289
|
+
exec: ['execute', 'shell'],
|
|
290
|
+
admin: ['administration', 'privilege'],
|
|
291
|
+
};
|
|
292
|
+
const keywords = new Set();
|
|
293
|
+
for (const part of parts) {
|
|
294
|
+
keywords.add(part.toLowerCase());
|
|
295
|
+
const expanded = expansions[part.toLowerCase()];
|
|
296
|
+
if (expanded) {
|
|
297
|
+
for (const e of expanded) {
|
|
298
|
+
keywords.add(e);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
// Add scope words
|
|
303
|
+
if (scope) {
|
|
304
|
+
for (const word of scope.split(/[\s,.]+/)) {
|
|
305
|
+
if (word.length > 2) {
|
|
306
|
+
keywords.add(word.toLowerCase());
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
return keywords;
|
|
311
|
+
}
|
|
312
|
+
function setIntersection(a, b) {
|
|
313
|
+
const result = new Set();
|
|
314
|
+
a.forEach(item => {
|
|
315
|
+
if (b.has(item)) {
|
|
316
|
+
result.add(item);
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
return result;
|
|
320
|
+
}
|
|
321
|
+
function truncate(text, maxLen) {
|
|
322
|
+
if (text.length <= maxLen)
|
|
323
|
+
return text;
|
|
324
|
+
return text.slice(0, maxLen - 3) + '...';
|
|
325
|
+
}
|
|
326
|
+
//# sourceMappingURL=scope-analyzer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope-analyzer.js","sourceRoot":"","sources":["../../../src/nanomind-core/analyzers/scope-analyzer.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;AAcH,oCAaC;AAvBD,yEAAqE;AAErE,+EAA+E;AAC/E,aAAa;AACb,+EAA+E;AAE/E;;;GAGG;AACH,SAAgB,YAAY,CAC1B,GAAgB,EAChB,QAAuC;IAEvC,IAAA,wCAAkB,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAElC,MAAM,QAAQ,GAAiB,EAAE,CAAC;IAElC,QAAQ,CAAC,IAAI,CAAC,GAAG,uBAAuB,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/C,QAAQ,CAAC,IAAI,CAAC,GAAG,0BAA0B,CAAC,GAAG,CAAC,CAAC,CAAC;IAClD,QAAQ,CAAC,IAAI,CAAC,GAAG,yBAAyB,CAAC,GAAG,CAAC,CAAC,CAAC;IAEjD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,+EAA+E;AAC/E,sCAAsC;AACtC,+EAA+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AC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY,EAAE,MAAc;IAC5C,IAAI,IAAI,CAAC,MAAM,IAAI,MAAM;QAAE,OAAO,IAAI,CAAC;IACvC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NanoMind Semantic Compiler
|
|
3
|
+
*
|
|
4
|
+
* The core of the architecture. Compiles raw artifacts into Abstract Security Trees.
|
|
5
|
+
* ALL scanners consume the AST -- no scanner reads raw text directly.
|
|
6
|
+
*
|
|
7
|
+
* Pipeline:
|
|
8
|
+
* 1. Parse artifact (validate, classify, hash)
|
|
9
|
+
* 2. Sanitize for NanoMind (strip manipulation attempts)
|
|
10
|
+
* 3. Extract declared capabilities and constraints
|
|
11
|
+
* 4. Run NanoMind inference for intent + inferred capabilities
|
|
12
|
+
* 5. Map risk surfaces
|
|
13
|
+
* 6. Extract evidence spans
|
|
14
|
+
* 7. Sign the AST
|
|
15
|
+
* 8. Return CompilationResult
|
|
16
|
+
*
|
|
17
|
+
* Security:
|
|
18
|
+
* - Input sanitized before NanoMind processes it
|
|
19
|
+
* - AST signed with Ed25519 for integrity
|
|
20
|
+
* - Model version embedded for reproducibility
|
|
21
|
+
* - Content-addressed caching via SHA-256 hash
|
|
22
|
+
*/
|
|
23
|
+
import type { SecurityAST, CompilationResult, CompilerConfig } from '../types.js';
|
|
24
|
+
export declare class SemanticCompiler {
|
|
25
|
+
private config;
|
|
26
|
+
private cache;
|
|
27
|
+
constructor(config?: Partial<CompilerConfig>);
|
|
28
|
+
/**
|
|
29
|
+
* Compile an artifact into a SecurityAST.
|
|
30
|
+
* This is the main entry point for the entire NanoMind pipeline.
|
|
31
|
+
*/
|
|
32
|
+
compile(content: string, path?: string): Promise<CompilationResult>;
|
|
33
|
+
/**
|
|
34
|
+
* Verify an AST's cryptographic signature.
|
|
35
|
+
* Analyzers MUST call this before processing an AST.
|
|
36
|
+
*/
|
|
37
|
+
verifyAST(ast: SecurityAST): boolean;
|
|
38
|
+
private runNanoMindInference;
|
|
39
|
+
private signAST;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=semantic-compiler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semantic-compiler.d.ts","sourceRoot":"","sources":["../../../src/nanomind-core/compiler/semantic-compiler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,OAAO,KAAK,EACV,WAAW,EACX,iBAAiB,EACjB,cAAc,EASf,MAAM,aAAa,CAAC;AAErB,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAiB;IAC/B,OAAO,CAAC,KAAK,CAAkC;gBAEnC,MAAM,GAAE,OAAO,CAAC,cAAc,CAAM;IAUhD;;;OAGG;IACG,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IA0GzE;;;OAGG;IACH,SAAS,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO;YAStB,oBAAoB;IA+ClC,OAAO,CAAC,OAAO;CAchB"}
|