codecrucible-synth
Version:
Production-Ready AI Development Platform with Multi-Voice Synthesis, Smithery MCP Integration, Enterprise Security, and Zero-Timeout Reliability
86 lines • 2.3 kB
TypeScript
/**
* Validation result from security checks
*/
export interface ValidationResult {
isValid: boolean;
reason?: string;
severity: 'low' | 'medium' | 'high' | 'critical';
suggestedAlternative?: string;
}
/**
* Security policy configuration
*/
export interface SecurityPolicy {
allowNetworkAccess: boolean;
allowFileSystemWrite: boolean;
allowProcessSpawning: boolean;
allowEnvironmentAccess: boolean;
maxExecutionTime: number;
allowedCommands: string[];
blockedCommands: string[];
allowedLanguages: string[];
}
/**
* Comprehensive security validator for E2B code execution
*/
export declare class SecurityValidator {
private policy;
constructor(policy?: Partial<SecurityPolicy>);
/**
* Validate a command before execution
*/
validateCommand(command: string): ValidationResult;
/**
* Validate code before execution
*/
validateCode(code: string, language: string): ValidationResult;
/**
* Validate Python code specifically
*/
private validatePythonCode;
/**
* Validate JavaScript code specifically
*/
private validateJavaScriptCode;
/**
* Validate Bash code specifically
*/
private validateBashCode;
/**
* Validate generic code
*/
private validateGenericCode;
/**
* Validate file operation
*/
validateFileOperation(operation: string, path: string): ValidationResult;
/**
* Check against all security patterns
*/
private checkSecurityPatterns;
/**
* Get safe alternative for blocked commands
*/
private getSafeAlternative;
/**
* Log security violation
*/
logSecurityViolation(sessionId: string, violationType: string, content: string, severity: string): void;
/**
* Update security policy
*/
updatePolicy(newPolicy: Partial<SecurityPolicy>): void;
/**
* Get current security policy
*/
getPolicy(): SecurityPolicy;
/**
* Create a validator with stricter security
*/
static createStrictValidator(): SecurityValidator;
/**
* Create a validator with relaxed security for development
*/
static createDevelopmentValidator(): SecurityValidator;
}
//# sourceMappingURL=security-validator.d.ts.map