How microsoft/ai-red-teaming-playground-labs works
Project Type and Purpose
• This is a full-stack, multi‐service “playground” environment for AI Red Teaming labs.
• It uses Docker Compose (and optional Kubernetes manifests) to spin up a set of challenge microservices, a landing‐page front end, optional scoring and submission apps, plus a load‐balancer.
• The purpose is to host interactive AI security challenges against Chat Copilot instances, track flags via CTFd, and optionally score conversations and picture submissions.
Key Architectural Patterns
• Microservices: each challenge (“chat-copilot”, “picture-submission”, “chat-score”, “ctfd”, plus “challenge-home”) runs as an independent service/container.
• API‐driven front ends: single‐page React front ends talk to REST/WebSocket backends.
• Orchestration: Docker Compose for local development, Kubernetes manifests for production.
• External API integration: Azure OpenAI endpoints accessed via a reverse‐proxy load balancer.
• Optional “score” and “CTFd” services integrate via HTTP/flag‐submission APIs.
Main Components
• Frontends (React apps):
• challenge-home webapp (list of labs)
• chat-copilot webapp
• chat-score webapp
• picture-submission webapp
• Backends:
• challenge-home API (Python/Flask)
• chat-copilot WebAPI (ASP.NET Core C#; SignalR + REST controllers)
• chat-score WebAPI & worker (Python/FastAPI + background tasks)
• picture-submission API (Python/FastAPI)
• Supporting services:
• CTFd platform (Python/CTFd)
• Load balancer (Go reverse proxy with Azure OpenAI endpoint orchestration)
• Data stores:
• Cosmos DB (via chat-copilot’s CosmosDbContext)
• File system (fallback memory store, uploads)
• In‐memory/volatile contexts (for ephemeral lab state)
• External dependencies:
• Azure OpenAI endpoints (multiple)
• GitHub/Jira or other OpenAPI plugins
• Prometheus metrics, AppInsights telemetry
Interactions and Data Flow
• Users → challenge-home UI → challenge-home API → returns challenge metadata JSON.
• Users select a challenge → challenge-home UI loads corresponding chat-copilot or other service endpoint.
• chat-copilot UI → WebAPI (SignalR for chat, REST for metadata/plugins) → communicates with:
• Cognitive services (Azure OpenAI APIs via load balancer)
• Persistence (Cosmos DB, file system)
• Ctfd API (flag validation/submission)
• Semantic Kernel, plugins (HTTP, RCE, OpenAPI)
• Optionally, chat-score UI → chat-score API → WebSocket/SSE or polling for scoring queues → worker tasks evaluate transcripts.
• picture-submission UI → picture-submission API → stores images, invokes scoring (chat-score), submits flags.
• CTFd UI → users see flags/leaderboard; CTFd API is driven by automated challenge‐creation scripts.
Summary
• Break the system into Frontend UIs, Backend APIs, Data Stores, and External Dependencies.
• How the “challenge-home” directs users to individual challenge containers.
• Multi‐tenant nature of chat-copilot (one per challenge), the optional scoring/picture‐submission pipelines, and the centralized CTFd platform.