Securing Agents with Identity, RBAC and Network Boundaries
This lesson covers identity-based access, Azure RBAC for Foundry and related services, network boundaries and policy-based controls, which make every agent, tool and data store reachable only by the right principals over the right networks.
Learning outcomes
After completing this lesson, you will be able to:
- Replace shared keys with managed identities and Entra ID tokens.
- Assign Azure RBAC roles at the right scope.
- Enforce network boundaries with private endpoints and Azure Policy.
Identity-based access
Identity-based access replaces shared keys with Microsoft Entra ID tokens. Agents and services use managed identities (system-assigned for a single resource, user-assigned when several resources or a stable identity across redeployments are needed) or Foundry agent identities. People sign in with their own accounts. Key-based authentication is disabled where possible: Foundry resources support disableLocalAuth, Azure AI Search supports role-based access only, and Storage supports disabling shared key access. Code uses DefaultAzureCredential in development and a specific credential such as ManagedIdentityCredential in production.
Keyless access
Role-based access control
Azure RBAC assigns roles to principals at a scope: management group, subscription, resource group, resource or, for some services, a child item. Foundry has its own roles. Foundry User grants data-plane use of projects, agents and models; Foundry Project Manager also allows managing projects and assigning Foundry User; Foundry Account Owner manages the resource without data actions; Foundry Owner has full access. Related services have data-plane roles such as Search Index Data Reader, Storage Blob Data Reader, Cosmos DB Built-in Data Reader and Key Vault Secrets User.
The following table shows a least-privilege assignment for a typical agent solution.
| Principal | Role | Scope |
|---|---|---|
| Orchestrator's managed identity | Foundry User | The Foundry project's resource |
| Retrieval agent's identity | Search Index Data Reader | The search service (or index) |
| Tool function's identity | Key Vault Secrets User | The single secret it needs |
| Developers | Foundry User | Development project only |
| Deployment pipeline | Contributor and role assignment rights | The environment's resource group |
Least-privilege role assignments
Network boundaries and access control policies
Private endpoints give a service a private IP address in a virtual network, and disabling public network access ensures traffic cannot arrive from the internet. Foundry supports private endpoints and, for Agent Service, virtual network injection so that agents reach private resources. Network security perimeters group PaaS resources and control traffic between them and the outside. Private DNS zones resolve service names to private addresses.
Access control policies complete the picture: Azure Policy denies or audits non-compliant configurations (for example, Foundry resources with public access or local authentication enabled), Conditional Access requires compliant devices or multifactor authentication for people, and document-level security filters restrict retrieval results.
Network control or policy control?
Locking down a solution
A health insurer's agent solution uses Foundry, Azure AI Search and Cosmos DB. Requirements: no traffic over the public internet, no keys anywhere, and a guarantee that future resources follow the same rules.
Use private endpoints with public network access disabled on all three services, virtual network injection for Agent Service, managed identities with data-plane roles instead of keys, and local authentication disabled. Azure Policy assignments that deny public access and local authentication enforce the rules for future resources. A firewall rule allowing only the company's IP ranges would still use the public endpoint.
How is public network access kept disabled on resources created later?
Show answer
With Azure Policy, which enforces the setting for new resources.
Exam Tips
Remember for the exam
- Disable keys and use managed identities or agent identities with RBAC.
- Foundry roles: User, Project Manager, Account Owner (no data actions), Owner.
- Private endpoints plus public access disabled; Azure Policy enforces it for new resources.