Skip to the road
Adminpatchlog

Microsoft 365 & SharePoint

Microsoft Entra Agent ID Cleanup: Default Timelines, Custom Policies and Admin Checks

kanaga 594 travellers

Microsoft Entra can notify, disable and delete inactive agent identities. Review its fixed 60, 90 and 455-day schedule, or configure custom thresholds and actions.

Microsoft Entra Agent ID Cleanup: Default Timelines, Custom Policies and Admin Checks

Cleanup Inactive Agent IDs with Lifecycle Workflows in Microsoft Entra

Default agent identity inactivity lifecycle policy

AI agent identities can outlive the projects that created them. Microsoft Entra’s Agent ID lifecycle policies give administrators a way to find inactive identities, notify the people responsible for them, and eventually disable or delete them. That can reduce access left behind by completed pilots, retired test agents and older agents replaced by newer versions.

The built-in policy is free and follows a fixed schedule. Organizations that need different inactivity thresholds, cleanup actions or grace periods can create custom policies, subject to licensing requirements. Agent ID lifecycle policies are in preview: Microsoft provides no Service Level Agreement (SLA) and does not recommend them for production workloads.

Enable the inactivity agent cleanup policy

What the lifecycle rules cover

Each agent registered in Microsoft Entra Agent ID has its own identity to manage until the agent is retired. Microsoft Entra lifecycle policies address that management through three rules:

  • Sponsor must be present: Each agent must have at least one sponsor responsible for it.
  • Periodic reconfirmation: Sponsors periodically confirm that their agents are still needed.
  • Agent ID activity requirement: Microsoft Entra checks whether an agent has been active within a configured period, then starts the specified cleanup action if it has not.

The activity rule drives inactive identity cleanup. Policies check agent token activity over the configured period, notify sponsors and owners, and can disable or delete identities. This is useful for agents tied to finished pilots, development and troubleshooting work, or superseded implementations that remain enabled.

Exception of agent IDs to exclude from cleanup

For user accounts, administrators already use Microsoft Entra Lifecycle Workflows to automate inactive user management. Agent ID lifecycle policies apply similar lifecycle controls to agent identities.

Roles and licensing

To manage agent lifecycle policies, an administrator needs one of these roles: Lifecycle Workflows Administrator, AI Administrator, Agent ID Administrator or Global Administrator.

Set up notification email address to notify inactive agents cleanup

The licensing requirement depends on the policy type. The default inactivity policy requires no premium license. Custom lifecycle policies require either Microsoft 365 E7, which includes Agent 365 and Microsoft Entra Suite, or Microsoft Agent 365 paired with at least Microsoft Entra ID P1 or Microsoft 365 E3.

The default policy’s fixed schedule

The Default Agent Identity Inactivity Lifecycle Policy applies three milestones, which administrators cannot customize:

Select scope on custom cleanup policy
  • At 60 days: Microsoft Entra notifies the agent’s owners and sponsors. This begins a 30-day grace period for review.
  • At 90 days: If nobody takes action, Microsoft Entra disables the agent identity and revokes its access.
  • At 455 days: Microsoft Entra deletes the identity through soft deletion, 365 days after disablement.

The policy can send up to three notifications: one when the grace period begins, another when the identity is disabled, and a final notification when it is deleted. During the grace period, a sponsor can disable an agent immediately if it is no longer needed. If the agent remains necessary, using it to trigger a new token issuance resets its inactivity period.

To enable the default policy, sign in to the Microsoft Entra admin center and go to ID Governance > Lifecycle workflows > Lifecycle Policies > Agent ID (Preview). Open the default policy, review its overview, then use the Policy Configuration tab to turn on Enable policy.

Enable agent ID activity requirement

Review the scope before saving. By default, the policy targets all agent IDs. To leave selected identities out, choose All Agent IDs except selected, select the identities to exclude, and confirm the selection. Under Notification Schedule, add fallback email recipients for agents without an assigned sponsor or owner. Group mailboxes are supported, but every recipient needs an Exchange license to receive notification email. Review the settings and select Save.

The built-in policy is straightforward to enable, but its inactivity threshold and actions are fixed. Teams whose agents have different operating patterns may need a custom policy.

Set custom thresholds, scope and actions

A custom lifecycle policy lets administrators choose the inactivity duration, cleanup action and grace period. After an agent reaches the configured inactivity threshold, Microsoft Entra notifies its sponsors and owners. The selected action takes effect when the grace period ends.

In the Entra admin center, go to ID Governance > Lifecycle Workflows > Lifecycle Policies > Agent ID (Preview), select New policy, enter a unique name and optional description, and enable the policy. Then choose which agent identities it governs. Scope options include all agent IDs, selected identities, identities from selected platforms, all identities except selected ones, or all identities except those associated with selected platforms.

Manage agents in my account portal

Under Policy rules, enable Agent ID activity requirement and set the inactivity duration. Choose an action: Disable, Delete, or Disable and delete. The combined option disables the identity first and deletes it after the number of days set in the policy.

Administrators can also enable Apply a grace period before taking action and set its duration. Once the inactivity threshold is met, sponsors and owners receive time to review the identity before the action is applied. Check the notification schedule and add fallback recipients for identities without an owner or sponsor, then review the configuration and save.

Keep or disable inactive AI agents

If multiple agent lifecycle policies apply to the same identity, set their priority. When an agent matches more than one policy, the highest-priority policy applies.

What sponsors and owners can do

When an agent meets an inactivity rule, its sponsors and owners receive an email explaining the rule and the action that will follow if they do not respond during the grace period. If no sponsor or owner is assigned, the configured fallback recipients receive the notification.

Recipients can review their assigned identities in the My Account portal. Select Manage agents, then use the Agents you sponsor and Agents you own tabs. The menu appears only for users who sponsor or own at least one agent.

After reviewing an identity, a sponsor or owner can disable it immediately if it is no longer needed. If it is still needed, a sponsor can keep it active by using the agent to trigger a new token issuance, which resets the inactivity period. Sponsors cannot restore identities themselves: an owner or administrator must re-enable a disabled identity or restore a deleted one. A soft-deleted identity can be restored within 30 days of deletion.

Admin checks before enabling cleanup

  • Account for seasonal use. An agent that runs infrequently could meet an inactivity threshold despite still being needed. Exclude it from the default policy or create a custom policy with a longer inactivity period.
  • Close ownership gaps. Assign an owner or sponsor to each agent, and configure monitored fallback recipients for identities without either. Notifications only help when someone responsible receives and reviews them.
  • Stage deletion. For custom policies, consider disabling an identity first and setting a delay before deletion. That gives sponsors time to identify agents that should remain available.
  • Use the other lifecycle rules. Inactivity monitoring, periodic reconfirmation and minimum sponsor requirements can all contribute to agent governance. Each enabled rule is evaluated independently.
  • Update sponsorship during offboarding. If a sponsor leaves or changes roles, an agent may lose the person expected to review its notifications. Add agent sponsor tasks to offboarding workflows. These tasks can notify the manager and cosponsors and transfer sponsorship to the manager as well as the owner.
  • Check audit logs. Review Microsoft Entra records for agent disablement, deletion, and ownership or sponsorship changes. This helps confirm that the intended identities were affected and can surface mistakes while recovery is still possible.

The default policy offers a low-effort starting point, while custom policies let teams match cleanup behavior to how their agents are used. Before enabling either, check the scope, confirm that sponsors and fallback recipients are monitored, and account for agents that may remain idle during normal operation. Because the feature is in preview and has no SLA, that review matters before administrators rely on it for production workloads.

Source: kanaga · blog.admindroid.com

On the same route