New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

@stlw/warden-hook-server

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stlw/warden-hook-server

HTTP hook server implementing Warden's local decision contract

latest
Source
npmnpm
Version
0.2.7
Version published
Weekly downloads
0
Maintainers
2
Weekly downloads
 
Created
Source

@stlw/warden-hook-server

Local HTTP server implementing Warden's hook contract for clients and adapters that explicitly send it. It handles session lifecycle, prompt submission, pre-tool decisions, post-tool output tagging, and an auditable ledger.

Install

npm install @stlw/warden-hook-server @stlw/warden

Start a server in Node.js

startHookServer reads your PolicyConfig, defaults to port 7429, and returns the server handle:

import { startHookServer } from "@stlw/warden-hook-server";
import type { PolicyConfig } from "@stlw/warden";

const config: PolicyConfig = {
  version: "2",
  meta: { environment: "development", sessionApprovalRequired: false },
  policies: [
    {
      id: "allow-reads",
      description: "Allow read tools during development",
      match: { tools: ["read_file", "list_directory"], environment: ["development"] },
      action: "ALLOW",
    },
  ],
};

startHookServer({ config, dbPath: ".warden/ledger.db", port: 7429 });

Set WARDEN_AUTH_TOKEN (or pass authToken) to require X-Warden-Auth on hook requests. /health remains available for readiness checks:

curl http://localhost:7429/health

Connect an agent

Claude Code's native HTTP hooks are not supported for native-tool enforcement: Claude Code continues through a native tool when an HTTP hook cannot connect. Route Claude Code MCP tools through warden proxy instead. warden start serves Warden's own hook contract for integrations that explicitly implement that contract; it is not a Claude Code native-hook endpoint.

See the public manual for supported integration boundaries and setup.

Keywords

agent-security

FAQs

Package last updated on 04 Oct 2026

Related posts