Published as part of the Microsoft Reactor "Reasoning Agents Live Streaming Battle" on June 10, 2026.
The Challenge
Microsoft Reactor invited three individuals to compete in a live coding battle: build something that shows what reasoning agents can do, in front of a streaming audience, in roughly twelve minutes of airtime each.
Watch live at 9am PT 10th June https://developer.microsoft.com/en-us/reactor/events/26942/
The temptation is always to default to a clean Q&A demo or a document summarizer. I wanted to try something harder.
The solution I will be building is Compliance Academy: a multi-agent cyber-mystery role-playing game where the player is the lead investigator at Helix Dynamics, a fictional biotech that just lost 14 GB of clinical trial data. Five suspects. One perpetrator. Multiple frameworks (SOC 2, HIPAA, ISO 27001) and the company's own policies are all in play. By the end of the case, the player has learned a real compliance lesson, grounded in real policy excerpts retrieved from a real search index.
The whole stack runs on Microsoft Foundry Agent Service, with Azure OpenAI for the model layer and Azure AI Search for retrieval. The source code is open: github.com/lwhieldon/msft-enterprise-learning-agent.
Why a Game?
Compliance training is something most professionals click through to satisfy a deadline. The content is dense, the stakes feel abstract, and the answers are usually "ask Legal." People learn just enough to pass the quiz, which is the wrong outcome for material that should change how they make decisions.
Reasoning agents let us flip the contract. Instead of pushing content at the learner, a multi-agent system can stage a scenario where the learner has agency. They ask questions because they need answers. They interrogate suspects who are evasive on purpose. They piece evidence together. When the Compliance Officer agent steps in at the end and cites SOC 2 CC6.1 alongside Helix Dynamics' own HD-SEC-AC-001 §4.1, the citation lands because the player just spent twenty minutes earning it.
That was the hypothesis worth testing on stream: reasoning agents are good enough now that we can make compliance training feel like a case file instead of a quiz.
The Architecture
Compliance Academy uses a Connected Agents pattern on Microsoft Foundry Agent Service. Four party agents are always present, providing broad expertise. A roster of suspect agents activates dynamically as the player interrogates them. The player is the orchestrator. They decide who to talk to and when.
The four party agents
| Agent | Role | Backing |
|---|---|---|
| Game Master | Scene-setting, action menu, scene close | gpt-4.1-mini |
| Forensic Analyst | Evidence reasoning, log analysis, framework lookups | gpt-4.1-mini + Azure AI Search retrieval |
| Compliance Officer | Post-scene verdict and framework grounding | gpt-4.1-mini + Azure AI Search retrieval |
| Scenario Generator | Hot-loads brand-new cases from a one-sentence breach prompt | gpt-4.1-mini |
The five suspect agents
Each suspect is a separate agent instance with a templated system prompt that loads from scenario JSON. Personas include an HR Director, an IT Administrator, a vendor account manager, an executive assistant, and a summer intern. Each carries a distinct backstory, alibi, conversational style, and a list of "leak conditions" that determine when they reveal guarded information.
The two surfaces
The audience-facing surface is a Chainlit UI, branded for SC&H Group, with click-through action buttons (Briefing, Suspects, Evidence, Generate, Accuse, Wrap) and a side panel that shows the retrieved policy snippets the agents are reasoning over.
The proof-of-orchestration surface is a live activity log streaming to a second terminal. Every Azure AI Search retrieval, every Azure OpenAI POST, every first-token latency, every source name and relevance score scrolls by in real time. This terminal is the show-don't-tell evidence that the agents are genuinely doing work, not just dressing up a single prompt.
Grounding Compliance Answers in Real Policy
The non-negotiable for compliance content is hallucination prevention. If the Forensic Analyst tells a learner that SOC 2 CC6.1 says something it doesn't, the entire training is worse than useless. So both the Forensic Analyst and the Compliance Officer ground their responses against an Azure AI Search index containing 52 chunked policy documents covering SOC 2, HIPAA, ISO 27001, NIST 800-53, and the fictional Helix Dynamics internal policy library.
The retrieval is straightforward:
def retrieve_context(query: str, top_k: int = 5) -> list[dict]:
"""Search the compliance knowledge index and return top-k snippets."""
client = build_search_client()
results = client.search(
search_text=query.strip(),
top=top_k,
select=["uid", "snippet", "blob_url", "snippet_parent_id"],
)
return [
{
"source_url": r["blob_url"],
"snippet": r["snippet"],
"score": r["@search.score"],
}
for r in results
]
What makes it land in the demo is the per-source event logging. Each retrieval emits its filename and relevance score to the activity log:
[Foundry IQ] Retrieved 5 sources in 1233ms
[Foundry IQ] vendor_breach_response.md (score=11.20)
[Foundry IQ] helix_dynamics_overview.md (score=7.65)
[Foundry IQ] credential_compromise_response.md (score=7.41)
[Azure OpenAI] POST gpt-4.1-mini (max_tokens=1500, temp=0.4)
[Azure OpenAI] First token in 8328ms
[Azure OpenAI] Stream complete: ~816 tokens in 14.9s
When the Forensic Analyst then cites HD-SEC-AC-001 §4.1 on MFA exceptions, the audience can see the specific document the citation came from. The trust loop closes on screen.
Live World-Building with the Scenario Generator
The piece I am most proud of technically is the Scenario Generator. Mid-demo, the host or an audience member can pitch a breach in one or two sentences. Roughly forty seconds later, a brand new scenario hot-loads into the game.
The agent emits structured JSON: a premise narration, five suspects with assigned roles and hidden truths, six to ten pieces of evidence, four to six violated controls, a clue graph, and a compliance lesson. The output then runs through a validation layer:
try:
merged_scenario = load_scenario_from_dict(scenario_override)
except ScenarioValidationError as exc:
if validation_attempt < max_validation_retries:
# Feed the validation error back to the model as a corrective message
user_message = _build_validation_retry_message(
breach_description, exc
)
continue
raise
If validation fails (wrong perpetrator count, missing canonical suspect, malformed evidence reference), the generator retries with the specific error fed back as a corrective message. Two validation cycles is usually enough. The session state then resets cleanly, the new briefing renders, and the player can start investigating immediately. Same agents. Brand new world.
Lessons Learned
A few takeaways I will carry to the next reasoning-agent project:
- Ground anything compliance-related in retrieval, always. Even "general knowledge" policy citations are a hallucination risk. The Connected Agents pattern made it natural to wire retrieval into the two agents that needed it (Forensic Analyst, Compliance Officer) without complicating the others.
- Plan the observability surface as a first-class deliverable. The activity log was not an afterthought; it was the audience's proof that the agents were real. For a live demo, observability is part of the user experience.
- Validation with corrective retry beats perfect prompting. Let the model fix its own structured output errors when the schema permits.
- Specialize and route. The Connected Agents pattern works well for clear role separation. Don't try to make one agent do everything; give each agent a tight remit and a clear handoff.
- Keep a terminal-driven backup surface. When the live demo gods are unhappy, falling back to a CLI is a graceful recovery path. The CLI orchestrator and the Chainlit UI in this project share the same agent functions, so either surface tells the same story.
Why Microsoft Foundry Agent Service Was the Right Fit
Foundry Agent Service was the right home for this build because:
- Connected Agents maps cleanly onto a party-of-agents game design.
- Model Router gives one endpoint that picks the right backing model per agent without rebuilding clients.
- Azure AI Search with agentic retrieval is first-class — no separate retrieval service to provision.
- Azure Entra ID integration means the entire stack runs under enterprise SSO with no token juggling.
- Streaming responses from Azure OpenAI deployments work cleanly with Python's async generators, which made the activity log timing events trivial to wire up.
The full stack — Foundry Agent Service, Azure OpenAI, Azure AI Search, and Azure Storage — sits inside a single resource group, which made teardown between dry runs trivial.
Join and watch live to learn more how we tackle the Agents League Challenges https://developer.microsoft.com/en-us/reactor/events/26942/
Try It Yourself
The repository is open source. Clone it and follow the README:
git clone https://github.com/lwhieldon/msft-enterprise-learning-agent.git
cd msft-enterprise-learning-agent
python -m venv .venv
.\.venv\Scripts\activate
pip install -r requirements.txt
chainlit run app.py -w
Three pre-built scenarios ship with the repo (Default, Supply Chain, Vishing). The Generate button creates new ones live.
If you build on top of this, want to compare notes on multi-agent design, or want to swap reasoning-agent war stories, I am @Lwhieldon on GitHub and Lee Whieldon on LinkedIn.
Thanks to Lee Stott and Carlotta Castelluccio at Microsoft for hosting the Reactor battle and giving these projects a stage.
About the author. Lee Whieldon is a Principal at SC&H Group, leading the Data Analytics & AI advisory practice. She works at the intersection of structured data, reasoning agents, and enterprise delivery.