/** * Default Policy Engine for Matimo. * * Conservative defaults that protect against malicious agent-created tools. * Frozen at boot time — agents cannot modify policy at runtime. */ import type { ToolDefinition } from '../core/schema.js'; import type { PolicyEngine, PolicyContext, PolicyDecision, PolicyConfig, PolicyTier } from './types.js'; export declare class DefaultPolicyEngine implements PolicyEngine { private config; constructor(config?: PolicyConfig); /** * Check whether a tool definition may be created/proposed. * First applies the tier gate (fast early-return for TIER 3 blocked tools), * then runs ContentValidator rules. */ canCreate(context: PolicyContext, toolDef: ToolDefinition): PolicyDecision; /** * Check whether the caller is allowed to execute a given tool. */ canExecute(context: PolicyContext, tool: ToolDefinition): PolicyDecision; /** * Filter tools to only those the caller is allowed to see and use. */ filterForAgent(context: PolicyContext, tools: ToolDefinition[]): ToolDefinition[]; /** Expose the resolved config (read-only snapshot). */ getConfig(): Readonly> & Pick>; /** * Hot-reload policy configuration at runtime. * Merges the new config with DEFAULT_CONFIG (preserving conservative defaults * for any unset fields), then replaces the active config atomically. */ updateConfig(config: PolicyConfig): void; } /** * Pure utility: classify an agent-proposed tool into a policy tier. * * - `blocked`: reserved namespace, function/command execution type, SSRF URL * - `approval-required`: any auth credential, non-GET HTTP method, any data write * - `auto`: low-risk read-only HTTP GET with no auth * * This runs BEFORE content validation and is a hard gate — `blocked` tools * are rejected immediately without running the full content-validator. */ export declare function getTierForTool(tool: ToolDefinition, config?: PolicyConfig): PolicyTier; //# sourceMappingURL=default-policy.d.ts.map