AI-500 security and deployment explained
The secure, govern and deploy domain is 20-25% of AI-500. It asks how agents prove who they are, what they may touch, how their inputs and outputs are checked and how new versions reach production safely. Microsoft’s outline groups it into security, guardrails and deployment. Because agents act, not just answer, security errors here are action errors, and the exam rewards least privilege and layered checks.
Security
Resource access. Prefer identity-based access (managed identities and Microsoft Entra) over keys, add network boundaries (private endpoints, restricted egress), set access control policies and use RBAC with the narrowest role at the narrowest scope.
Authentication flows. Know when each applies:
| Flow | Use when |
|---|---|
| User impersonation | The agent acts as the signed-in user with their own permissions |
| On-behalf-of | A service calls a downstream API for the user, keeping the user’s identity and consent |
| OAuth 2.0 | Delegated access to APIs with scoped tokens |
| API keys | Simple service access; the weakest option, needing rotation and protection |
A common scenario: an agent must read only what the requesting user may read. The answer is a flow that carries the user’s identity (on-behalf-of), not a powerful service account that bypasses user permissions.
Secrets. Azure Key Vault for secrets, certificates and keys, with role-based access to secrets, rotation and encryption. Agents fetch secrets at runtime with their own identity; secrets never go in prompts, code or logs.
Shift-left. Test security before release, including with the AI Red Teaming Agent in Foundry, which probes your solution for weaknesses such as prompt injection.
Guardrails
A multi-intervention strategy checks at four points: user inputs, tool calls, tool responses and outputs. Indirect prompt injection arrives through tool responses and retrieved documents, so checking only the user’s message is not enough. Add custom guardrails for domain-specific constraints, such as no financial advice or no personal data in answers. Test guardrails with synthetic data, including adversarial cases, and measure both missed attacks and wrongly blocked legitimate requests.
Deployment
- Release methodology: DTAP (development, test, acceptance, production) for controlled promotion; blue/green for a switch between two full environments; canary for gradual exposure.
- Multi-environment strategy: rollback strategy, release management and rollout controls for each environment.
- Testing: unit, regression and integration tests plus automated evaluations. In agent systems, an evaluation suite is a release gate because behavior can change without code changing.
- CI/CD: requirements for integration and release, with infrastructure as code deployments and tests in the pipeline.
Common traps
- A powerful shared service account because it is easy.
- Storing a key in an environment variable in the repository.
- Guardrails only on the final answer.
- Promoting a new prompt or model to production with no evaluation gate or rollback.
Three practice questions
Question 1. An agent answers questions from a document store where each user may see only some documents. How should it authenticate to the store?
- A. A shared administrator account
- B. An anonymous public endpoint
- C. One API key for all requests
- D. An on-behalf-of flow that carries the user’s identity
Show answer
Answer: D
An on-behalf-of or user-delegated flow carries the requesting user’s identity, so the store enforces that user’s permissions. A shared administrator account bypasses per-user permissions, an anonymous endpoint exposes everything, and a single API key cannot distinguish users.
Want more questions like this? Full AI-500 practice tests →
Question 2. Retrieved web pages may contain hidden instructions that try to make an agent leak data. Which guardrail design addresses this best?
- A. Check tool responses and retrieved content as well as inputs and outputs
- B. Check only the final answer
- C. Trust retrieved content because it comes from your own search
- D. Remove all tools and retrieval
Show answer
Answer: A
Indirect injection enters through tool responses and retrieved content, so those must be checked as well as user inputs and outputs. Checking only the final answer lets the agent act on the injected instruction first, and trusting retrieved content or removing tools do not solve the issue.
Want more questions like this? Full AI-500 practice tests →
Question 3. A team changes the system prompt of a production agent workflow. What release practice best limits risk?
- A. Edit the prompt directly in production
- B. Run automated evaluations, release as a canary and keep a rollback path
- C. Skip tests because only text changed
- D. Release to every user at once at night
Show answer
Answer: B
Treat the prompt like code: run automated evaluations as a gate, release gradually with a canary and keep a rollback path. Editing production directly has no gate, skipping tests relies on luck, and releasing to everyone at once removes gradual exposure.
Want more questions like this? Full AI-500 practice tests →
Check the prerequisites or return to the study plan.