If your organization uses Copilot in Microsoft 365, you may need to control how long user prompts and responses are stored. By default, Microsoft retains this data for a set period, but many businesses require shorter or longer retention to meet compliance or security policies. This article explains how to configure Copilot prompt logging retention using the Microsoft 365 admin center and PowerShell. You will learn the exact steps to set the retention period and verify the change.
Key Takeaways: Configuring Copilot Prompt Logging Retention
- Microsoft 365 admin center > Copilot > Audit log retention: Sets how long Copilot prompt and response data is stored in the audit log.
- PowerShell cmdlet Set-AdminAuditLogConfig: Allows you to set a custom retention period from 1 to 365 days.
- Microsoft Purview compliance portal > Data lifecycle management: Enables retention labels and policies for Copilot data beyond the audit log default.
How Copilot Prompt Logging Retention Works
When users interact with Copilot in Microsoft 365 apps, each prompt and the generated response are logged in the Microsoft 365 audit log. The audit log records the user identity, the exact prompt text, the response, and a timestamp. This data is subject to the retention policies you configure.
The default retention period for audit logs is 180 days for organizations with an Office 365 E5 or Microsoft 365 E5 license. For other licenses, the default is 90 days. Copilot prompt data follows these same defaults unless you set a custom retention policy. You can extend or shorten this period using the Microsoft 365 admin center or PowerShell. The retention setting applies to all Copilot prompts across all Microsoft 365 apps, including Word, Excel, PowerPoint, Teams, and Outlook.
Before you change the retention period, confirm that your organization has the required license. The ability to set custom audit log retention requires an Office 365 E5 or Microsoft 365 E5 license, or an add-on license such as Microsoft 365 E5 Compliance. Organizations with lower-tier licenses can only use the default retention period.
Steps to Set Copilot Prompt Logging Retention Using the Admin Center
The Microsoft 365 admin center provides a graphical interface to configure audit log retention. This method is suitable for administrators who prefer not to use PowerShell.
- Sign in to the Microsoft 365 admin center
Open a web browser and go to https://admin.microsoft.com. Sign in with an account that has the Global Administrator or Compliance Administrator role. - Navigate to the Copilot settings
In the left navigation pane, select Settings then Org settings. Under the Services tab, scroll down and click Copilot. - Open the Audit log retention section
In the Copilot settings page, find the section labeled Audit log retention. This section may appear as a separate tab or a collapsible panel depending on your admin center layout. Click Edit or Change to modify the retention period. - Set the retention period
Enter a number between 1 and 365 in the Days field. For example, enter 90 to retain Copilot prompt data for 90 days. You cannot set a period longer than 365 days through this interface. If you need longer retention, use PowerShell or configure a retention label in the Microsoft Purview compliance portal. - Save the setting
Click Save to apply the change. The new retention period takes effect immediately for all new Copilot prompts. Existing audit log entries are not affected retroactively. They are retained according to the previous policy until their original retention period expires.
Steps to Set Copilot Prompt Logging Retention Using PowerShell
PowerShell provides more flexibility for setting retention, especially if you need to apply the same setting across multiple tenants or automate the configuration. Use the Exchange Online PowerShell module.
- Install and connect to Exchange Online PowerShell
Open Windows PowerShell as an administrator. Run the command Install-Module -Name ExchangeOnlineManagement if you have not installed the module. Then run Connect-ExchangeOnline and sign in with your Global Administrator or Compliance Administrator credentials. - Check the current retention setting
Run the cmdlet Get-AdminAuditLogConfig | fl AuditLogRetentionPeriod. This displays the current retention period in days. Note this value before making changes. - Set the new retention period
Run the cmdlet Set-AdminAuditLogConfig -AuditLogRetentionPeriod 90 to set retention to 90 days. Replace 90 with any number from 1 to 365. The change applies immediately. - Verify the change
Run Get-AdminAuditLogConfig | fl AuditLogRetentionPeriod again to confirm the new value. If you see the expected number, the configuration is complete. - Disconnect the session
Run Disconnect-ExchangeOnline to close the PowerShell session. This is a security best practice.
Common Issues When Configuring Copilot Prompt Logging Retention
Copilot prompt data still appears after the retention period expires
This can happen if you have a separate retention policy in Microsoft Purview that overrides the audit log retention. For example, if you applied a retention label to Copilot data with a longer period, that label takes precedence. Check the Microsoft Purview compliance portal under Data lifecycle management > Retention policies for any policies that include Copilot or Teams messages. If a conflicting policy exists, adjust its retention period to match your desired setting.
Cannot set a retention period longer than 365 days
The audit log retention setting in both the admin center and PowerShell has a hard limit of 365 days. If your organization requires longer retention, you must use a retention label or policy in Microsoft Purview. Create a custom retention label that applies to Copilot prompt data and set the retention period to the number of years you need. Then publish the label using a retention policy. Note that this method retains the data separately from the audit log and may incur additional storage costs.
Copilot prompt data is not logged at all
If no Copilot prompt data appears in the audit log, the audit log might be disabled for your tenant. Go to the Microsoft 365 admin center > Settings > Org settings > Audit log and ensure the toggle for Audit log is turned on. Also verify that the user performing the Copilot action has an appropriate license that includes audit logging, such as Office 365 E5 or Microsoft 365 E5.
Admin Center vs PowerShell: Key Differences for Configuring Retention
| Item | Admin Center | PowerShell |
|---|---|---|
| Setup time | 5 minutes | 10 minutes including module installation |
| License requirement | Office 365 E5 or Microsoft 365 E5 | Office 365 E5 or Microsoft 365 E5 |
| Maximum retention | 365 days | 365 days |
| Automation support | No | Yes, for multi-tenant deployments |
| Audit log export | Not available | Exportable via Get-AdminAuditLogConfig |
You can now configure Copilot prompt logging retention in your Microsoft 365 tenant using either the admin center or PowerShell. Start by checking your current retention period with the Get-AdminAuditLogConfig cmdlet. For retention beyond 365 days, create a custom retention label in the Microsoft Purview compliance portal. Always test the configuration with a single user before applying it organization-wide to avoid unintended data loss.