/** * WARD.md integration for Hundredmen. * @weave_protocol/hundredmen * * Loads a WARD.md policy and exposes runtime check methods that the * Interceptor calls before allowing a tool call to proceed. * * Auto-detection: * - process.env.WEAVE_WARD_PATH if set * - ./WARD.md in current working directory otherwise * * No file is required. If no WARD.md is found, the manager simply * returns `allow` for every check and Hundredmen behaves as before. */ import { type WardPolicy, type CheckResult, type HttpMethod, type ValidationResult } from '@weave_protocol/ward'; export interface WardCheckResult { /** Overall decision: allow, deny, require_approval. */ decision: 'allow' | 'deny' | 'require_approval'; /** Human-readable reason. */ reason: string; /** Which check produced this decision. */ checks: WardCheckBreakdown[]; /** Highest severity from the breakdown. */ severity?: 'low' | 'medium' | 'high' | 'critical'; } export interface WardCheckBreakdown { type: 'capability' | 'filesystem' | 'network' | 'data_egress' | 'payment' | 'limits'; decision: 'allow' | 'deny' | 'require_approval'; reason: string; matchedRule?: string; } export interface WardManagerStatus { loaded: boolean; source?: string; policyName?: string; agent?: string; validation?: ValidationResult; } export declare class WardPolicyManager { private policy; private source; private validation; constructor(); /** * Try to load a WARD.md from env var or CWD. Returns true if loaded. */ autoLoad(): boolean; /** Load a WARD.md file from a specific path. */ loadFromPath(path: string): void; /** Load a WARD.md from raw markdown source. */ loadFromSource(source: string, sourceLabel?: string): void; /** Remove the loaded policy. Subsequent checks will allow everything. */ unload(): void; isLoaded(): boolean; status(): WardManagerStatus; getPolicy(): WardPolicy | null; /** * Decide whether to allow an MCP tool call given the loaded WARD policy. * * If no policy is loaded, returns `allow` (zero-impact mode). * Otherwise runs the capability check plus any filesystem/network checks * inferable from common argument names (path, url, file, etc.). */ checkCall(tool: string, args: Record | undefined, sessionId?: string): WardCheckResult; /** Standalone capability check. */ checkCapability(tool: string): CheckResult; /** Standalone filesystem check. */ checkFilesystem(op: 'read' | 'write' | 'execute' | 'delete' | 'list', path: string): CheckResult; /** Standalone network check. */ checkNetwork(url: string, method?: HttpMethod): CheckResult; /** Standalone egress check. */ checkDataEgress(classification: string): CheckResult; } //# sourceMappingURL=ward.d.ts.map