hackmyagent 0.9.8 → 0.10.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 CHANGED
@@ -1,4 +1,4 @@
1
- > **[OpenA2A](https://github.com/opena2a-org)**: [CLI](https://github.com/opena2a-org/opena2a) · [Secretless](https://github.com/opena2a-org/secretless-ai) · [AIM](https://github.com/opena2a-org/agent-identity-management) · [Browser Guard](https://github.com/opena2a-org/AI-BrowserGuard) · [DVAA](https://github.com/opena2a-org/damn-vulnerable-ai-agent) · [Registry](https://registry.opena2a.org)
1
+ > **[OpenA2A](https://github.com/opena2a-org/opena2a)**: [CLI](https://github.com/opena2a-org/opena2a) · [Secretless](https://github.com/opena2a-org/secretless-ai) · [AIM](https://github.com/opena2a-org/agent-identity-management) · [Browser Guard](https://github.com/opena2a-org/AI-BrowserGuard) · [DVAA](https://github.com/opena2a-org/damn-vulnerable-ai-agent) · Registry (coming soon)
2
2
 
3
3
  # HackMyAgent
4
4
 
@@ -6,54 +6,66 @@
6
6
  [![License: Apache-2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
7
7
  [![Tests](https://img.shields.io/badge/tests-765%20passing-brightgreen)](https://github.com/opena2a-org/hackmyagent)
8
8
 
9
- **Find it. Break it. Fix it.**
9
+ **AI agents run code with your permissions. Find what can go wrong before an attacker does.**
10
10
 
11
- AI agents execute arbitrary code with your permissions. HackMyAgent finds what can go wrong before an attacker does.
11
+ Security scanner and red-team toolkit for AI agents 147 checks, 55 adversarial payloads, auto-fix with rollback, runtime protection, and OASB compliance benchmarking.
12
12
 
13
- Security scanner and red-team toolkit for AI agents. 147 security checks across 30 categories, 55 adversarial attack payloads, auto-fix with rollback, and OASB-1 compliance benchmarking -- all in a single package.
13
+ Works with Claude Code, Cursor, VS Code, and any MCP server setup.
14
14
 
15
- Scans Claude Code, Cursor, VS Code, and any MCP server setup.
16
-
17
- [Website](https://hackmyagent.com) | [Security Checks Reference](docs/SECURITY_CHECKS.md) | [OpenA2A CLI](https://github.com/opena2a-org/opena2a)
15
+ [Website](https://hackmyagent.com) | [Security Checks Reference](docs/SECURITY_CHECKS.md) | [Demos](https://opena2a.org/demos) | [OpenA2A CLI](https://github.com/opena2a-org/opena2a)
18
16
 
19
17
  ---
20
18
 
21
- ## Quick Start
19
+ ## Get Started in 30 Seconds
20
+
21
+ > **The recommended way to use HackMyAgent is through [`opena2a-cli`](https://github.com/opena2a-org/opena2a)** — the unified CLI for all OpenA2A security tools. It runs HackMyAgent under the hood along with credential scanning, config integrity, and more.
22
22
 
23
23
  ```bash
24
- npx hackmyagent secure # 147-check security scan
25
- npx hackmyagent secure --fix # auto-fix issues (backups created automatically)
26
- npx hackmyagent attack --local # red-team with 55 adversarial payloads
27
- npx hackmyagent secure -b oasb-1 # OASB-1 compliance benchmark
24
+ # Recommended: full security review via opena2a-cli
25
+ npx opena2a-cli review
26
+
27
+ # Or use HackMyAgent directly
28
+ npx hackmyagent secure
28
29
  ```
29
30
 
30
- No config files. No setup. Works out of the box on any AI agent project.
31
+ That's it. No config files, no setup, no flags needed.
31
32
 
32
- ---
33
+ ### What happens when you run it?
33
34
 
34
- ## What It Scans
35
+ 1. **Scans** your project for 147 security issues across 30 categories
36
+ 2. **Shows** a prioritized list of findings with severity and fix guidance
37
+ 3. **Fixes** issues automatically when you add `--fix` (backups created)
35
38
 
36
- | Platform | What HackMyAgent detects |
37
- |----------|--------------------------|
38
- | **Claude Code** | CLAUDE.md misconfigurations, skill permissions, MCP server exposure |
39
- | **Cursor** | .cursor/ rules, MCP server configs, overly permissive settings |
40
- | **VS Code** | .vscode/mcp.json configurations, extension risks |
41
- | **Any MCP setup** | Transport security, tool boundaries, auth weaknesses |
39
+ ```
40
+ ┌──────────────────────────────────────────────────┐
41
+ │ HackMyAgent v0.10.0 Security Scanner │
42
+ │ Found: 3 critical · 5 high · 12 medium │
43
+ │ │
44
+ │ CRED-001 critical Hardcoded API key in .env │
45
+ │ MCP-003 high MCP server on 0.0.0.0 │
46
+ │ NET-001 high Open port exposed │
47
+ │ ... │
48
+ │ │
49
+ │ Run with --fix to auto-remediate 8 issues │
50
+ └──────────────────────────────────────────────────┘
51
+ ```
42
52
 
43
- All platforms are scanned automatically — no flags needed.
53
+ ![HackMyAgent Demo](docs/hackmyagent-demo.gif)
54
+
55
+ > See all demos at [opena2a.org/demos](https://opena2a.org/demos)
44
56
 
45
57
  ---
46
58
 
47
59
  ## Installation
48
60
 
49
61
  ```bash
50
- # Run directly (no install)
62
+ # Run without installing (recommended to start)
51
63
  npx hackmyagent secure
52
64
 
53
65
  # Install globally
54
66
  npm install -g hackmyagent
55
67
 
56
- # Add to devDependencies
68
+ # Add to your project
57
69
  npm install --save-dev hackmyagent
58
70
  ```
59
71
 
@@ -61,11 +73,32 @@ npm install --save-dev hackmyagent
61
73
 
62
74
  ---
63
75
 
76
+ ## Using with opena2a-cli (Recommended)
77
+
78
+ [`opena2a-cli`](https://github.com/opena2a-org/opena2a) is the main CLI that unifies all OpenA2A security tools. HackMyAgent powers the scanning and benchmarking commands:
79
+
80
+ | opena2a-cli command | What it runs | Description |
81
+ |---------------------|-------------|-------------|
82
+ | `opena2a review` | HackMyAgent + all tools | Full security dashboard (HTML) |
83
+ | `opena2a init` | HackMyAgent | Security posture assessment with trust score |
84
+ | `opena2a protect` | HackMyAgent + Secretless | Auto-fix findings + credential protection |
85
+ | `opena2a scan` | HackMyAgent | 147-check security scan |
86
+ | `opena2a benchmark` | HackMyAgent | OASB-1 + OASB-2 compliance |
87
+ | `opena2a scan-soul` | HackMyAgent | Behavioral governance (SOUL.md) |
88
+ | `opena2a shield init` | All tools | Full security setup in one command |
89
+
90
+ ```bash
91
+ npm install -g opena2a-cli
92
+ opena2a review # best place to start
93
+ ```
94
+
95
+ ---
96
+
64
97
  ## Commands
65
98
 
66
- ### `hackmyagent secure`
99
+ ### `hackmyagent secure` — Security Scan
67
100
 
68
- Run 147 security checks across 30 categories. The primary command most users need.
101
+ The primary command. Runs 147 checks across 30 categories.
69
102
 
70
103
  ```bash
71
104
  hackmyagent secure # scan current directory
@@ -137,9 +170,9 @@ Use `--dry-run` to preview changes. Backups are created in `.hackmyagent-backup/
137
170
 
138
171
  ---
139
172
 
140
- ### `hackmyagent attack`
173
+ ### `hackmyagent attack` — Red Team
141
174
 
142
- Red-team your AI agent with 55 adversarial payloads across 5 attack categories.
175
+ Test your AI agent with 55 adversarial payloads across 5 attack categories.
143
176
 
144
177
  ```bash
145
178
  hackmyagent attack --local # local simulation
@@ -194,7 +227,7 @@ Only `id` and `payload` are required.
194
227
 
195
228
  ---
196
229
 
197
- ### `hackmyagent secure -b oasb-1`
230
+ ### `hackmyagent secure -b oasb-1` — OASB-1 Benchmark
198
231
 
199
232
  Run the [OASB-1](https://oasb.ai/oasb-1) (Open Agent Security Benchmark) — 46 controls across 10 categories with three maturity levels.
200
233
 
@@ -233,9 +266,9 @@ Output formats: `text`, `json`, `sarif`, `html`, `asp` (Agent Security Profile).
233
266
 
234
267
  ---
235
268
 
236
- ### `hackmyagent secure -b oasb-2`
269
+ ### `hackmyagent secure -b oasb-2` — OASB-2 Composite
237
270
 
238
- Run OASB-2 composite assessment: infrastructure security (OASB-1, 50%) combined with behavioral governance (scan-soul, 50%) for a unified score.
271
+ Infrastructure security (OASB-1, 50%) + behavioral governance (scan-soul, 50%) = unified score.
239
272
 
240
273
  ```bash
241
274
  hackmyagent secure -b oasb-2 # full composite assessment
@@ -243,27 +276,22 @@ hackmyagent secure -b oasb-2 --json # JSON output
243
276
  hackmyagent secure -b oasb-2 --fail-below 60 # CI gate
244
277
  ```
245
278
 
246
- Output shows infrastructure score, governance score, composite score, and conformance level. Requires a SOUL.md (or equivalent governance file) in the scanned directory.
279
+ Requires a SOUL.md (or equivalent governance file) in the scanned directory.
247
280
 
248
281
  ---
249
282
 
250
- ### `hackmyagent scan-soul`
283
+ ### `hackmyagent scan-soul` — Behavioral Governance
251
284
 
252
- Scan a SOUL.md (or equivalent governance file) against OASB v2 behavioral governance controls. Checks 8 domains and up to 68 controls depending on agent tier.
285
+ Scan a SOUL.md against OASB v2 behavioral governance controls 8 domains, up to 68 controls.
253
286
 
254
287
  ```bash
255
288
  hackmyagent scan-soul # scan current directory
256
- hackmyagent scan-soul ./my-agent # scan specific directory
257
289
  hackmyagent scan-soul --tier MULTI-AGENT # override tier detection
258
- hackmyagent scan-soul --json # JSON output for CI
259
- hackmyagent scan-soul --verbose # show individual control results
260
290
  hackmyagent scan-soul --deep # LLM semantic analysis (requires ANTHROPIC_API_KEY)
261
- hackmyagent scan-soul --fail-below 60 # exit 1 if score below threshold
291
+ hackmyagent scan-soul --fail-below 60 # CI gate
262
292
  ```
263
293
 
264
- Auto-detects governance file in priority order: `SOUL.md` > `system-prompt.md` > `CLAUDE.md` > `.cursorrules` > `agent-config.yaml` and others.
265
-
266
- Tier-to-control counts:
294
+ Auto-detects governance file: `SOUL.md` > `system-prompt.md` > `CLAUDE.md` > `.cursorrules` > `agent-config.yaml`.
267
295
 
268
296
  | Tier | Controls | Use case |
269
297
  |------|----------|----------|
@@ -272,117 +300,146 @@ Tier-to-control counts:
272
300
  | `AGENTIC` | 65 | Autonomous multi-step agents |
273
301
  | `MULTI-AGENT` | 68 | Orchestrators and sub-agent systems |
274
302
 
275
- Conformance levels:
276
-
277
- | Level | Criteria |
278
- |-------|----------|
279
- | `none` | A critical control (SOUL-IH-003 or SOUL-HB-001) is missing — grade capped at C |
280
- | `essential` | All critical controls pass |
281
- | `standard` | All critical + high controls pass, score ≥ 60 |
282
- | `hardened` | All controls pass, score ≥ 75 |
283
-
284
303
  ---
285
304
 
286
- ### `hackmyagent harden-soul`
305
+ ### `hackmyagent harden-soul` — Generate Governance
287
306
 
288
- Generate a SOUL.md, or add missing governance sections to an existing one. Existing content is always preserved.
307
+ Generate a SOUL.md or add missing governance sections. Existing content is preserved.
289
308
 
290
309
  ```bash
291
310
  hackmyagent harden-soul # add missing sections
292
311
  hackmyagent harden-soul --dry-run # preview without writing
293
- hackmyagent harden-soul ./my-agent # target specific directory
294
- hackmyagent harden-soul --json # JSON output
295
312
  ```
296
313
 
297
- Generates template content for each missing OASB v2 governance domain. Run `scan-soul` after to verify coverage improved.
298
-
299
314
  ---
300
315
 
301
- ### `hackmyagent fix-all`
316
+ ### `hackmyagent fix-all` — Fix Everything
302
317
 
303
- Run all security plugins in sequence: credential vault, file signing, skill guard. Applies fixes and generates a report.
318
+ Run all security plugins in sequence: credential vault, file signing, skill guard.
304
319
 
305
320
  ```bash
306
321
  hackmyagent fix-all # scan and fix
307
- hackmyagent fix-all ./my-agent # target specific directory
308
322
  hackmyagent fix-all --dry-run # preview without modifying
309
- hackmyagent fix-all --scan-only # scan only, no fixes
310
323
  hackmyagent fix-all --with-aim # add agent identity + audit logging
311
324
  hackmyagent fix-all --json # JSON output
312
325
  ```
313
326
 
314
- **Plugins run in order:**
315
-
316
327
  | Plugin | What it does |
317
328
  |--------|--------------|
318
- | **SkillGuard** | Hash pinning, tamper detection, dangerous pattern scanning (reverse shells, exfiltration, prompt injection) |
319
- | **SignCrypt** | Ed25519 signing of SKILL.md and HEARTBEAT.md, SHA-256 hash pinning, signature verification |
320
- | **CredVault** | Credential detection (10 patterns), env var replacement, AES-256-GCM encrypted store |
329
+ | **SkillGuard** | Hash pinning, tamper detection, dangerous pattern scanning |
330
+ | **SignCrypt** | Ed25519 signing, SHA-256 hash pinning, signature verification |
331
+ | **CredVault** | Credential detection, env var replacement, AES-256-GCM encrypted store |
321
332
 
322
- **`--with-aim` adds:** Ed25519 agent identity, cryptographic audit log, capability policy enforcement, 8-factor trust scoring.
333
+ `--with-aim` adds: Ed25519 agent identity, cryptographic audit log, capability policy enforcement.
323
334
 
324
335
  ---
325
336
 
326
- ### `hackmyagent check`
337
+ ### More Commands
327
338
 
328
- Verify a skill's publisher identity and permissions before installing it.
339
+ | Command | Description |
340
+ |---------|-------------|
341
+ | `hackmyagent check @publisher/skill` | Verify a skill's publisher identity and permissions |
342
+ | `hackmyagent scan example.com` | Scan external infrastructure for exposed AI endpoints |
343
+ | `hackmyagent rollback` | Undo auto-fix changes (backups created automatically) |
344
+ | `hackmyagent secure-openclaw` | 47 specialized checks for OpenClaw installations |
329
345
 
330
- ```bash
331
- hackmyagent check @publisher/skill-name
332
- hackmyagent check @publisher/skill --json
333
- hackmyagent check @publisher/skill --offline # skip DNS verification
334
- ```
346
+ ---
335
347
 
336
- Checks: publisher identity (DNS TXT), permissions requested, revocation status.
348
+ ## Runtime Protection (ARP)
337
349
 
338
- ---
350
+ ARP (Agent Runtime Protection) monitors AI agents during execution with a 3-layer intelligence stack:
339
351
 
340
- ### `hackmyagent scan`
352
+ - **L0**: Rule-based pattern matching (40+ threat patterns, every event, free)
353
+ - **L1**: Statistical anomaly detection (z-score deviation from baseline, free)
354
+ - **L2**: LLM-assisted assessment (micro-prompts, budget-controlled, ~$0.01/day)
341
355
 
342
- Scan external infrastructure for exposed AI agent endpoints.
356
+ ### Monitor Mode
357
+
358
+ Watches OS-level activity: child processes, network connections, and filesystem changes.
343
359
 
344
360
  ```bash
345
- hackmyagent scan example.com
346
- hackmyagent scan 192.168.1.100 -p 3000,8080
347
- hackmyagent scan example.com --json
361
+ # Generate config for your project
362
+ opena2a runtime init
363
+
364
+ # Start monitoring
365
+ opena2a runtime start
366
+
367
+ # Check status and view events
368
+ opena2a runtime status
369
+ opena2a runtime tail --count 20
348
370
  ```
349
371
 
350
- Detects: exposed MCP SSE/tools endpoints, public configs, API keys in responses, debug interfaces.
372
+ ### Proxy Mode
351
373
 
352
- Scoring: A (90-100), B (80-89), C (70-79), D (60-69), F (<60).
374
+ HTTP reverse proxy that inspects AI protocol traffic in real-time:
353
375
 
354
- > Only scan systems you own or have written authorization to test.
376
+ ```bash
377
+ npx hackmyagent arp-guard proxy --config arp.yaml
378
+ ```
355
379
 
356
- ---
380
+ Detects 40+ attack patterns across three protocols:
357
381
 
358
- ### `hackmyagent rollback`
382
+ | Protocol | Detections |
383
+ |----------|------------|
384
+ | **OpenAI API** | Prompt injection (PI-001-003), jailbreak (JB-001-003), data exfiltration (DE-001-003), output leaks (OL-001-003), context manipulation (CM-001-002) |
385
+ | **MCP (JSON-RPC)** | Path traversal (MCP-001), command injection (MCP-002), SSRF (MCP-003), tool allowlist enforcement |
386
+ | **A2A** | Identity spoofing (A2A-001), delegation abuse (A2A-002), trusted agent allowlist, embedded prompt injection |
359
387
 
360
- Undo auto-fix changes. Backups are created automatically by `secure --fix` and `fix-all`.
388
+ ### Configuration (arp.yaml)
361
389
 
362
- ```bash
363
- hackmyagent rollback # rollback current directory
364
- hackmyagent rollback ./my-project # rollback specific directory
390
+ ```yaml
391
+ agentName: my-agent
392
+ monitors:
393
+ process: { enabled: true, intervalMs: 5000 }
394
+ network: { enabled: true, intervalMs: 10000, allowedHosts: [localhost] }
395
+ filesystem: { enabled: true }
396
+ aiLayer:
397
+ prompt: true
398
+ mcp-protocol: true
399
+ a2a-protocol: true
400
+ proxy:
401
+ port: 8080
402
+ blockOnDetection: false
403
+ upstreams:
404
+ - pathPrefix: /v1
405
+ target: http://localhost:3000
406
+ protocol: openai-api
365
407
  ```
366
408
 
367
- ---
409
+ ### Programmatic API
368
410
 
369
- ### `hackmyagent secure-openclaw`
411
+ ```typescript
412
+ import { AgentRuntimeProtection } from 'hackmyagent/arp';
370
413
 
371
- 47 specialized checks for OpenClaw/Moltbot installations.
414
+ const arp = new AgentRuntimeProtection('arp.yaml');
415
+ await arp.start();
372
416
 
373
- ```bash
374
- hackmyagent secure-openclaw # scan default location
375
- hackmyagent secure-openclaw ~/.moltbot # specific directory
376
- hackmyagent secure-openclaw --fix # auto-fix gateway configs
377
- hackmyagent secure-openclaw --fix --dry-run # preview fixes
417
+ arp.onEvent((event) => console.log(event.severity, event.description));
418
+ arp.onEnforcement((result) => console.log(result.action, result.event));
419
+
420
+ // When done
421
+ await arp.stop();
378
422
  ```
379
423
 
380
- Detects: CVE-2026-25253, ClawHavoc IOCs, reverse shells, credential exfiltration, gateway misconfigs, disabled sandbox.
424
+ ---
425
+
426
+ ## What It Scans
427
+
428
+ | Platform | What HackMyAgent detects |
429
+ |----------|--------------------------|
430
+ | **Claude Code** | CLAUDE.md misconfigurations, skill permissions, MCP server exposure |
431
+ | **Cursor** | .cursor/ rules, MCP server configs, overly permissive settings |
432
+ | **VS Code** | .vscode/mcp.json configurations, extension risks |
433
+ | **Any MCP setup** | Transport security, tool boundaries, auth weaknesses |
434
+
435
+ All platforms are scanned automatically — no flags needed.
381
436
 
382
437
  ---
383
438
 
384
439
  ## CI/CD Integration
385
440
 
441
+ All commands support `--json` and `--ci` flags.
442
+
386
443
  ### GitHub Actions
387
444
 
388
445
  ```yaml
@@ -417,16 +474,6 @@ jobs:
417
474
  npx hackmyagent secure --ignore LOG-001,RATE-001
418
475
  ```
419
476
 
420
- ### JSON Output
421
-
422
- ```bash
423
- # Filter critical findings
424
- hackmyagent secure --json | jq '.findings[] | select(.severity == "critical")'
425
-
426
- # Count issues by category
427
- hackmyagent secure --json | jq '[.findings[].id | split("-")[0]] | group_by(.) | map({(.[0]): length}) | add'
428
- ```
429
-
430
477
  ---
431
478
 
432
479
  ## Exit Codes
@@ -439,80 +486,17 @@ hackmyagent secure --json | jq '[.findings[].id | split("-")[0]] | group_by(.) |
439
486
 
440
487
  ---
441
488
 
442
- ## What's Included
443
-
444
- HackMyAgent consolidates several OpenA2A security modules into a single package:
445
-
446
- | Module | Description | Previously |
447
- |--------|-------------|------------|
448
- | Security scanner | 147 checks across 30 categories | hackmyagent-core |
449
- | Attack simulation | 55 adversarial payloads, 5 categories | standalone |
450
- | CredVault plugin | Credential detection + AES-256-GCM vault | @opena2a/credvault |
451
- | SignCrypt plugin | Ed25519 signing + SHA-256 hash pinning | @opena2a/signcrypt |
452
- | SkillGuard plugin | Permission pinning + tamper detection | @opena2a/skillguard |
453
- | OASB benchmark | 46 controls, 3 maturity levels | @opena2a/oasb |
454
- | ARP integration | Agent Runtime Protection hooks | @opena2a/arp |
455
- | Semantic engine | Semantic analysis for finding deduplication | @opena2a/semantic-engine |
456
-
457
- ### Subpath Exports
458
-
459
- For programmatic use, the package exposes subpath exports:
489
+ ## Programmatic API
460
490
 
461
491
  ```typescript
462
492
  import { HardeningScanner } from 'hackmyagent'; // Scanner engine
463
493
  import { registerPlugin } from 'hackmyagent/plugins'; // Plugin API
464
494
  import { SemanticEngine } from 'hackmyagent/semantic'; // Semantic analysis
465
- import { ARPMonitor } from 'hackmyagent/arp'; // Runtime protection
495
+ import { AgentRuntimeProtection } from 'hackmyagent/arp'; // Runtime protection
466
496
  import { OASBHarness } from 'hackmyagent/oasb'; // Benchmark harness
467
497
  ```
468
498
 
469
- ---
470
-
471
- ## Writing Plugins
472
-
473
- HackMyAgent supports custom security plugins. Each plugin implements `scan()` and `fix()` methods.
474
-
475
- ```typescript
476
- import type { OpenA2APlugin, Finding, Remediation, FixOptions } from 'hackmyagent/plugins';
477
-
478
- export class MyPlugin implements OpenA2APlugin {
479
- readonly metadata = {
480
- packageName: '@my-org/my-plugin',
481
- displayName: 'My Plugin',
482
- description: 'Detects and fixes X',
483
- version: '1.0.0',
484
- findings: ['MY-001'],
485
- scoreImprovement: 10,
486
- };
487
-
488
- async scan(agentDir: string): Promise<Finding[]> {
489
- return [{
490
- id: 'MY-001',
491
- title: 'Insecure widget',
492
- description: 'Widget uses plaintext.',
493
- severity: 'high',
494
- filePath: 'config.json',
495
- line: 12,
496
- autoFixable: true,
497
- }];
498
- }
499
-
500
- async fix(agentDir: string, options?: FixOptions): Promise<Remediation[]> {
501
- if (options?.dryRun) return [{ findingId: 'MY-001', description: 'Would encrypt widget', filesModified: ['config.json'], rollbackAvailable: false }];
502
- return [{ findingId: 'MY-001', description: 'Encrypted widget', filesModified: ['config.json'], rollbackAvailable: false }];
503
- }
504
- }
505
- ```
506
-
507
- See the [full plugin API documentation](docs/PLUGIN_API.md) for details.
508
-
509
- ---
510
-
511
- ## Environment Variables
512
-
513
- | Variable | Description |
514
- |----------|-------------|
515
- | `NO_COLOR` | Disable colored output |
499
+ See the [Plugin API documentation](docs/PLUGIN_API.md) for writing custom security plugins.
516
500
 
517
501
  ---
518
502
 
@@ -525,7 +509,7 @@ git clone https://github.com/opena2a-org/hackmyagent.git
525
509
  cd hackmyagent
526
510
  npm install
527
511
  npm run build
528
- npm test # 765 tests
512
+ npm test # 817 tests
529
513
  ```
530
514
 
531
515
  ---
@@ -540,8 +524,8 @@ Apache-2.0
540
524
 
541
525
  | Project | Description | Install |
542
526
  |---------|-------------|---------|
543
- | [**OpenA2A CLI**](https://github.com/opena2a-org/opena2a) | Unified security CLI -- scan, protect, guard, runtime, shield | `npx opena2a` |
527
+ | [**OpenA2A CLI**](https://github.com/opena2a-org/opena2a) | Unified security CLI scan, protect, guard, shield | `npm install -g opena2a-cli` |
544
528
  | [**Secretless AI**](https://github.com/opena2a-org/secretless-ai) | Keep credentials out of AI context windows | `npx secretless-ai init` |
545
- | [**AIM**](https://github.com/opena2a-org/agent-identity-management) | Agent Identity Management -- identity and access control for AI agents | Self-hosted |
529
+ | [**AIM**](https://github.com/opena2a-org/agent-identity-management) | Agent identity and access control for AI agents | Self-hosted |
546
530
  | [**AI Browser Guard**](https://github.com/opena2a-org/AI-BrowserGuard) | Detect and control AI agents in the browser | Chrome Web Store |
547
- | [**DVAA**](https://github.com/opena2a-org/damn-vulnerable-ai-agent) | Damn Vulnerable AI Agent -- security training target | `docker pull opena2a/dvaa` |
531
+ | [**DVAA**](https://github.com/opena2a-org/damn-vulnerable-ai-agent) | Deliberately vulnerable AI agent for training | `docker pull opena2a/dvaa` |
@@ -10,7 +10,7 @@ const promptInjection = [
10
10
  id: 'PI-001',
11
11
  category: 'prompt-injection',
12
12
  description: 'Instruction override attempt — direct override of system instructions',
13
- pattern: /(?:ignore|disregard|forget|override|bypass)\s+(?:all\s+)?(?:your\s+|the\s+|my\s+)?(?:previous|prior|above|earlier|system|original)\s+(?:instructions?|prompts?|rules?|directives?|guidelines?|constraints?)/i,
13
+ pattern: /(?:ignore|disregard|forget|override|bypass)\s+(?:all\s+)?(?:your\s+|the\s+|my\s+)?(?:previous\s+|prior\s+|above\s+|earlier\s+|system\s+|original\s+)?(?:instructions?|prompts?|rules?|directives?|guidelines?|constraints?)/i,
14
14
  severity: 'critical',
15
15
  },
16
16
  {
@@ -34,7 +34,7 @@ const jailbreak = [
34
34
  id: 'JB-001',
35
35
  category: 'jailbreak',
36
36
  description: 'DAN mode — "Do Anything Now" jailbreak attempt',
37
- pattern: /\b(?:DAN|D\.A\.N|do\s+anything\s+now)\b.*(?:mode|persona|act|pretend|enable|activate|jailbr[eo]ak)/i,
37
+ pattern: /(?:\b(?:DAN|D\.A\.N|do\s+anything\s+now)\b.*(?:mode|persona|act|pretend|enable|activate|jailbr[eo]ak)|(?:act|pretend|behave|roleplay|play)\s+(?:as|like)\s+(?:a\s+)?(?:DAN|D\.A\.N)\b|do\s+anything\s+now)/i,
38
38
  severity: 'critical',
39
39
  },
40
40
  {
@@ -65,7 +65,7 @@ const dataExfiltration = [
65
65
  id: 'DE-002',
66
66
  category: 'data-exfiltration',
67
67
  description: 'Credential extraction — attempting to extract secrets or API keys',
68
- pattern: /(?:(?:what|show|reveal|give|tell|display|print|dump|list)\s+(?:me\s+)?(?:are\s+)?(?:your\s+|the\s+)?(?:api\s+keys?|secrets?|credentials?|passwords?|tokens?|auth(?:entication)?|(?:private|secret)\s+keys?|(?:access|bearer)\s+tokens?|environment\s+variables?|env\s+vars?|\.env))/i,
68
+ pattern: /(?:(?:what|show|reveal|give|tell|display|print|dump|list|output|extract|expose|leak)\s+(?:me\s+)?(?:are\s+)?(?:your\s+|the\s+|any\s+)?(?:api\s+keys?|secrets?|credentials?|passwords?|tokens?|auth(?:entication)?|(?:private|secret)\s+keys?|(?:access|bearer)\s+tokens?|environment\s+variables?|env\s+vars?|\.env))/i,
69
69
  severity: 'critical',
70
70
  },
71
71
  {
@@ -1 +1 @@
1
- {"version":3,"file":"ai-threats.js","sourceRoot":"","sources":["../../../src/ar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B,OAAO,IAAI,MAAM;YAIH,aAAa;IAsD3B,OAAO,CAAC,YAAY;IAQpB;;;OAGG;YACW,cAAc;IA8B5B;;OAEG;YACW,eAAe;IA+B7B,OAAO,CAAC,oBAAoB;IAqB5B,OAAO,CAAC,qBAAqB;IAsB7B,OAAO,CAAC,iBAAiB;IAsBzB,OAAO,CAAC,kBAAkB;IA8B1B,OAAO,CAAC,kBAAkB;IAmB1B,OAAO,CAAC,iBAAiB;CAgD1B"}
@@ -316,11 +316,30 @@ class ARPProxy {
316
316
  else if (typeof parsed.params?.content === 'string') {
317
317
  content = parsed.params.content;
318
318
  }
319
- if (content) {
320
- const result = this.deps.a2aInterceptor.scanMessage(from, to, content);
321
- return result.detected;
319
+ else if (typeof parsed.message === 'string') {
320
+ content = parsed.message;
322
321
  }
323
- return false;
322
+ else if (parsed.payload) {
323
+ // Common A2A formats: { payload: { task: "..." } } or { payload: "..." }
324
+ if (typeof parsed.payload === 'string') {
325
+ content = parsed.payload;
326
+ }
327
+ else if (typeof parsed.payload.task === 'string') {
328
+ content = parsed.payload.task;
329
+ }
330
+ else if (typeof parsed.payload.content === 'string') {
331
+ content = parsed.payload.content;
332
+ }
333
+ else if (typeof parsed.payload.message === 'string') {
334
+ content = parsed.payload.message;
335
+ }
336
+ }
337
+ else if (typeof parsed.task === 'string') {
338
+ content = parsed.task;
339
+ }
340
+ // Always scan if we have content or a sender identity to check
341
+ const result = this.deps.a2aInterceptor.scanMessage(from, to, content || bodyStr);
342
+ return result.detected;
324
343
  }
325
344
  catch {
326
345
  return false;