feat: implement MCP red teaming test suite v2 with automated scripts, logging, and comprehensive evidence documentation.

هذا الالتزام موجود في:
ZiadMahmoud2003
2026-08-26 20:49:08 +03:00
الأصل 714c08f3a8
التزام 5ba87ac00a
76 ملفات معدلة مع 3219 إضافات و3092 حذوفات

37
scripts/run_v2.py Normal file
عرض الملف

@@ -0,0 +1,37 @@
"""Run the V2 advanced test suite directly (without MCP server)."""
import sys
import json
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent / "src"))
from client_v2 import load_env, load_accounts, load_testcases_v2, run_full_suite_v2
def main():
env = load_env()
accounts = load_accounts()
testcases = load_testcases_v2()
sys.stderr.write(f"Starting V2 suite with {len(testcases)} tests...\n")
results = run_full_suite_v2(
accounts=accounts,
testcases=testcases,
env=env,
headless=True,
timeout_per_test=180,
)
# Save results
out_path = Path(__file__).parent / "reports" / "suite_results_v2.json"
out_path.parent.mkdir(parents=True, exist_ok=True)
out_path.write_text(json.dumps(results, indent=2, ensure_ascii=False), encoding="utf-8")
sys.stderr.write(f"Results saved to {out_path}\n")
# Print summary
for r in results:
status = "OK" if not r.get("error") else "ERR"
resp_preview = r.get("response", "")[:80].replace("\n", " ")
sys.stderr.write(f" [{status}] {r['id']}: {resp_preview}...\n")
if __name__ == "__main__":
main()