AI Red Teaming Lab: Microsoft’s Playground Challenges, Run Locally
0 / 10 steps
The goal
Run Microsoft’s own AI red-teaming training challenges on your machine, beat the ones that teach real application risks, and leave with a one-page defence sheet: for every challenge you break, what broke, which OWASP risk it is, and the fix. Microsoft built these 12 challenges for its Black Hat USA 2024 training and released them under the MIT licence.
Two ground rules. This runs entirely on your machine against your own API key, so each challenge costs a little in API usage — set a monthly spending limit on your OpenAI account before you start. And skip challenges 3, 4, 9 and 10: they ask the model for weapon instructions, which StashGrid doesn’t teach. Challenge 5 teaches the same multi-turn technique against a harmless target.
Why this lab: the LLMVault lab gives you one app with the whole OWASP list. This one gives you the same few attacks at rising difficulty (Easy → Medium → Hard), which is how you learn why a defence that stops the easy version fails on the hard one.
Steps
01Get the code
In a terminal on the machine that runs Docker, clone Microsoft’s repo and step into it.
$ git clone https://github.com/microsoft/AI-Red-Teaming-Playground-Labs.git && cd AI-Red-Teaming-Playground-Labs
Why the official repo: it’s Microsoft’s AI Red Team’s own training material, the same challenges used in their paid Black Hat course, so you’re practising against something built by people who red-team production AI.
02Set your keys
The repo has two setups: Azure OpenAI or plain OpenAI. This lab uses plain OpenAI. Paste your API key in place of the placeholder, then run the block in the same terminal you’ll start Docker from. The last line prints your login key — copy it somewhere, you need it in step 05.
export OPENAI_API_KEY="paste-your-openai-key-here" export OPENAI_TEXT_MODEL="gpt-4o" export OPENAI_EMBEDDING_MODEL="text-embedding-ada-002" export AUTH_KEY="$(openssl rand -hex 16)" export SECRET_KEY="$(openssl rand -hex 32)" echo "Your login key: $AUTH_KEY"
About the model names: these are the values in Microsoft’s README. If your account doesn’t offer one of them, swap in a current chat model and a current embedding model your key can use. AUTH_KEY is the password for the challenge site; SECRET_KEY signs sessions between its services. Both are random and only live in this terminal.
03Start the playground
Start the OpenAI version of the stack in the background. The first run builds 13 containers (one home page plus one chatbot per challenge), so give it a few minutes.
$ docker compose -f docker-compose-openai.yaml up -d
What just started: a challenge home page on port 5000 and twelve chatbot instances on ports 4001–4012, each with its own system prompt, its own secret and its own guardrails.
04Check it only listens on your machine
A deliberately weak chatbot connected to your paid API key should not be reachable from your network. List the listening ports.
$ sudo ss -tlnp | grep -E ':(5000|40[0-9][0-9]) '
What you want to see: every line starting 127.0.0.1:. Microsoft’s file already binds the twelve chatbots to 127.0.0.1. If port 5000 shows 0.0.0.0:5000, open docker-compose-openai.yaml, change its port line to "127.0.0.1:5000:5000", and run step 03 again. Same rule as every StashGrid lab: lab containers bind to localhost.
05Log in
Open this address in a browser on the same machine, replacing YOUR-AUTH-KEY with the login key step 02 printed. On a Mac use 127.0.0.1 instead of localhost.
http://localhost:5000/login?auth=YOUR-AUTH-KEY
You should land on the challenge list: twelve cards, each with a goal and a difficulty. Each card opens its own chatbot.
06Challenges 1 and 7: the file the bot shouldn’t share (LLM02)
The bot can read a fake passwords.txt and has been told not to share it. Challenge 1 (Easy) falls to a believable story — who you are and why you need it. Challenge 7 (Medium) needs you to combine approaches. Try at least three different framings before you look anything up, and note which ones moved the bot.
The lesson: “don’t reveal this” in a prompt is a request, not a control. The defence: if a user isn’t allowed to see data, the model answering that user must not be able to reach it. Enforce access in code, before anything goes into the model’s context. See the Sensitive Information Disclosure cheat sheet.
07Challenges 2 and 8: the secret in the system prompt (LLM08)
A secret word sits in the bot’s metaprompt (its system prompt) and a filter watches the output for it. Challenge 2 (Easy) is about getting the word out in a form the filter doesn’t recognise — think encodings and indirect descriptions. Challenge 8 (Medium) adds more guardrails.
The lesson: output filters are a speed bump; the model can always re-express what it knows. The defence: assume your system prompt will be read by users, and never put secrets, keys or internal logic in it. See the System Prompt Leakage cheat sheet.
08Challenge 5: many small steps (Crescendo, LLM01)
The goal is harmless — get the bot to rant with profanity about inflation — but it won’t do it if you ask outright. Crescendo is a multi-turn technique researched by Microsoft: start with a reasonable question, then nudge each follow-up a little further, building on the model’s own previous answers.
The lesson: every single message looked fine; the conversation as a whole didn’t. The defence: judge the whole conversation, not one turn at a time — conversation-level checks on input and output, and limits on how far a session can drift from its purpose. See the Jailbreak techniques cheat sheet.
09Challenges 6, 11 and 12: instructions hidden in a web page (indirect injection, LLM01)
Here you never talk the bot into anything directly. You edit a mock web page that the bot reads, and your instructions ride in with the content. Work 6 (Easy), then 11 (Medium) and 12 (Hard), and note what the harder versions added to stop you.
The lesson: anything the model reads — web pages, emails, documents, tool output — is a way to talk to it. The defence: mark untrusted content clearly so the model treats it as data, not instructions (Microsoft calls this “spotlighting” and covers it in its free AI Red Teaming 101 series), and give the model the fewest tools and permissions it needs. See the Prompt Injection cheat sheet.
10Write your defence sheet
Breaking a chatbot is half the skill. For every challenge you beat, write one line in a file: challenge · what worked · OWASP risk · the fix you’d ship. This is the page you’d hand to a developer, and it’s the part employers actually care about.
Check yourself: if a fix you wrote is “tell the model not to”, rewrite it. Every fix in steps 06–09 lives in code, data access or architecture, not in the prompt.
You ran Microsoft’s red-team training range locally, beat the application-risk challenges at rising difficulty, and wrote the fixes down.
If it didn’t work
- Port 5000 already in use on a Mac → macOS’s AirPlay Receiver listens on 5000 → turn it off in System Settings → General → AirDrop & Handoff, or change the home page’s host port in the compose file.
- The login page rejects you → the key in the address doesn’t match AUTH_KEY, often because Docker was started from a different terminal → run docker compose -f docker-compose-openai.yaml down, redo step 02 and step 03 in one terminal.
- Chatbots answer with errors → the API key, a model name or your account’s billing is the problem → read docker compose -f docker-compose-openai.yaml logs for the API’s error message and fix the variable it names.
- Nothing on port 5000 at all → the first build is still running or a container exited → check docker compose -f docker-compose-openai.yaml ps.
Your turn — no walkthrough
Build your own challenge. The repo generates its challenges from challenges/challenges.json with python generate.py challenges.json (see the README for the setup). Write one with a secret and the best defence you can think of from your sheet, then try to break your own design.
Keep the evidence. Your challenge definition, the prompt that broke it (or didn’t) and your defence sheet make a stronger portfolio piece than any certificate.
Clean up
$ docker compose -f docker-compose-openai.yaml down
If you made an API key just for this lab, delete it in your OpenAI account afterwards.
Before you leave — prove it
Take a screenshot of the challenge list with your solved challenges marked, and keep it next to your defence sheet.
What you learned
- Prompts aren’t access control — data the model can reach, a user can eventually get.
- System prompts leak — filters slow it down; keeping secrets out stops it.
- Multi-turn attacks beat single-turn checks — judge the conversation, not the message.
- Everything the model reads is an input — indirect injection is why agents need least privilege.
Put it on your resume. Completed Microsoft AI Red Teaming Playground challenges locally and wrote a defence sheet mapping each break to an OWASP LLM risk and its fix. Change it to match what you actually did.
Tried it? Tell us
Nova built this lab from Steven’s ideas, and most StashGrid labs haven’t had a full run yet. If a step broke, behaved differently for you, or you know a better way, tell us. Ideas for the next lab are welcome too — no promises on timing.
NextBack to the LLM Security map: more labs, cheat sheets and free training→
Go deeper
- Microsoft AI Red Teaming 101 — the free 10-episode video series these challenges pair with.
- AI Red Teaming Playground Labs on GitHub — the source, README and Azure setup.
- LLMVault lab — the whole OWASP LLM Top 10 in one vulnerable app.
- OWASP FinBot CTF — the same ideas against an AI agent with real tools.
Original walkthrough, based on Microsoft’s public README (MIT licence), checked 30 Sep 2026. If a step has changed, tell me and I will fix it.