hackmyagent 0.1.1 → 0.1.3
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 +251 -0
- package/package.json +4 -3
package/README.md
ADDED
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
# HackMyAgent
|
|
2
|
+
|
|
3
|
+
> **AI Agent Security Scanner** — Detect exposed MCP servers, leaked API keys, and vulnerable Claude Code configurations. Free, no signup required.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/hackmyagent)
|
|
6
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
7
|
+
|
|
8
|
+
**Website:** [hackmyagent.com](https://hackmyagent.com) — Scan external infrastructure for exposed MCP endpoints, configs, and credentials
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npx hackmyagent check @publisher/skill # verify a skill before installing
|
|
12
|
+
npx hackmyagent secure # harden your agent setup (100 checks)
|
|
13
|
+
npx hackmyagent secure --fix # auto-fix security issues
|
|
14
|
+
npx hackmyagent scan example.com # scan for exposed infrastructure
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Two Ways to Scan
|
|
18
|
+
|
|
19
|
+
| Tool | Use Case |
|
|
20
|
+
|------|----------|
|
|
21
|
+
| **[hackmyagent.com](https://hackmyagent.com)** | Scan external targets — check if your MCP servers, configs, or credentials are exposed on the internet |
|
|
22
|
+
| **`npx hackmyagent secure`** | Scan local projects — harden your agent setup before deploying |
|
|
23
|
+
|
|
24
|
+
## Why HackMyAgent?
|
|
25
|
+
|
|
26
|
+
AI agents are powerful but introduce new attack surfaces. Skills can be malicious. Configs can leak secrets. MCP servers can be exposed. HackMyAgent helps you:
|
|
27
|
+
|
|
28
|
+
- **Check** skills before installing (publisher verification, permission analysis)
|
|
29
|
+
- **Secure** your agent setup (100-point CIS-style security scan, auto-remediation)
|
|
30
|
+
- **Scan** external infrastructure (exposed MCP endpoints, leaked configs)
|
|
31
|
+
|
|
32
|
+
## Installation
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# Use directly with npx (no install needed)
|
|
36
|
+
npx hackmyagent secure
|
|
37
|
+
|
|
38
|
+
# Or install globally
|
|
39
|
+
npm install -g hackmyagent
|
|
40
|
+
|
|
41
|
+
# Or add to your project
|
|
42
|
+
npm install --save-dev hackmyagent
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Commands
|
|
46
|
+
|
|
47
|
+
### `hackmyagent secure`
|
|
48
|
+
|
|
49
|
+
Scan and harden your local agent setup with 100 security checks across 24 categories.
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Basic scan
|
|
53
|
+
hackmyagent secure
|
|
54
|
+
|
|
55
|
+
# Scan specific directory
|
|
56
|
+
hackmyagent secure ./my-project
|
|
57
|
+
|
|
58
|
+
# Auto-fix issues
|
|
59
|
+
hackmyagent secure --fix
|
|
60
|
+
|
|
61
|
+
# Preview fixes without applying
|
|
62
|
+
hackmyagent secure --fix --dry-run
|
|
63
|
+
|
|
64
|
+
# Skip specific checks
|
|
65
|
+
hackmyagent secure --ignore CRED-001,GIT-002
|
|
66
|
+
|
|
67
|
+
# JSON output for CI/CD
|
|
68
|
+
hackmyagent secure --json
|
|
69
|
+
|
|
70
|
+
# Show all checks (including passed)
|
|
71
|
+
hackmyagent secure --verbose
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Security Categories:**
|
|
75
|
+
|
|
76
|
+
| Category | Checks | Description |
|
|
77
|
+
|----------|--------|-------------|
|
|
78
|
+
| CRED | 4 | Credential exposure detection |
|
|
79
|
+
| MCP | 12 | MCP server configuration |
|
|
80
|
+
| CLAUDE | 8 | Claude Code security |
|
|
81
|
+
| NET | 6 | Network security |
|
|
82
|
+
| PROMPT | 4 | Prompt injection defenses |
|
|
83
|
+
| INJ | 4 | Input validation (XSS, SQL, cmd) |
|
|
84
|
+
| ENCRYPT | 4 | Encryption at rest |
|
|
85
|
+
| SESSION | 4 | Session management |
|
|
86
|
+
| AUDIT | 4 | Audit trails |
|
|
87
|
+
| SANDBOX | 4 | Process isolation |
|
|
88
|
+
| TOOL | 4 | Tool permission boundaries |
|
|
89
|
+
| And 13 more... | 42 | Auth, deps, env, git, io, log, perm, proc, rate, sec, api, vscode, cursor |
|
|
90
|
+
|
|
91
|
+
**Exit Codes:**
|
|
92
|
+
- `0` - No critical/high issues
|
|
93
|
+
- `1` - Critical or high severity issues found
|
|
94
|
+
|
|
95
|
+
### `hackmyagent check`
|
|
96
|
+
|
|
97
|
+
Verify a skill's safety before installing.
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
hackmyagent check @publisher/skill-name
|
|
101
|
+
hackmyagent check @anthropic/claude-mcp --verbose
|
|
102
|
+
hackmyagent check @publisher/skill --json
|
|
103
|
+
hackmyagent check @publisher/skill --offline # skip DNS verification
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**Checks performed:**
|
|
107
|
+
- Publisher identity via DNS TXT records
|
|
108
|
+
- Permissions requested (filesystem, network, shell access)
|
|
109
|
+
- Revocation status against global blocklist
|
|
110
|
+
|
|
111
|
+
**Risk Levels:** `low`, `medium`, `high`, `critical`
|
|
112
|
+
|
|
113
|
+
### `hackmyagent scan`
|
|
114
|
+
|
|
115
|
+
Scan external infrastructure for exposed AI agent endpoints.
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
hackmyagent scan example.com
|
|
119
|
+
hackmyagent scan 192.168.1.100 -p 3000,8080
|
|
120
|
+
hackmyagent scan example.com --verbose
|
|
121
|
+
hackmyagent scan example.com --json
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**Detects:**
|
|
125
|
+
- Exposed MCP SSE/tools endpoints
|
|
126
|
+
- Public configuration files
|
|
127
|
+
- API keys in responses
|
|
128
|
+
- Debug/admin interfaces
|
|
129
|
+
|
|
130
|
+
**Scoring:** A (90-100), B (80-89), C (70-79), D (60-69), F (<60)
|
|
131
|
+
|
|
132
|
+
### `hackmyagent rollback`
|
|
133
|
+
|
|
134
|
+
Undo auto-fix changes.
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
hackmyagent rollback # rollback current directory
|
|
138
|
+
hackmyagent rollback ./my-project # rollback specific directory
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Backups are automatically created in `.hackmyagent-backup/` with timestamps.
|
|
142
|
+
|
|
143
|
+
## CI/CD Integration
|
|
144
|
+
|
|
145
|
+
### GitHub Actions
|
|
146
|
+
|
|
147
|
+
```yaml
|
|
148
|
+
name: Security Scan
|
|
149
|
+
on: [push, pull_request]
|
|
150
|
+
|
|
151
|
+
jobs:
|
|
152
|
+
security:
|
|
153
|
+
runs-on: ubuntu-latest
|
|
154
|
+
steps:
|
|
155
|
+
- uses: actions/checkout@v4
|
|
156
|
+
- uses: actions/setup-node@v4
|
|
157
|
+
with:
|
|
158
|
+
node-version: '20'
|
|
159
|
+
- run: npx hackmyagent secure --json > security-report.json
|
|
160
|
+
- uses: actions/upload-artifact@v4
|
|
161
|
+
with:
|
|
162
|
+
name: security-report
|
|
163
|
+
path: security-report.json
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Pre-commit Hook
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
# .git/hooks/pre-commit
|
|
170
|
+
#!/bin/sh
|
|
171
|
+
npx hackmyagent secure --ignore LOG-001,RATE-001
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### JSON Output
|
|
175
|
+
|
|
176
|
+
All commands support `--json` for machine-readable output:
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
hackmyagent secure --json | jq '.findings[] | select(.severity == "critical")'
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## Supported Platforms
|
|
183
|
+
|
|
184
|
+
- **Claude Code** - CLAUDE.md, skills, MCP servers
|
|
185
|
+
- **Cursor** - .cursor/ rules, MCP configurations
|
|
186
|
+
- **VSCode** - .vscode/mcp.json configurations
|
|
187
|
+
- **Generic MCP** - Any MCP server setup
|
|
188
|
+
|
|
189
|
+
## Security Check Reference
|
|
190
|
+
|
|
191
|
+
For the complete list of 100 security checks with descriptions and remediation guidance, see [SECURITY_CHECKS.md](docs/SECURITY_CHECKS.md).
|
|
192
|
+
|
|
193
|
+
## Auto-Fix Capabilities
|
|
194
|
+
|
|
195
|
+
The following issues can be automatically fixed with `--fix`:
|
|
196
|
+
|
|
197
|
+
| Check ID | Issue | Auto-Fix Action |
|
|
198
|
+
|----------|-------|-----------------|
|
|
199
|
+
| CRED-001 | Exposed API keys | Replace with env var reference |
|
|
200
|
+
| GIT-001 | Missing .gitignore | Create with secure defaults |
|
|
201
|
+
| GIT-002 | Incomplete .gitignore | Add missing patterns |
|
|
202
|
+
| PERM-001 | Overly permissive files | Set restrictive permissions |
|
|
203
|
+
| MCP-001 | Root filesystem access | Scope to project directory |
|
|
204
|
+
| NET-001 | Bound to 0.0.0.0 | Bind to 127.0.0.1 |
|
|
205
|
+
|
|
206
|
+
Always use `--dry-run` first to preview changes.
|
|
207
|
+
|
|
208
|
+
## Environment Variables
|
|
209
|
+
|
|
210
|
+
| Variable | Description |
|
|
211
|
+
|----------|-------------|
|
|
212
|
+
| `NO_COLOR` | Disable colored output |
|
|
213
|
+
| `HACKMYAGENT_TIMEOUT` | Default timeout for scans (ms) |
|
|
214
|
+
|
|
215
|
+
## Test Fixtures
|
|
216
|
+
|
|
217
|
+
Sample projects with intentional security issues for testing:
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
# Test the scanner against example projects
|
|
221
|
+
npx hackmyagent secure test-fixtures/insecure-api # Score: 27/100
|
|
222
|
+
npx hackmyagent secure test-fixtures/insecure-mcp # Score: 0/100
|
|
223
|
+
npx hackmyagent secure test-fixtures/insecure-library # Score: 60/100
|
|
224
|
+
npx hackmyagent secure test-fixtures/clean-project # Score: 100/100
|
|
225
|
+
|
|
226
|
+
# Test auto-fix
|
|
227
|
+
npx hackmyagent secure test-fixtures/insecure-api --fix
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
See [test-fixtures/README.md](test-fixtures/README.md) for details.
|
|
231
|
+
|
|
232
|
+
## Contributing
|
|
233
|
+
|
|
234
|
+
Contributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
# Development setup
|
|
238
|
+
git clone https://github.com/ecolibria/hackmyagent.git
|
|
239
|
+
cd hackmyagent
|
|
240
|
+
npm install
|
|
241
|
+
npm run build
|
|
242
|
+
npm test
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## License
|
|
246
|
+
|
|
247
|
+
Apache-2.0
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
**Need enterprise features?** Check out [AIM (Agent Identity Management)](https://github.com/opena2a-org/agent-identity-management) for centralized policy management, compliance, and audit trails.
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hackmyagent",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Security toolkit for AI agents - verify skills, harden setups, scan for exposures",
|
|
5
5
|
"bin": {
|
|
6
6
|
"hackmyagent": "dist/index.js"
|
|
7
7
|
},
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"files": [
|
|
10
|
-
"dist"
|
|
10
|
+
"dist",
|
|
11
|
+
"README.md"
|
|
11
12
|
],
|
|
12
13
|
"scripts": {
|
|
13
14
|
"build": "tsc",
|
|
@@ -16,7 +17,7 @@
|
|
|
16
17
|
},
|
|
17
18
|
"dependencies": {
|
|
18
19
|
"commander": "^12.0.0",
|
|
19
|
-
"hackmyagent-core": "^0.1.
|
|
20
|
+
"hackmyagent-core": "^0.1.3"
|
|
20
21
|
},
|
|
21
22
|
"devDependencies": {
|
|
22
23
|
"typescript": "^5.3.3"
|