purgeai-shield
Version:
PurgeAI Shield - AI Security SDK for prompt injection detection, jailbreak prevention, and PII protection
58 lines • 1.57 kB
TypeScript
export interface PurgeAIConfig {
apiKey: string;
domain?: string;
baseURL?: string;
timeout?: number;
}
export interface ProtectResult {
safe: boolean;
sanitized: string;
threat: string | null;
severity: 'none' | 'low' | 'medium' | 'high' | 'critical';
confidence: number;
blocked: boolean;
metadata?: {
patterns?: string[];
pii?: string[];
suggestions?: string[];
};
}
export interface BatchProtectResult {
results: ProtectResult[];
}
export declare class PurgeAI {
private apiKey;
private domain?;
private client;
constructor(config: PurgeAIConfig);
/**
* Protect a single input from threats
* @param input - The user input to analyze
* @returns Protection result with threat analysis
*/
protect(input: string): Promise<ProtectResult>;
/**
* Protect multiple inputs in batch
* @param inputs - Array of user inputs to analyze
* @returns Batch protection results
*/
batchProtect(inputs: string[]): Promise<BatchProtectResult>;
/**
* Check if input is safe (convenience method)
* @param input - The user input to check
* @returns True if safe, false if threat detected
*/
isSafe(input: string): Promise<boolean>;
/**
* Update API key
* @param apiKey - New API key
*/
setApiKey(apiKey: string): void;
/**
* Update domain
* @param domain - New domain
*/
setDomain(domain: string): void;
}
export default PurgeAI;
//# sourceMappingURL=index.d.ts.map