# Agent Users should not have privileged directory roles or membership in role-assignable groups (Preview)

Agent Users should not have privileged directory roles or membership in role-assignable groups.

Source: https://maester.dev/docs/tests/MT.1210

<!-- This file is generated by website/scripts/generate-test-docs.mjs. Do not edit manually. -->

<div class="test-byline"><div class="test-byline-avatars"><a class="test-byline-avatar test-byline-avatar--author" href="/contributors/agnivesh" title="Agnivesh S. · Original author"><img src="https://github.com/agnivesh.png" alt="Agnivesh S." width="28" height="28" loading="lazy" decoding="async" /></a></div><div class="test-byline-meta"><span class="test-byline-text">Contributed by <a href="/contributors/agnivesh">Agnivesh S.</a></span><a class="test-byline-link" href="/contributors">All contributors →</a></div></div>

<p class="test-part">Part of <a href="/docs/tests/maester">Maester</a> · Entra ID · Agent identities · <a href="/docs/tests">All checks</a></p>

```powershell title="Run this check"
Invoke-Maester -TestId MT.1210 -IncludePreview
```

## Overview

Agent Users should not have privileged directory roles or membership in role-assignable groups.

An Agent User is an Entra user account created specifically for an AI agent to access services that require user-context authentication (e.g. Teams, Exchange mailboxes, SharePoint sites). Because Agent Users represent non-human workloads, they should never be assigned Entra directory roles or added to role-assignable security groups.

This check inspects all Agent Users in the tenant and verifies that they do not hold privileged directory roles, either active or PIM-eligible, or memberships in role-assignable groups. A PIM-eligible role counts because the Agent User can activate it at any time. Reading eligible assignments needs Microsoft Entra ID P2 or Governance; without it, only active assignments are checked and the result says so.

### Remediation action:

1. Open the [Microsoft Entra admin center][entra-admin-center] and navigate to **Entra ID** > **Users**.
2. Locate the reported Agent User using its **Object ID** or user principal name.
3. Check **Assigned roles** and remove any directory administrative roles. Check both the **Active assignments** and **Eligible assignments** tabs.
4. Check **Groups** and remove the user from any role-assignable security groups.
5. If the agent only requires access to specific mailboxes or SharePoint sites, configure direct resource-level permissions (e.g. Mailbox delegation or SharePoint site sharing) rather than tenant-wide administrator roles.

### Related links

* [Agent User resource overview][agent-user-resource]
* [Role-assignable groups in Microsoft Entra ID][role-assignable-groups]

[entra-admin-center]: https://entra.microsoft.com
[agent-user-resource]: https://learn.microsoft.com/graph/api/resources/agentuser?view=graph-rest-1.0
[role-assignable-groups]: https://learn.microsoft.com/entra/identity/role-based-access-control/groups-concept

## Details

<details>
<summary>Every attribute of this check</summary>

| Field | Value |
| --- | --- |
| Test ID | MT.1210 |
| Severity | High |
| Suite | Maester |
| Product | Entra ID |
| Feature | Agent identities |
| Area | Privileged access |
| Resource type | Agent |
| User impact | Low |
| Implementation cost | Medium |
| MITRE ATT&CK | T1078.004 Cloud Accounts, T1098.003 Additional Cloud Roles |
| Supports controls | nist-800-53-r5:AC-6(5) |
| PowerShell test | [Test-MtEntraAgentUserExcessiveAccess](https://github.com/maester365/maester/blob/main/tests/maester/entra/Test.MT.1210.ps1) |
| Services | Graph |
| Lifecycle | Preview |
| Long running | Yes |

</details>

## Source

- Test: [`tests/maester/entra/Test.MT.1210.ps1`](https://github.com/maester365/maester/blob/main/tests/maester/entra/Test.MT.1210.ps1)
- Documentation: [`tests/maester/entra/Test.MT.1210.md`](https://github.com/maester365/maester/blob/main/tests/maester/entra/Test.MT.1210.md)
