@agent-wall/core 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.
@@ -0,0 +1,17 @@
1
+
2
+ > @agent-wall/core@0.1.0 build /home/runner/work/agent-wall/agent-wall/packages/core
3
+ > tsup
4
+
5
+ CLI Building entry: src/index.ts
6
+ CLI Using tsconfig: tsconfig.json
7
+ CLI tsup v8.5.1
8
+ CLI Using tsup config: /home/runner/work/agent-wall/agent-wall/packages/core/tsup.config.ts
9
+ CLI Target: es2022
10
+ CLI Cleaning output folder
11
+ ESM Build start
12
+ ESM dist/index.js 93.05 KB
13
+ ESM dist/index.js.map 196.28 KB
14
+ ESM ⚡️ Build success in 81ms
15
+ DTS Build start
16
+ DTS ⚡️ Build success in 4268ms
17
+ DTS dist/index.d.ts 41.75 KB
@@ -0,0 +1,30 @@
1
+
2
+ > @agent-wall/core@0.1.0 test /home/runner/work/agent-wall/agent-wall/packages/core
3
+ > vitest run
4
+
5
+
6
+  RUN  v3.2.4 /home/runner/work/agent-wall/agent-wall/packages/core
7
+
8
+ ✓ src/response-scanner.test.ts (40 tests) 28ms
9
+ ✓ src/policy-engine.test.ts (25 tests) 35ms
10
+ ✓ src/dashboard-server.test.ts (16 tests) 2533ms
11
+ ✓ DashboardServer > should broadcast to multiple clients  403ms
12
+ ✓ DashboardServer > should handle client disconnect without errors  604ms
13
+ ✓ src/injection-detector.test.ts (21 tests) 10ms
14
+ ✓ src/policy-engine-security.test.ts (21 tests) 12ms
15
+ ✓ src/audit-logger-security.test.ts (8 tests) 12ms
16
+ ✓ src/policy-loader.test.ts (15 tests) 16ms
17
+ ✓ src/egress-control.test.ts (17 tests) 8ms
18
+ ✓ src/chain-detector.test.ts (10 tests) 6ms
19
+ ✓ src/read-buffer.test.ts (12 tests) 10ms
20
+ ✓ src/types.test.ts (12 tests) 6ms
21
+ ✓ src/kill-switch.test.ts (7 tests) 457ms
22
+ ✓ KillSwitch > file-based activation > should deactivate when kill file is removed  301ms
23
+ ✓ src/audit-logger.test.ts (5 tests) 6ms
24
+ ✓ src/read-buffer-security.test.ts (7 tests) 7ms
25
+
26
+  Test Files  14 passed (14)
27
+  Tests  216 passed (216)
28
+  Start at  10:27:35
29
+  Duration  6.44s (transform 389ms, setup 0ms, collect 634ms, tests 3.15s, environment 2ms, prepare 1.07s)
30
+
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,80 @@
1
+ # @agent-wall/core
2
+
3
+ Core proxy engine and security modules for [Agent Wall](https://github.com/agent-wall/agent-wall) — a security firewall for AI agents.
4
+
5
+ [![npm](https://img.shields.io/npm/v/@agent-wall/core)](https://www.npmjs.com/package/@agent-wall/core)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/agent-wall/agent-wall/blob/main/LICENSE)
7
+
8
+ > **Most users should install [`agent-wall`](https://www.npmjs.com/package/agent-wall) (the CLI) instead.** This package is for programmatic usage — embedding Agent Wall into your own tools.
9
+
10
+ ## Install
11
+
12
+ ```bash
13
+ npm install @agent-wall/core
14
+ ```
15
+
16
+ ## What's Inside
17
+
18
+ | Module | Description |
19
+ |--------|-------------|
20
+ | `StdioProxy` | Two-way MCP protocol interception proxy |
21
+ | `PolicyEngine` | First-match-wins rule evaluator (glob, rate limiting, strict mode) |
22
+ | `ResponseScanner` | Secret/PII detection with ReDoS protection |
23
+ | `InjectionDetector` | 30+ prompt injection patterns |
24
+ | `EgressControl` | URL/SSRF protection (RFC1918, metadata, IP obfuscation) |
25
+ | `KillSwitch` | Emergency deny-all (file, signal, programmatic) |
26
+ | `ChainDetector` | Multi-step attack pattern detection |
27
+ | `AuditLogger` | HMAC-SHA256 signed JSON lines with rotation |
28
+ | `PolicyLoader` | YAML config with Zod validation and hot-reload |
29
+ | `DashboardServer` | WebSocket + HTTP server for real-time dashboard |
30
+
31
+ ## Usage
32
+
33
+ ```typescript
34
+ import {
35
+ StdioProxy,
36
+ PolicyEngine,
37
+ ResponseScanner,
38
+ InjectionDetector,
39
+ EgressControl,
40
+ KillSwitch,
41
+ ChainDetector,
42
+ AuditLogger,
43
+ loadPolicy,
44
+ } from "@agent-wall/core";
45
+
46
+ // Load policy from YAML
47
+ const { config } = loadPolicy("./agent-wall.yaml");
48
+
49
+ // Create security modules
50
+ const policyEngine = new PolicyEngine(config);
51
+ const scanner = new ResponseScanner(config.responseScanning);
52
+ const injectionDetector = new InjectionDetector();
53
+ const egressControl = new EgressControl();
54
+ const killSwitch = new KillSwitch();
55
+ const chainDetector = new ChainDetector();
56
+
57
+ // Create proxy
58
+ const proxy = new StdioProxy({
59
+ command: "npx",
60
+ args: ["@modelcontextprotocol/server-filesystem", "/home/user"],
61
+ policyEngine,
62
+ responseScanner: scanner,
63
+ injectionDetector,
64
+ egressControl,
65
+ killSwitch,
66
+ chainDetector,
67
+ });
68
+
69
+ await proxy.start();
70
+ ```
71
+
72
+ ## Documentation
73
+
74
+ Full docs: [agent-wall.github.io/agent-wall](https://agent-wall.github.io/agent-wall/)
75
+
76
+ API reference: [agent-wall.github.io/agent-wall/api/core](https://agent-wall.github.io/agent-wall/api/core)
77
+
78
+ ## License
79
+
80
+ [MIT](https://github.com/agent-wall/agent-wall/blob/main/LICENSE)