/** * Red Team Agent - SLOP Native * * Adversarial validation agent - safely tests if findings are exploitable. * Runs in sandboxed environment, never touches production. * * Tools: * - validate-finding: Test if a finding is actually exploitable * - test-secret: Safely test if a leaked credential is valid * - probe-endpoint: Test API endpoint for vulnerability * - sandbox-test: Run exploit simulation in isolated environment * - generate-poc: Generate proof-of-concept (non-destructive) */ import { SLOPAgent } from './base.js'; import { SLOPAgentConfig, SLOPToolCall, SLOPToolResult } from './types.js'; export interface ValidationResult { findingId: string; validated: boolean; exploitable: boolean; confidence: number; evidence: string[]; falsePositive: boolean; reason: string; riskLevel: 'confirmed-critical' | 'confirmed-high' | 'likely-exploitable' | 'needs-verification' | 'likely-false-positive'; recommendations: string[]; testDetails: TestDetails; } export interface TestDetails { testType: string; duration: number; attempts: number; successRate: number; logs: string[]; } export interface SecretTestResult { secretType: string; valid: boolean; expired: boolean; permissions: string[]; scope: string; revokeUrl?: string; safeToTest: boolean; evidence: string; } export interface EndpointProbeResult { url: string; vulnerable: boolean; vulnerabilityType?: string; statusCode: number; responseTime: number; headers: Record; findings: string[]; safePayloadUsed: boolean; } export interface SandboxResult { id: string; findingId: string; success: boolean; output: string; exitCode: number; duration: number; containerId?: string; isolated: boolean; artifacts: string[]; } export interface POCResult { findingId: string; pocType: 'script' | 'curl' | 'code-snippet' | 'manual-steps'; language?: string; code: string; safetyNotes: string[]; disclaimer: string; usage: string; } export declare class RedTeamAgent extends SLOPAgent { private validationCache; private sandboxEnabled; constructor(config: SLOPAgentConfig); handleToolCall(call: SLOPToolCall): Promise; /** * Validate if a finding is exploitable */ private validateFinding; /** * Test if a secret is valid (dry run by default) */ private testSecret; /** * Probe an endpoint for vulnerabilities */ private probeEndpoint; /** * Run exploit in sandbox (simulated for safety) */ private sandboxTest; /** * Generate proof-of-concept code */ private generatePOC; /** * Validate multiple findings */ private bulkValidate; private analyzeSecret; private analyzeVulnerability; private analyzeCodeIssue; private generateReason; private generateRecommendations; private simulateSandboxOutput; private generateSecretPOCPython; private generateSecretPOCCurl; private generateVulnPOC; private generateManualSteps; private generateUsageInstructions; } export declare function createRedTeamAgent(port?: number, coordinatorUrl?: string): RedTeamAgent;