This guide covers the UI-based configuration. You can also manage retention policies programmatically through the Upsert Retention Policies API or the TypeScript SDK.
Prerequisites
- A dataset you own or have write access to
- The dataset must be on an active data plane
Understanding policy classes
Before configuring a policy, choose the right policy class for your use case. The available classes depend on your data plane:| Policy class | What it deletes | Available on |
|---|---|---|
| Row TTL | Individual rows whose event timestamp exceeds the interval | Snowflake data planes |
| Snapshot TTL | Old ingestion snapshots based on snapshot age | AWS data planes |
| Table TTL | The entire dataset when table age exceeds the interval | Both |
Adding a retention policy
Open the Retention tab
Select the Retention tab on the dataset details page. If no policies are configured, you see an empty state with a prompt to add your first policy.
Start a new policy
Click the New Policy + button. You can either:
- Click the button directly to open the manual configuration drawer
- Click the dropdown arrow to choose between Ask Rosetta (AI-assisted) or Configure manually
Configure the policy
In the configuration drawer, set the following:Policy class — Select the type of retention policy. The available options depend on your data plane.Interval — Choose a preset duration (30, 90, 180, or 365 days) or enter a custom ISO 8601 duration such as Status — Toggle the policy on or off. Policies are enabled by default.
P60D for 60 days.Class-specific settings:- Row TTL
- Snapshot TTL
- Table TTL
Event time clock — Select the Rosetta Stone attribute that maps to a timestamp column in your dataset. The dropdown shows all
timestamptz attributes mapped on the dataset. If you don’t specify one, the system defaults to nio_last_modified.Using Ask Rosetta to generate a policy
Instead of configuring a policy manually, you can describe what you want in plain language and let Rosetta generate the configuration for you.Open Ask Rosetta
From the Retention tab, click the dropdown arrow on the New Policy + button and select Ask Rosetta.
Describe your policy
Enter a plain-language description of the retention behavior you want. For example:
Delete individual rows older than 90 days based on when the event occurred. Use the event_timestamp attribute as the clock. Keep the policy enabled.You can also click Use this prompt to start with the sample prompt provided.
Generate and review
Click Generate Policy. Rosetta converts your description into a structured policy configuration and opens the configuration drawer with the values pre-filled. Review the settings and adjust if needed.
Editing a retention policy
To modify an existing policy, click the actions menu (three dots) on the policy row and select Edit. The configuration drawer opens in edit mode with the current settings pre-populated. You cannot change the policy class when editing — to switch policy classes, delete the existing policy and create a new one.Enabling or disabling a policy
You can toggle a policy on or off without deleting it:- From the table — Click the toggle switch next to the policy class badge
- From the actions menu — Click the actions menu and select Enable or Disable
Deleting a retention policy
Click the actions menu on the policy row and select Delete. Confirm the deletion in the dialog that appears. This removes the policy configuration entirely — it does not undo any deletions that have already occurred.Related content
Dataset retention policies
Understand how retention policies work and when to use each policy class
Data planes
Learn where your data physically resides and how it affects retention behavior
EXPIRE clause
Set retention on materialized views using NQL
Upsert Retention Policies API
Manage retention policies programmatically

