@agent-wall/cli 0.1.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/.turbo/turbo-build.log +18 -0
- package/.turbo/turbo-test.log +19 -0
- package/LICENSE +21 -0
- package/README.md +79 -0
- package/dist/dashboard/assets/index-BOAuOkd7.css +1 -0
- package/dist/dashboard/assets/index-_Zwjwdf_.js +50 -0
- package/dist/dashboard/assets/index-_Zwjwdf_.js.map +1 -0
- package/dist/dashboard/favicon.svg +5 -0
- package/dist/dashboard/index.html +14 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1074 -0
- package/dist/index.js.map +1 -0
- package/package.json +57 -0
- package/src/commands/audit.test.ts +175 -0
- package/src/commands/audit.ts +158 -0
- package/src/commands/doctor.test.ts +108 -0
- package/src/commands/doctor.ts +146 -0
- package/src/commands/init.test.ts +85 -0
- package/src/commands/init.ts +52 -0
- package/src/commands/scan.test.ts +279 -0
- package/src/commands/scan.ts +338 -0
- package/src/commands/test.test.ts +152 -0
- package/src/commands/test.ts +108 -0
- package/src/commands/validate.test.ts +104 -0
- package/src/commands/validate.ts +181 -0
- package/src/commands/wrap.ts +420 -0
- package/src/index.ts +151 -0
- package/tsconfig.json +8 -0
- package/tsup.config.ts +12 -0
- package/vitest.config.ts +8 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
> @agent-wall/cli@0.1.0 build /home/runner/work/agent-wall/agent-wall/packages/cli
|
|
3
|
+
> tsup && node -e "const fs=require('fs'),p=require('path');const s=p.resolve(__dirname,'../dashboard/dist');const d=p.resolve(__dirname,'dist/dashboard');if(fs.existsSync(s)){fs.cpSync(s,d,{recursive:true});console.log('✓ Dashboard assets bundled')}else{console.log('⚠ Dashboard not built, skipping asset bundle')}"
|
|
4
|
+
|
|
5
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
6
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
+
[34mCLI[39m tsup v8.5.1
|
|
8
|
+
[34mCLI[39m Using tsup config: /home/runner/work/agent-wall/agent-wall/packages/cli/tsup.config.ts
|
|
9
|
+
[34mCLI[39m Target: es2022
|
|
10
|
+
[34mCLI[39m Cleaning output folder
|
|
11
|
+
[34mESM[39m Build start
|
|
12
|
+
[32mESM[39m [1mdist/index.js [22m[32m41.63 KB[39m
|
|
13
|
+
[32mESM[39m [1mdist/index.js.map [22m[32m75.55 KB[39m
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 62ms
|
|
15
|
+
[34mDTS[39m Build start
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 1926ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m13.00 B[39m
|
|
18
|
+
✓ Dashboard assets bundled
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
> @agent-wall/cli@0.1.0 test /home/runner/work/agent-wall/agent-wall/packages/cli
|
|
3
|
+
> vitest run --passWithNoTests
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
[1m[46m RUN [49m[22m [36mv3.2.4 [39m[90m/home/runner/work/agent-wall/agent-wall/packages/cli[39m
|
|
7
|
+
|
|
8
|
+
[32m✓[39m src/commands/test.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 22[2mms[22m[39m
|
|
9
|
+
[32m✓[39m src/commands/scan.test.ts [2m([22m[2m15 tests[22m[2m)[22m[32m 27[2mms[22m[39m
|
|
10
|
+
[32m✓[39m src/commands/audit.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m 51[2mms[22m[39m
|
|
11
|
+
[32m✓[39m src/commands/validate.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 11[2mms[22m[39m
|
|
12
|
+
[32m✓[39m src/commands/doctor.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 17[2mms[22m[39m
|
|
13
|
+
[32m✓[39m src/commands/init.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 16[2mms[22m[39m
|
|
14
|
+
|
|
15
|
+
[2m Test Files [22m [1m[32m6 passed[39m[22m[90m (6)[39m
|
|
16
|
+
[2m Tests [22m [1m[32m51 passed[39m[22m[90m (51)[39m
|
|
17
|
+
[2m Start at [22m 10:39:44
|
|
18
|
+
[2m Duration [22m 1.06s[2m (transform 389ms, setup 0ms, collect 885ms, tests 143ms, environment 2ms, prepare 815ms)[22m
|
|
19
|
+
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026-present Agent Wall Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Agent Wall
|
|
2
|
+
|
|
3
|
+
**Security firewall for AI agents.** Intercepts MCP tool calls, enforces policies, blocks attacks.
|
|
4
|
+
|
|
5
|
+
> *"Cloudflare for AI agents"* — Zero-config protection for any MCP server.
|
|
6
|
+
|
|
7
|
+
[](https://github.com/agent-wall/agent-wall/actions/workflows/ci.yml)
|
|
8
|
+
[](https://github.com/agent-wall/agent-wall/blob/main/LICENSE)
|
|
9
|
+
[](https://www.npmjs.com/package/agent-wall)
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install -g @agent-wall/cli
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Generate a starter policy
|
|
21
|
+
agent-wall init
|
|
22
|
+
|
|
23
|
+
# Wrap any MCP server
|
|
24
|
+
agent-wall wrap -- npx @modelcontextprotocol/server-filesystem /home/user
|
|
25
|
+
|
|
26
|
+
# With real-time dashboard
|
|
27
|
+
agent-wall wrap --dashboard -- npx mcp-server
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## 30-Second Integration
|
|
31
|
+
|
|
32
|
+
Replace your MCP config entry:
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"mcpServers": {
|
|
37
|
+
"filesystem": {
|
|
38
|
+
"command": "agent-wall",
|
|
39
|
+
"args": ["wrap", "--", "npx", "@modelcontextprotocol/server-filesystem", "/home/user"]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Works with **Claude Code**, **Cursor**, **Claude Desktop**, **VS Code**, **Windsurf**, and any MCP client.
|
|
46
|
+
|
|
47
|
+
## Defense-in-Depth Pipeline
|
|
48
|
+
|
|
49
|
+
Every tool call runs through a **5-step inbound pipeline**:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
1. Kill Switch — Emergency deny-all
|
|
53
|
+
2. Injection — 30+ prompt injection patterns
|
|
54
|
+
3. Egress Control — Block SSRF, private IPs, metadata endpoints
|
|
55
|
+
4. Policy Engine — YAML rules (first-match-wins, glob, rate limiting)
|
|
56
|
+
5. Chain Detection — Suspicious multi-step patterns
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Plus an **outbound response scanner** — 14 secret patterns, 5 PII patterns, custom regex.
|
|
60
|
+
|
|
61
|
+
## CLI Commands
|
|
62
|
+
|
|
63
|
+
| Command | Description |
|
|
64
|
+
|---------|-------------|
|
|
65
|
+
| `agent-wall wrap` | Wrap an MCP server with policy enforcement |
|
|
66
|
+
| `agent-wall init` | Generate a starter config |
|
|
67
|
+
| `agent-wall test` | Dry-run a tool call against your policy |
|
|
68
|
+
| `agent-wall audit` | View and analyze audit logs |
|
|
69
|
+
| `agent-wall scan` | Scan MCP config for security risks |
|
|
70
|
+
| `agent-wall validate` | Validate policy configuration |
|
|
71
|
+
| `agent-wall doctor` | Health check for config and environment |
|
|
72
|
+
|
|
73
|
+
## Documentation
|
|
74
|
+
|
|
75
|
+
Full docs: [agent-wall.github.io/agent-wall](https://agent-wall.github.io/agent-wall/)
|
|
76
|
+
|
|
77
|
+
## License
|
|
78
|
+
|
|
79
|
+
[MIT](https://github.com/agent-wall/agent-wall/blob/main/LICENSE)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--bg-primary: #0d1117;--bg-secondary: #161b22;--bg-tertiary: #21262d;--border: #30363d;--text-primary: #e6edf3;--text-secondary: #8b949e;--text-muted: #484f58;--green: #3fb950;--green-dim: #1a4731;--red: #f85149;--red-dim: #5a1e1e;--yellow: #d29922;--yellow-dim: #4b3a12;--orange: #db6d28;--blue: #58a6ff;--font-mono: "SF Mono", "Cascadia Code", "Consolas", monospace;--font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;--radius: 6px}*{margin:0;padding:0;box-sizing:border-box}html,body,#root{height:100%;background:var(--bg-primary);color:var(--text-primary);font-family:var(--font-sans);font-size:14px;line-height:1.5}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}.card{background:var(--bg-secondary);border:1px solid var(--border);border-radius:var(--radius);padding:14px}.badge{display:inline-block;padding:1px 7px;border-radius:10px;font-size:10px;font-weight:700;font-family:var(--font-mono);text-transform:uppercase;letter-spacing:.5px;white-space:nowrap}.badge-allow{background:var(--green-dim);color:var(--green)}.badge-deny{background:var(--red-dim);color:var(--red)}.badge-prompt{background:var(--yellow-dim);color:var(--yellow)}.badge-info{background:var(--bg-tertiary);color:var(--text-secondary)}.severity-dot{display:inline-block;width:7px;height:7px;border-radius:50%;flex-shrink:0}.severity-info{background:var(--blue)}.severity-warn{background:var(--orange)}.severity-critical{background:var(--red);animation:pulse 1.5s infinite}@keyframes pulse{0%,to{opacity:1}50%{opacity:.3}}@keyframes slideIn{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes glowPulse{0%,to{box-shadow:none}50%{box-shadow:0 0 12px #f851494d}}table{width:100%;border-collapse:collapse;font-family:var(--font-mono);font-size:12px}th{text-align:left;padding:7px 10px;border-bottom:1px solid var(--border);color:var(--text-secondary);font-weight:500;cursor:pointer;-webkit-user-select:none;user-select:none;font-size:11px}th:hover{color:var(--text-primary)}td{padding:5px 10px;border-bottom:1px solid var(--bg-tertiary)}.cell-mono{font-family:var(--font-mono);color:var(--text-muted)}.cell-tool{color:var(--blue);max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cell-rule{color:var(--text-muted);font-size:11px}.cell-rule-name{color:var(--text-primary)}.cell-msg{color:var(--text-secondary);max-width:300px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}button{cursor:pointer;border:1px solid var(--border);border-radius:var(--radius);padding:5px 12px;font-size:12px;font-family:var(--font-sans);background:var(--bg-tertiary);color:var(--text-primary);transition:background .15s}button:hover{background:var(--border)}input{background:var(--bg-primary);border:1px solid var(--border);border-radius:var(--radius);padding:5px 10px;font-size:12px;font-family:var(--font-mono);color:var(--text-primary);outline:none;width:100%}input:focus{border-color:var(--blue)}.audit-select{background:var(--bg-primary);border:1px solid var(--border);border-radius:var(--radius);padding:5px 8px;font-size:12px;color:var(--text-primary);outline:none}.chip{display:inline-block;padding:1px 9px;border-radius:10px;font-size:11px;cursor:pointer;border:1px solid var(--border);background:var(--bg-primary);color:var(--text-secondary);transition:all .15s;-webkit-user-select:none;user-select:none}.chip.active{border-color:var(--blue);color:var(--blue);background:#58a6ff14}.dashboard{height:100%;display:flex;flex-direction:column;padding:12px 16px;gap:10px;overflow:hidden}.dash-header{display:flex;align-items:center;justify-content:space-between;padding:4px 0;flex-shrink:0}.header-left{display:flex;align-items:center;gap:10px}.header-right{display:flex;align-items:center;gap:14px}.logo{font-size:16px;font-weight:700;color:var(--text-primary);display:flex;align-items:center}.connection-dot{width:8px;height:8px;border-radius:50%}.connection-dot.connected{background:var(--green);box-shadow:0 0 6px var(--green)}.connection-dot.disconnected{background:var(--red);animation:pulse 1.5s infinite}.connection-text{font-size:11px;color:var(--text-secondary)}.uptime{font-size:11px;color:var(--text-muted);font-family:var(--font-mono)}.stats-row{display:flex;gap:8px;flex-shrink:0}.stat-card{flex:1;text-align:center;padding:8px 6px}.stat-label{font-size:10px;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.5px;margin-bottom:2px}.stat-value{font-size:24px;font-weight:700;font-family:var(--font-mono);line-height:1.2}.stat-glow{animation:glowPulse 2s infinite}.event-feed{flex:1;display:flex;flex-direction:column;min-height:0;overflow:hidden}.panel-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;flex-shrink:0}.panel-header h3{font-size:12px;font-weight:600;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.5px}.header-meta{display:flex;align-items:center;gap:10px}.event-counter{font-family:var(--font-mono);font-size:11px;color:var(--text-muted);background:var(--bg-tertiary);padding:1px 8px;border-radius:10px}.filter-chips{display:flex;gap:4px}.event-list{flex:1;overflow-y:auto;font-family:var(--font-mono);font-size:12px}.event-row{display:flex;align-items:center;gap:6px;padding:3px 4px;border-bottom:1px solid rgba(48,54,61,.5);cursor:pointer;min-width:0;transition:background .1s}.event-row:hover{background:var(--bg-tertiary)}.event-anim{animation:slideIn .2s ease-out}.event-tag{font-size:9px;font-weight:700;padding:0 5px;border-radius:3px;background:#f8514926;color:var(--red);white-space:nowrap;flex-shrink:0}.event-tool{color:var(--blue);flex-shrink:0;max-width:130px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.event-detail{color:var(--text-secondary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;flex:1}.event-detail-full{white-space:normal;word-break:break-word}.event-expanded{background:var(--bg-tertiary);border-radius:4px}.scroll-btn{margin-top:6px;font-size:11px;padding:3px 10px;align-self:center}.empty-state{text-align:center;color:var(--text-muted);padding:20px;font-size:13px}.tab-container{flex:1;display:flex;flex-direction:column;min-height:0;background:var(--bg-secondary);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}.tab-bar{display:flex;gap:0;border-bottom:1px solid var(--border);flex-shrink:0;background:var(--bg-primary)}.tab-btn{border:none;border-radius:0;background:transparent;color:var(--text-secondary);padding:8px 18px;font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;border-bottom:2px solid transparent;transition:all .15s;display:flex;align-items:center;gap:6px}.tab-btn:hover{color:var(--text-primary);background:var(--bg-secondary)}.tab-active{color:var(--blue);border-bottom-color:var(--blue);background:var(--bg-secondary)}.tab-count{font-family:var(--font-mono);font-size:10px;padding:0 6px;border-radius:8px;background:var(--bg-tertiary);color:var(--text-muted)}.tab-count-alert{background:var(--red-dim);color:var(--red)}.tab-content{flex:1;overflow-y:auto;padding:12px;min-height:0}.attack-list-full{display:flex;flex-direction:column;gap:6px}.attack-category{border:1px solid var(--bg-tertiary);border-radius:var(--radius);overflow:hidden}.attack-category-header{display:flex;align-items:center;gap:8px;cursor:pointer;padding:8px 10px;font-size:13px;font-weight:600;background:var(--bg-primary);transition:background .1s}.attack-category-header:hover{background:var(--bg-tertiary)}.attack-icon{font-family:var(--font-mono);font-weight:700;font-size:12px;flex-shrink:0}.attack-label{flex:1}.attack-category-count{font-family:var(--font-mono);font-size:11px;padding:0 7px;border-radius:8px;background:var(--bg-tertiary);color:var(--text-secondary)}.collapse-icon{color:var(--text-muted);font-family:var(--font-mono);font-size:12px}.attack-items{padding:4px 10px 8px 28px;font-size:12px;font-family:var(--font-mono)}.attack-item{display:flex;align-items:flex-start;gap:6px;padding:3px 0;border-bottom:1px solid rgba(48,54,61,.3);min-width:0}.attack-item-tool{color:var(--blue);flex-shrink:0}.attack-item-detail{color:var(--text-secondary);word-break:break-word;flex:1;min-width:0}.attack-more{color:var(--text-muted);padding:4px 0;font-size:11px}.table-scroll{flex:1;overflow-y:auto}.hit-bar-bg{height:6px;background:var(--bg-primary);border-radius:3px;overflow:hidden}.hit-bar{height:100%;border-radius:3px;transition:width .3s ease}.audit-full{display:flex;flex-direction:column;gap:8px;height:100%;min-height:0}.audit-controls{display:flex;gap:6px;flex-shrink:0}.audit-controls input{flex:1}.kill-switch-container{display:flex;align-items:center}.kill-btn{background:var(--bg-tertiary);border:1px solid var(--border);padding:4px 14px;font-weight:700;font-size:11px;font-family:var(--font-mono);text-transform:uppercase;letter-spacing:1px}.kill-btn:hover{border-color:var(--red);color:var(--red)}.kill-btn.kill-active{background:var(--red-dim);border-color:var(--red);color:var(--red);animation:pulse 1.5s infinite}.kill-confirm{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--yellow)}.kill-btn-confirm{background:var(--red-dim);border-color:var(--red);color:var(--red);font-weight:700}
|