hackmyagent 0.11.14 → 0.11.15
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 +26 -3
- package/dist/cli.js +62 -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/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
[](https://www.npmjs.com/package/hackmyagent)
|
|
5
5
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
6
|
-
[](https://github.com/opena2a-org/hackmyagent)
|
|
7
7
|
|
|
8
|
-
**204 security checks for AI agents. Find what can go wrong before an attacker does.**
|
|
8
|
+
**204 security checks + behavioral simulation for AI agents. Find what can go wrong before an attacker does.**
|
|
9
9
|
|
|
10
|
-
Security scanner
|
|
10
|
+
Security scanner, red-team toolkit, and behavioral simulation engine for Claude Code, Cursor, VS Code, and any MCP server setup. NanoMind-powered semantic analysis runs by default when available.
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
13
|
npx hackmyagent secure
|
|
@@ -33,6 +33,10 @@ npx opena2a-cli review
|
|
|
33
33
|
|
|
34
34
|
## What It Finds
|
|
35
35
|
|
|
36
|
+
**Behavioral simulation** (NEW) -- 20-probe simulation battery that observes what skills actually do, not what they look like. Targets < 1% false positive rate vs industry 95.8%. Run with `--deep`.
|
|
37
|
+
|
|
38
|
+
**Adaptive red team** (NEW) -- `hackmyagent red-team <file>` generates target-specific attack payloads, observes responses, adapts after failures, and maps all defenses. NanoMind-powered.
|
|
39
|
+
|
|
36
40
|
**Attack testing** -- 115 adversarial payloads across 11 categories (prompt injection, data exfiltration, jailbreak, MCP exploitation, supply chain, memory weaponization, A2A protocol attacks, context window attacks).
|
|
37
41
|
|
|
38
42
|
**Static analysis** -- 204 security checks across 60 categories covering credentials, MCP configs, OpenClaw/NemoClaw, Unicode steganography, CVE detection, governance, supply chain, memory poisoning, agent identity, and sandbox escape patterns.
|
|
@@ -136,6 +140,8 @@ hackmyagent secure --ci # Non-interactive mode for CI/CD
|
|
|
136
140
|
```bash
|
|
137
141
|
hackmyagent secure # scan current directory
|
|
138
142
|
hackmyagent secure ./my-project # scan specific directory
|
|
143
|
+
hackmyagent secure --deep # full behavioral simulation (20 probes)
|
|
144
|
+
hackmyagent secure --static-only # static checks only (fast, CI mode)
|
|
139
145
|
hackmyagent secure --fix # auto-fix issues
|
|
140
146
|
hackmyagent secure --fix --dry-run # preview fixes before applying
|
|
141
147
|
hackmyagent secure --ignore CRED-001,GIT-002 # skip specific checks
|
|
@@ -144,6 +150,23 @@ hackmyagent secure --verbose # show all checks including passed
|
|
|
144
150
|
hackmyagent secure --publish # push results to OpenA2A Registry
|
|
145
151
|
```
|
|
146
152
|
|
|
153
|
+
### `hackmyagent red-team` -- Adaptive Attack Engine
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
hackmyagent red-team ./my-skill.md # red-team a skill file
|
|
157
|
+
hackmyagent red-team ./SOUL.md --iterations 10 # more attack iterations
|
|
158
|
+
hackmyagent red-team ./mcp-config.json --json # JSON output
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Generates target-specific attacks from the skill's own language and constraints. Iterates up to 5x per attack category, maps all defenses, and produces specific remediation.
|
|
162
|
+
|
|
163
|
+
### `hackmyagent explain` -- Finding Explanations
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
hackmyagent explain CRED-001 # explain a finding
|
|
167
|
+
hackmyagent explain SKILL-SEMANTIC-007 # explain NanoMind finding
|
|
168
|
+
```
|
|
169
|
+
|
|
147
170
|
|
|
148
171
|
<details>
|
|
149
172
|
<summary>All 35 security categories</summary>
|
package/dist/cli.js
CHANGED
|
@@ -1870,6 +1870,34 @@ Examples:
|
|
|
1870
1870
|
onProgress,
|
|
1871
1871
|
});
|
|
1872
1872
|
const scanDurationMs = Date.now() - scanStartMs;
|
|
1873
|
+
// NanoMind Semantic Compiler: AST-based analysis runs alongside static checks
|
|
1874
|
+
// Defense-in-depth: static findings can NEVER be suppressed, only upgraded
|
|
1875
|
+
if (!isStaticOnly && !options.ci) {
|
|
1876
|
+
try {
|
|
1877
|
+
const { runNanoMindScan } = await Promise.resolve().then(() => __importStar(require('./nanomind-core/scanner-bridge.js')));
|
|
1878
|
+
const existingFindings = result.allFindings || result.findings || [];
|
|
1879
|
+
const nmResult = await runNanoMindScan(targetDir, existingFindings);
|
|
1880
|
+
if (format === 'text' && nmResult.astFindings.length > 0) {
|
|
1881
|
+
const newFindings = nmResult.astFindings.filter(f => !f.passed);
|
|
1882
|
+
if (newFindings.length > 0) {
|
|
1883
|
+
process.stdout.write(`\nNanoMind: ${nmResult.compiledArtifacts} artifact(s) compiled, ${newFindings.length} semantic finding(s) added\n`);
|
|
1884
|
+
}
|
|
1885
|
+
if (nmResult.integrityStatus !== 'CLEAN') {
|
|
1886
|
+
process.stdout.write(` Integrity: ${nmResult.integrityStatus}\n`);
|
|
1887
|
+
}
|
|
1888
|
+
}
|
|
1889
|
+
// Merge: AST findings ADD to static (never remove)
|
|
1890
|
+
if (result.allFindings) {
|
|
1891
|
+
result.allFindings = nmResult.mergedFindings;
|
|
1892
|
+
}
|
|
1893
|
+
if (result.findings) {
|
|
1894
|
+
result.findings = nmResult.mergedFindings.filter((f) => !f.passed);
|
|
1895
|
+
}
|
|
1896
|
+
}
|
|
1897
|
+
catch {
|
|
1898
|
+
// NanoMind unavailable -- static results are still valid
|
|
1899
|
+
}
|
|
1900
|
+
}
|
|
1873
1901
|
// Behavioral simulation: auto-runs on --deep, or when NanoMind detects ambiguity
|
|
1874
1902
|
if (isDeep && format === 'text') {
|
|
1875
1903
|
try {
|
|
@@ -5223,9 +5251,38 @@ program
|
|
|
5223
5251
|
console.log(`\n${trainingCount} training samples exported to NanoMind corpus.`);
|
|
5224
5252
|
}
|
|
5225
5253
|
});
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
|
|
5254
|
+
// Self-securing: verify own integrity before running any command
|
|
5255
|
+
// A security tool that doesn't verify itself is worse than no security tool
|
|
5256
|
+
(async () => {
|
|
5257
|
+
try {
|
|
5258
|
+
const { verifyAll } = await Promise.resolve().then(() => __importStar(require('./nanomind-core/security/integrity-verifier.js')));
|
|
5259
|
+
const integrity = await verifyAll();
|
|
5260
|
+
if (integrity.status === 'QUARANTINE') {
|
|
5261
|
+
// Binary tampered -- refuse to run
|
|
5262
|
+
process.stderr.write('\nINTEGRITY CHECK FAILED: HackMyAgent binary may have been tampered with.\n' +
|
|
5263
|
+
'This could indicate a supply chain attack.\n\n' +
|
|
5264
|
+
'Actions:\n' +
|
|
5265
|
+
' 1. Reinstall: npm install -g hackmyagent\n' +
|
|
5266
|
+
' 2. Verify: npm audit signatures\n' +
|
|
5267
|
+
' 3. Report: https://github.com/opena2a-org/hackmyagent/security\n\n');
|
|
5268
|
+
for (const check of integrity.checks.filter(c => !c.passed)) {
|
|
5269
|
+
process.stderr.write(` Failed: ${check.name} -- ${check.reason}\n`);
|
|
5270
|
+
}
|
|
5271
|
+
process.exit(3); // Exit code 3 = integrity failure
|
|
5272
|
+
}
|
|
5273
|
+
if (integrity.status === 'DEGRADE') {
|
|
5274
|
+
// Model or rules tampered -- warn but continue with fallback
|
|
5275
|
+
process.stderr.write('\nIntegrity warning: some components could not be verified.\n' +
|
|
5276
|
+
'Continuing with baseline analysis (reduced accuracy).\n\n');
|
|
5277
|
+
}
|
|
5278
|
+
}
|
|
5279
|
+
catch {
|
|
5280
|
+
// Integrity check itself failed -- continue (don't block on missing manifest in dev)
|
|
5281
|
+
}
|
|
5282
|
+
if (process.argv.length <= 2) {
|
|
5283
|
+
program.outputHelp();
|
|
5284
|
+
process.exit(0);
|
|
5285
|
+
}
|
|
5286
|
+
program.parse();
|
|
5287
|
+
})();
|
|
5231
5288
|
//# sourceMappingURL=cli.js.map
|