/** * Escapes a string for safe use in Google Drive API query strings. * Prevents query injection by escaping single quotes and backslashes. * * @param input - The user-provided string to escape * @returns Escaped string safe for use in Drive API queries */ export declare function escapeDriveQuery(input: string): string; /** Configuration for allowed and forbidden paths */ export interface PathSecurityConfig { /** Directories where file writes are allowed (absolute paths) */ allowedWritePaths: string[]; /** Directories where file reads are allowed (absolute paths) */ allowedReadPaths: string[]; /** Path patterns that are always forbidden (applies to both read and write) */ forbiddenPathPatterns: string[]; /** Whether to follow symlinks when validating paths */ followSymlinks: boolean; } /** Default security configuration */ export declare const DEFAULT_PATH_SECURITY_CONFIG: PathSecurityConfig; export interface PathValidationResult { valid: boolean; resolvedPath: string; error?: string; } /** * Validates a file path for read operations. * * @param filePath - The path to validate * @param config - Security configuration * @returns Validation result with resolved path or error message */ export declare function validateReadPath(filePath: string, config?: PathSecurityConfig): PathValidationResult; /** * Validates a file path for write operations. * * @param filePath - The path to validate * @param config - Security configuration * @returns Validation result with resolved path or error message */ export declare function validateWritePath(filePath: string, config?: PathSecurityConfig): PathValidationResult; /** * Tools that involve third-party communication when certain parameters are used. * Maps tool name to the parameter(s) that trigger third-party communication. */ export declare const THIRD_PARTY_TOOLS: Record; /** * Checks if a tool call would involve third-party communication. * * @param toolName - Name of the tool being called * @param args - Arguments being passed to the tool * @returns Object indicating if blocked and why */ export declare function checkThirdPartyAction(toolName: string, args: Record): { blocked: boolean; reason?: string; }; /** * Wraps untrusted external content (like email bodies) with clear security warnings * and XML-style delimiters to help AI assistants distinguish between instructions and data. * * This is a defense-in-depth measure against prompt injection attacks where * malicious content in emails tries to manipulate the AI into performing actions. * * @param content - The untrusted content to wrap * @param source - Description of where the content came from (e.g., "Email body", "Email from sender@example.com") * @returns The wrapped content with security annotations */ export declare function wrapUntrustedContent(content: string, source: string): string; /** * Wraps email content specifically, including sender information in the warning. * * @param body - The email body content * @param from - The sender's email address or name * @param subject - The email subject (optional) * @returns The wrapped email body with security annotations */ export declare function wrapEmailContent(body: string, from?: string, subject?: string): string; /** * Wraps form response content. * * @param content - The form response content * @param formTitle - The title of the form (optional) * @param respondentEmail - The email of the respondent if available (optional) * @returns The wrapped content with security annotations */ export declare function wrapFormResponse(content: string, formTitle?: string, respondentEmail?: string): string; /** * Wraps document comment content. * * @param content - The comment content * @param author - The comment author (optional) * @returns The wrapped content with security annotations */ export declare function wrapCommentContent(content: string, author?: string): string; /** * Wraps spreadsheet cell content. * * @param content - The cell content (can be stringified array) * @param sheetName - The name of the sheet (optional) * @param range - The cell range (optional) * @returns The wrapped content with security annotations */ export declare function wrapSpreadsheetContent(content: string, sheetName?: string, range?: string): string; /** * Wraps Google Doc content. * * @param content - The document content * @param docTitle - The document title (optional) * @returns The wrapped content with security annotations */ export declare function wrapDocumentContent(content: string, docTitle?: string): string; //# sourceMappingURL=securityHelpers.d.ts.map