/** * SkillShield — Filesystem Jail * * Restricts skill access to specific directories. Skills can only read/write * within their jail, and sensitive paths are always blocked. * * Unlike NVIDIA OpenShell (which needs Landlock/Linux), this works * cross-platform by intercepting Node.js fs module calls. */ export interface FilesystemPolicy { /** Root directory for the jail (skill can only access within this) */ jailRoot: string; /** Additional readable paths outside jail */ readablePaths?: string[]; /** Additional writable paths outside jail */ writablePaths?: string[]; /** Completely blocked paths (always denied, overrides everything) */ blockedPaths?: string[]; /** Allow reading files outside jail? (default: false) */ allowReadOutsideJail?: boolean; /** Max file size the skill can write (bytes) */ maxWriteSize?: number; /** Max total files the skill can create */ maxFileCount?: number; } export interface FilesystemViolation { timestamp: string; type: 'READ_BLOCKED' | 'WRITE_BLOCKED' | 'DELETE_BLOCKED' | 'SENSITIVE_PATH' | 'SIZE_EXCEEDED' | 'FILE_COUNT_EXCEEDED'; path: string; operation: string; details: string; } export declare class FilesystemJail { private policy; private violations; private fileCount; private totalBytesWritten; private jailRoot; private blockedPaths; private homeDir; constructor(policy: FilesystemPolicy); /** * Check if a read operation is allowed. */ checkRead(filePath: string): boolean; /** * Check if a write operation is allowed. */ checkWrite(filePath: string, size?: number): boolean; /** * Check if a delete operation is allowed. */ checkDelete(filePath: string): boolean; /** * Generate Node.js code that enforces filesystem policy at runtime. */ generateEnforcementCode(): string; private isSensitivePath; private isInsideJail; private resolvePath; private expandPath; private recordViolation; getViolations(): FilesystemViolation[]; getStats(): { filesCreated: number; bytesWritten: number; violations: number; }; } /** * Parse filesystem policy from SKILL.md frontmatter. * Expected format: * filesystem: * writable: ["./output", "/tmp"] * readable: ["./data"] * maxWriteMB: 50 * maxFiles: 100 */ export declare function parseFilesystemPolicy(frontmatter: Record, defaultJailRoot: string): FilesystemPolicy; //# sourceMappingURL=filesystem-jail.d.ts.map