Designing Model Security
This lesson explains how to protect model deployments, custom models and training data.
Learning outcomes
After completing this lesson, you will be able to:
- Identify the assets and threats in model security.
- Describe identity, network and content controls for models.
- Explain controls across the custom model lifecycle.
What needs protecting
Model security covers several assets. The model deployments are endpoints that consume quota and money and can process sensitive data. Custom and fine-tuned models embody the organization's data and investment, and their weights should not leak. Training and evaluation data may contain confidential or personal information. System prompts and configuration may reveal business logic. Threats include unauthorized use of endpoints, data exfiltration through prompts and outputs, attempts to extract training data or model behaviour, abuse that exhausts quota or budget, and supply chain risk from models obtained outside trusted catalogues.
Controls
A model security design combines identity, network, content and supply chain controls.
- Keyless authentication: applications and agents call model deployments with Microsoft Entra identities and Azure role-based access control, such as the Foundry User role, rather than with shared API keys.
- Least-privilege roles: separate who can deploy and fine-tune models from who can only call them.
- Network isolation: private endpoints and disabled public network access keep model traffic on private networks.
- Guardrails: content filters and Prompt Shields screen inputs and outputs for harmful content and attacks.
- Rate and token limits: quotas per deployment and, for shared models, an AI gateway in Azure API Management that enforces token limits per consumer.
- Trusted sources: use models from the Foundry catalogue or approved registries, and record each model's provenance.
- Monitoring: trace and log model use, and use Microsoft Defender threat protection for AI workloads to detect attacks.
Protecting custom models and their data
Custom models need additional care, because their value and risk come from the organization's data. The following table summarizes controls across their lifecycle.
| Stage | Control |
|---|---|
| Training data | Restricted storage, private access, removal of unnecessary personal data, separate access from model users |
| Training | Training type chosen for residency; jobs run with managed identities |
| Model artifacts | Access limited to the team that deploys them; versions recorded |
| Deployment | Keyless access, private endpoints, guardrails, quotas |
| Use | Outputs checked for leakage of training data; abuse monitoring |
Securing a shared model platform
A company's data science team exposes a fine-tuned model in Foundry to 15 internal applications. All applications use the same API key, which has appeared in a public code repository. One application recently consumed the whole quota with a runaway loop. What should you recommend?
The exposed key must be regenerated immediately. The design should move to keyless authentication, with each application using its own managed identity and a role that allows calling but not managing the model. Placing the model behind an AI gateway in Azure API Management gives each application its own token limit, so one runaway client cannot exhaust the shared quota, and records usage per consumer. Private endpoints should restrict network access, and guardrails should apply to inputs and outputs.
Why prefer keyless Microsoft Entra authentication to API keys for model deployments?
Show answer
Keys can leak and are shared by every caller; identities with roles give per-caller, revocable, least-privilege access.
Exam Tips
Remember for the exam
- Protect deployments, custom models, training data and system configuration.
- Use keyless Microsoft Entra authentication with least-privilege roles instead of shared keys.
- Use private endpoints, guardrails and token limits through an AI gateway.
- Use trusted model sources and monitor with Defender threat protection for AI.