Implementing Conditional Access
This lesson explains how Conditional Access policies are built, how to deploy them safely, and how session controls limit stolen tokens.
Learning outcomes
After completing this lesson, you will be able to:
- Describe the parts of a policy and how matching policies combine.
- Explain report-only mode and emergency access accounts.
- Distinguish user risk from sign-in risk.
- Compare sign-in frequency, continuous access evaluation and token protection.
How a policy works
Conditional Access takes signals about a sign-in and decides how to respond. It runs after first-factor authentication, so it cannot stop an attacker from trying a password. It requires Microsoft Entra ID P1, and risk-based conditions need ID Protection, a P2 capability. A policy reads as an if-then statement: if these users access these resources under these conditions, then apply these controls.
The following table lists the parts of a policy.
| Part | Options | Notes |
|---|---|---|
| Users, agents or workload identities | Users, groups, directory roles, guests, agents and workload identities | Exclusions take precedence over inclusions. |
| Target resources | Resources, user actions, or authentication context | Microsoft Graph cannot be selected as a target application. |
| Conditions | User risk, sign-in risk, device platforms, locations, client apps and filters for devices | All configured conditions must match. |
| Grant controls | Block, or grant with MFA, authentication strength, compliant device, hybrid joined device, approved client app, app protection policy, password change or terms of use | Several controls can be required together, or any one of them. |
| Session controls | Sign-in frequency, persistent browser session, app enforced restrictions, token protection and others | These limit a session that has been granted. |
Every policy that matches is applied, and the result is the combination of all of them. If any matching policy blocks, access is blocked, whatever the other policies grant. There is no priority order, unlike firewall rules, so a block in one policy cannot be overridden by an allow in another.
The following diagram shows a policy as an if-then statement.

Deploying without locking people out
A mistaken policy can lock an entire organization out of its tenant, including its administrators. Three practices prevent this. First, keep two emergency access accounts, sometimes called break-glass accounts, excluded from policies that could lock them out, protected by a phishing-resistant method and monitored for any use. Second, use report-only mode, which evaluates a policy at each sign-in and records the result without enforcing it. Third, examine the results in the Conditional Access insights and reporting workbook, or use the What If tool to test a specific user and condition.
Policies usually progress from report-only to enabled for a pilot group, and then to everyone. Templates offer common designs, and the Conditional Access Optimization Agent in Security Copilot can suggest changes to coverage.
Safe deployment
Common policy designs
Several designs appear repeatedly. Block legacy authentication matters because older protocols such as POP and IMAP cannot perform multifactor authentication, so a policy that targets client apps other than modern clients closes that gap. Require a compliant device uses Microsoft Intune state to check that the device meets policy, which also blocks a phished credential used from an attacker's machine. Named locations label IP ranges or countries, and they can block or relax requirements, although a location alone is weak evidence of identity.
Risk-based policies use signals from ID Protection. Sign-in risk is the probability that a specific sign-in is not legitimate, such as one from an anonymous address. User risk is the probability that the account is compromised, such as leaked credentials. A typical design requires multifactor authentication for medium sign-in risk and a secure password change for high user risk.
User actions are a special target. Register security information protects the moment at which a person adds a method, because an attacker with a stolen password would otherwise add their own. Register or join devices protects device registration, and it allows only multifactor authentication or authentication strength as controls.
Authentication context protects a specific sensitive action rather than a whole application. A tenant can define up to 99 contexts, labelled c1 to c99. For example, a context can demand a compliant device before a user activates a role in PIM, or before opening a labelled SharePoint site.
Designing policies
Session controls and token theft
Granting access is not the end of the matter, because a token remains valid after it is issued. Sign-in frequency sets how often users must reauthenticate, in hours or days, or every time. Persistent browser session decides whether a browser session survives being closed.
Continuous access evaluation lets a resource provider receive critical events and reject a token before it expires. Critical events include the deletion or disabling of a user, a password change or reset, administrator revocation of refresh tokens, and high user risk. Events can take up to 15 minutes to take effect, and IP location enforcement is instant. Because revocation is now possible, CAE sessions can hold tokens for up to 28 hours. Supported services include Exchange Online, SharePoint Online, Teams and Microsoft Graph, and location policy works only with IP-based named locations.
Token protection binds a token to the device on which it was issued, so a stolen token cannot be replayed from elsewhere. It is available for native applications on Windows and on Apple platforms, for resources such as Exchange Online, SharePoint Online and Teams, and it should be tested in report-only mode, because unsupported clients will be blocked.
Session controls
Conditional Access for workload identities
Service principals can also be targeted, which matters because they do not perform multifactor authentication. A policy can block a single-tenant service principal when it signs in from outside known locations, or when its risk is high. This feature has its own licensing, Microsoft Entra Workload ID, and it does not apply to managed identities. Agents have their own treatment, which is covered in the lesson on Conditional Access for agent identities.
Reacting to a sign-in from a stolen token
An investigation shows that an attacker replayed a stolen session token for a finance user on a Windows device, after the user had passed multifactor authentication. The company uses Microsoft Entra ID P2, and all finance staff use compliant Windows devices with the native Microsoft 365 applications. The company wants to prevent a stolen token from being used on another device. What should you configure?
The attack did not defeat authentication, so a stronger sign-in method alone would not stop replay. The decisive requirement is that a token must not work on another device, which is exactly what token protection provides. Deploy a Conditional Access session control in report-only mode for the finance group and the supported resources, confirm that nothing important breaks, and then enable it.
Reducing sign-in frequency shortens the window but does not prevent replay. A risk-based policy might detect an anomaly, but it would not bind the token. Requiring a compliant device is valuable for sign-in, but a token that has already been issued would not be evaluated again at the moment of replay.
One policy grants access with MFA, and another matching policy blocks the same user. What happens?
Show answer
Access is blocked. All matching policies apply, and a block overrides any grant.
Exam Tips
Remember for the exam
- All matching policies apply, and a block always wins.
- Use report-only mode and What If before enforcing a policy.
- Exclude and monitor two emergency access accounts.
- Sign-in risk concerns one sign-in; user risk concerns the account.
- Token protection stops replay; sign-in frequency only narrows the window.