Retention Periods
Each workspace has one active retention period:- 14 days
- 30 days
- 90 days
- Forever (default)

Configuring the Policy
- Open Settings for the workspace you want to configure.
- Select Configure Retention Policy from the Workspace section.
- Choose a retention period from the dropdown.
- Click Save retention policy.
- Review the change in the confirmation dialog, then click Confirm Change.


Only workspace admins can change the retention policy. Other members can see
the current period, but the selector and Save button are disabled for
them.
How Retention Applies
Retention is bound to each record when it is logged. The workspace’s retention period at the time a request or trace is ingested determines when that record expires.- Changing a workspace’s policy only affects newly ingested data. Records already logged keep the retention they were assigned when they were written.
- Records on a finite period are hidden from search and views as soon as they pass their retention window, and are then permanently deleted in the background.
- Records logged under Forever never expire.
”Before retention policy” Records
When a workspace has always been on Forever, no policy has ever been set and nothing needs explaining. But once you enable a finite period, you may notice older records that predate that change still showing up in your logs and traces. These records were logged during the workspace’s original “forever” era, so they are intentionally kept. To make this clear, PromptLayer marks such records with a Before retention policy badge:- On the request log detail page, next to the logged timestamp.
- On the trace detail page, next to the trace summary.
The badge only appears for workspaces that later configured a finite retention
period. Workspaces that have always been on Forever never show it.
Best Practices
- Match retention to your needs: Use a finite period for high-volume or sensitive workspaces where you don’t need long-lived history, and keep Forever where you rely on long-term analytics.
- Change deliberately: A finite period permanently deletes data once it ages out, so confirm the new period is correct before applying it.
- Use separate workspaces: If different projects have different retention requirements, isolate them in separate workspaces so each can carry its own policy.
FAQ
Who can change the retention policy?
Who can change the retention policy?
Only workspace admins can change the retention policy. Other members can open the page and see the current period, but the selector and Save button are disabled for them.
Does changing the policy delete data I've already logged?
Does changing the policy delete data I've already logged?
No. Retention is assigned to each record when it is logged, based on the workspace’s period at that time, and changing the policy never rewrites it. Records already logged keep the retention window they were assigned — even if you later switch to a shorter period. Lowering the period (for example 90 days → 14 days) therefore does not delete your existing logs; it only means data logged after the change expires on the shorter window.
What happens to data when it exceeds the retention window?
What happens to data when it exceeds the retention window?
It is first hidden from search and all workspace views as soon as it passes the window, then permanently deleted in the background. Deletion cannot be undone.
What does the “Before retention policy” badge mean?
What does the “Before retention policy” badge mean?
It marks records that were logged before this workspace ever set a retention policy — i.e. during its original “Forever” era. They remain visible even after a finite policy is enabled. The badge appears on the request log detail page and the trace detail page, and never shows for workspaces that have always been on Forever.
Can different workspaces have different retention periods?
Can different workspaces have different retention periods?
Yes. Retention is configured per workspace, so each workspace — even within the same organization — can carry its own period.
What is the default retention period?
What is the default retention period?
New workspaces start on Forever, so nothing is automatically removed until you choose a finite period (14, 30, or 90 days).
Can I recover data after it's deleted?
Can I recover data after it's deleted?
No. Once data ages out and is deleted it cannot be recovered, which is why the confirmation dialog warns you before applying a shorter period.

