Designing Security for Agents
This lesson explains identity, least privilege and platform controls for securing agents.
Learning outcomes
After completing this lesson, you will be able to:
- Explain user and agent identity choices.
- Apply least privilege to knowledge and tools.
- Describe the platform controls for agent security.
Identity and authentication
Security starts with identity: who is using the agent, and whose permissions does the agent use when it acts? For users, Copilot Studio agents can require authentication with Microsoft Entra ID or with a manually configured identity provider, or allow anonymous use. Agents that reach business data should authenticate users, and data policies can block unauthenticated chat in an environment. For the agent itself, Microsoft Entra Agent ID provides an identity type for agents: Foundry provisions agent identities automatically, as service principals created under an agent blueprint, and a new agent identity has no permissions until access is granted through Azure role-based access control or the target service's own authorization. Agent identities appear in the Microsoft Entra admin center and can be governed with Conditional Access, ID Protection, owners, sponsors and expiry.
The central design decision for each tool is whether it acts with the user's identity (delegated access) or the agent's or maker's identity. Delegated access preserves each user's permissions in the target system and is the safer default. A shared identity is sometimes necessary, for example for event triggers, which authenticate only with the maker's account, but it must be narrowly scoped, because every user of the agent effectively acts with it.
Least privilege and data exposure
An agent can reveal everything its knowledge and tools can reach, so least privilege applies to both.
- Scope knowledge sources to the content the agent's purpose needs, and review SharePoint permissions for oversharing before connecting a site.
- Do not upload confidential files to agents with broad audiences, because uploaded files are available to every user of the agent.
- Give tools only the operations they need, and return only the fields users need.
- Store secrets, such as API keys and computer use credentials, in Azure Key Vault rather than in configuration.
- Use dedicated service accounts for automation, never personal administrator accounts.
Platform controls
Microsoft provides layered controls that an architect combines. The following table summarizes the main ones.
| Control | What it protects |
|---|---|
| Data policies in the Power Platform admin center | Block or group connectors, HTTP, channels, unauthenticated chat, event triggers and knowledge sources |
| Managed environments | Sharing limits, usage insights, solution checker and stronger administration for production environments |
| Network isolation | Virtual network support for Power Platform and private endpoints for Foundry, so traffic to data stays private |
| Content moderation and guardrails | Filtering of harmful content and Prompt Shields in Copilot Studio and Foundry |
| Runtime threat protection | Microsoft Defender integration that can inspect agent tool use in real time and block risky actions |
| Microsoft Purview | Sensitivity labels, data loss prevention, auditing and retention for AI interactions |
Runtime protection with Defender, where it is used, should be designed with its behaviour in mind: Microsoft documents that real-time protection for Copilot Studio agents fails open if the check does not respond within one second, so it supplements, rather than replaces, least privilege and data policies.
Securing an HR agent
An HR agent in Copilot Studio answers policy questions from a SharePoint site and retrieves employees' own leave balances from the HR system. The maker connected the HR system with their own HR administrator account so that the tool would work for everyone, and the agent allows anonymous chat on the intranet. What should you recommend?
Anonymous chat must be replaced with Microsoft Entra authentication, because the agent returns personal data. The leave balance tool must not use the HR administrator's account, because every user would act with administrator rights and could retrieve any employee's balance. It should use the employee's own credentials, so the HR system returns only that employee's data, or, if that is not possible, a dedicated account restricted to a self-service API that filters by the authenticated user. The SharePoint site should be reviewed for overshared documents, and the environment's data policies should block unauthenticated chat.
What permissions does a new Microsoft Entra agent identity created by Foundry have?
Show answer
None. Access must be granted through Azure role-based access control or the target service's own authorization.
Exam Tips
Remember for the exam
- Decide per tool whether it uses the user's identity or a shared identity; delegated is the safer default.
- Microsoft Entra Agent ID gives agents identities with no permissions until granted.
- Apply least privilege to knowledge and tools; store secrets in Key Vault.
- Combine data policies, managed environments, network isolation, guardrails, Defender and Purview.