@agent-wall/core
v0.1.1
Published
Core proxy engine and policy evaluator for Agent Wall
Readme
@agent-wall/core
Core proxy engine and security modules for Agent Wall — a security firewall for AI agents.
Most users should install
@agent-wall/cli(the CLI) instead. This package is for programmatic usage — embedding Agent Wall into your own tools.
Install
npm install @agent-wall/coreWhat's Inside
| Module | Description |
|--------|-------------|
| StdioProxy | Two-way MCP protocol interception proxy |
| PolicyEngine | First-match-wins rule evaluator (glob, rate limiting, strict mode) |
| ResponseScanner | Secret/PII detection with ReDoS protection |
| InjectionDetector | 30+ prompt injection patterns |
| EgressControl | URL/SSRF protection (RFC1918, metadata, IP obfuscation) |
| KillSwitch | Emergency deny-all (file, signal, programmatic) |
| ChainDetector | Multi-step attack pattern detection |
| AuditLogger | HMAC-SHA256 signed JSON lines with rotation |
| PolicyLoader | YAML config with Zod validation and hot-reload |
| DashboardServer | WebSocket + HTTP server for real-time dashboard |
Usage
import {
StdioProxy,
PolicyEngine,
ResponseScanner,
InjectionDetector,
EgressControl,
KillSwitch,
ChainDetector,
AuditLogger,
loadPolicy,
} from "@agent-wall/core";
// Load policy from YAML
const { config } = loadPolicy("./agent-wall.yaml");
// Create security modules
const policyEngine = new PolicyEngine(config);
const scanner = new ResponseScanner(config.responseScanning);
const injectionDetector = new InjectionDetector();
const egressControl = new EgressControl();
const killSwitch = new KillSwitch();
const chainDetector = new ChainDetector();
// Create proxy
const proxy = new StdioProxy({
command: "npx",
args: ["@modelcontextprotocol/server-filesystem", "/home/user"],
policyEngine,
responseScanner: scanner,
injectionDetector,
egressControl,
killSwitch,
chainDetector,
});
await proxy.start();Documentation
Full docs: agent-wall.github.io/agent-wall
API reference: agent-wall.github.io/agent-wall/api/core
