import { runSecretsTests } from './secrets-scanner.test.js'; import { runInjectionTests } from './prompt-injection.test.js'; import { runExfiltrationTests } from './exfiltration.test.js'; import { runStartupCheckerTests } from './startup-checker.test.js'; import { runSecurityBootstrapTests } from './security-bootstrap.test.js'; import { runSecretRedactorTests } from './secret-redactor.test.js'; interface TestResult { suite: string; passed: number; failed: number; errors: string[]; } async function main(): Promise { console.log('=== OpenClaw Security Guardrails v0.2.0 — Test Suite ===\n'); const suites: TestResult[] = [ await runSecretsTests(), await runInjectionTests(), await runExfiltrationTests(), await runStartupCheckerTests(), await runSecurityBootstrapTests(), await runSecretRedactorTests(), ]; let totalPassed = 0; let totalFailed = 0; for (const suite of suites) { const status = suite.failed === 0 ? '✅' : '❌'; console.log(`${status} ${suite.suite}: ${suite.passed} passed, ${suite.failed} failed`); if (suite.errors.length > 0) { for (const err of suite.errors) { console.log(` ⚠️ ${err}`); } } totalPassed += suite.passed; totalFailed += suite.failed; } console.log(`\n--- Total: ${totalPassed} passed, ${totalFailed} failed ---`); if (totalFailed > 0) { process.exit(1); } } main().catch((err) => { console.error('Test runner error:', err); process.exit(1); });