The same platform on Microsoft Foundry
Microsoft Foundry (formerly Azure AI Foundry) is Microsoft's platform for building and running AI applications and agents. This build keeps the contracts from the overall design and maps each part onto a Foundry or Azure service. It suits teams already standardised on Azure and Entra ID.
| Design part | In Microsoft Foundry |
|---|---|
| Orchestrator and agents | Foundry agents in a project, with instructions and tools. A thin service in front handles intake and the pipeline |
| Models | Model deployments in the project, reached through the enterprise AI gateway for scanning and budgets |
| Terms index | Azure AI Search index (now presented as Foundry IQ) with a knowledge tool on the agent, filtered by jurisdiction and date |
| Tool gateway | The player-protection API (Application Programming Interface) as an OpenAPI tool, or the MCP (Model Context Protocol) gateway attached as an MCP tool |
| Identity | Microsoft Entra ID, managed identities and role-based access control; no keys in code |
| Safety | Foundry content filters and guardrails, in addition to Prisma AIRS at the gateway |
| Tracing and evaluation | OpenTelemetry traces to Application Insights, and Foundry evaluators for agents |
Build steps
1 · Create the project
One Foundry project per environment, with a managed identity and role assignments for search, storage and the platform API.
2 · Deploy models
Deploy the small and reasoning models and point the project at the enterprise gateway so every call is scanned and budgeted.
3 · Build the terms index
Load terms and house rules into Azure AI Search with jurisdiction and effective-date fields, and attach it as the agent's knowledge tool.
4 · Register tools
Describe the evidence, proposal and approval-gated operations as an OpenAPI tool. Goodwill and restrictions require an approval token issued by a supervisor or specialist.
5 · Create the agents
Write instructions, attach tools and run a thread per case.
6 · Trace and evaluate
Turn on tracing, run agent evaluators on the shared evaluation set and gate releases on the result.
Creating the agent
A sketch with the Azure AI Projects SDK (Software Development Kit). The SDK changes quickly, so confirm the current class and method names. The important points are the identity, the read-only tool set and the thread per case.
from azure.identity import DefaultAzureCredential
from azure.ai.projects import AIProjectClient
project = AIProjectClient(
endpoint=os.environ["FOUNDRY_PROJECT_ENDPOINT"],
credential=DefaultAzureCredential(), # managed identity in Azure, your login locally
)
agent = project.agents.create_agent(
model="mb-reasoner", # deployment name, routed through the gateway
name="support-copilot",
instructions=open("prompts/support_copilot.md").read(),
tools=[SEARCH_TERMS_TOOL, BETTING_OPENAPI_TOOL], # rules from AI Search, evidence via OpenAPI (read only)
)
def answer_agent(thread_id: str | None, question: str):
thread = project.agents.threads.get(thread_id) if thread_id else project.agents.threads.create()
project.agents.messages.create(thread_id=thread.id, role="user", content=question)
run = project.agents.runs.create_and_process(thread_id=thread.id, agent_id=agent.id)
return thread.id, runThe agent answers and drafts. The service controls when an approval token exists, so the copilot cannot grant goodwill on its own initiative.
Keeping players safe
- The agents can read evidence and propose. Goodwill, restrictions and messages are separate operations that need an approval token or an approved template.
- The platform API authorises by the acting person or rule, not by anything in the prompt, and no tool accepts bets, sets odds or moves money.
- Tool outputs are structured; free-text player notes are not fed back to the model.
- The Prisma AIRS profile from the previous page is attached at the gateway, so Foundry's own filters are a second layer.
- Handoff is a tool that creates a task for the review desk with the case attached.
Evaluation in Foundry
| What is measured | Evaluator | Threshold |
|---|---|---|
| Did the agent understand the question | Intent resolution | At least 0.9 on the set |
| Did it call the right tool with the right arguments | Tool call accuracy | At least 0.95 |
| Did it follow its instructions and policies | Task adherence | At least 0.95 |
| Are rule statements supported by the sources | Groundedness | At least 0.9 |
| Is anything unsafe, leaked or encouraging play | Safety evaluators and a custom check | Zero failures |
Thresholds are illustrative. Set them from your own baseline and review them as the set grows.
When to choose it
| Choose Foundry when | Choose another build when |
|---|---|
| The organisation standardises on Azure, Entra ID and Application Insights | You need to control the graph and its checkpoints in code |
| Managed hosting of agent threads and tools is a benefit | You need to run the agents in a network where Foundry is not available |
| Security and operations teams already work in Azure tools | Your evaluation and tracing tools are built around another stack |
Build this for your business
This example is a player protection and operations platform for a licensed betting operator, but the same pattern, deterministic rules for every hard duty, a governed gateway, runtime security, protect-first automation and measured quality, fits any regulated, customer-facing service. We can scope a pilot on your own systems.
Book a discovery call