@enforgate/sdk
v0.1.0
Published
Official TypeScript SDK for the Enforgate MCP gateway — action-boundary security for AI agents.
Readme
@enforgate/sdk
Official TypeScript SDK for the Enforgate gateway — action-boundary security for AI agents. Zero dependencies.
Usage
import { EnforgateClient, EnforgateError } from "@enforgate/sdk";
const enforgate = new EnforgateClient({
apiKey: process.env.ENFORGATE_API_KEY!,
baseUrl: process.env.ENFORGATE_GATEWAY_URL ?? "http://localhost:3000",
});
// Advisory check — get a verdict, decide what to do.
const verdict = await enforgate.check({
serverName: "demo",
toolName: "send_email",
args: { to: "[email protected]" },
});
if (verdict.decision !== "allow") throw new Error(verdict.reason);
// Or guard inline — throws EnforgateError unless the call is allowed.
await enforgate.guard({ serverName: "demo", toolName: "delete_file", args: { path } });check() resolves to { decision, reason, policyId, toolCallId, latencyMs }
where decision is "allow" | "deny" | "require_approval".
This wraps the advisory
POST /v1/checkHTTP API. For the enforcing path, point an MCP client at the gateway's/mcpendpoint (see the main docs).
