/** * Restricted shell — per-agent command allowlisting for shell tools. * * Parses commands and checks them against a per-agent whitelist. * Provides audit logging for blocked and bypassed commands. */ import type { Logger, RestrictedShellConfig } from '../types'; export interface ShellCheckResult { allowed: boolean; command: string; agent: string; reason: string; } export interface RestrictedShellAuditEntry { timestamp: number; sessionId: string; agent: string; command: string; allowed: boolean; reason: string; /** True if the command was blocked but then manually bypassed. */ bypassed: boolean; } export declare class RestrictedShellEnforcer { private allowlists; private logger; private enabled; private audit; /** * Well-known dangerous commands that should always be blocked unless * explicitly in the allowlist. */ private static readonly DANGEROUS_PATTERNS; constructor(logger: Logger, config?: RestrictedShellConfig); /** * Check whether a command is allowed for the given agent. */ check(agent: string, command: string, sessionId?: string): ShellCheckResult; /** * Force-allow a blocked command (audit bypass). */ bypass(agent: string, command: string, sessionId: string): void; /** * Get audit trail. */ getAudit(): readonly RestrictedShellAuditEntry[]; /** * Whether the enforcer is enabled. */ isEnabled(): boolean; private recordAudit; } //# sourceMappingURL=restricted-shell.d.ts.map