Skip to main content
Retention policies automate data lifecycle management by removing data that has exceeded a specified age. You can configure retention policies directly from the dataset details page, in its Retention section. To open it, select Configuration in the section rail at the left of the page, then Retention.
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: For a detailed explanation of each policy class, see Dataset retention policies.
Deletions on Snowflake-based data planes are immediate with no grace period. AWS-based data planes apply a default 30-day grace period before permanent deletion.

Adding a retention policy

1

Navigate to the dataset

Go to My Data > Datasets and select the dataset you want to configure.
2

Open the new-policy form

You can start a new policy from several places on the dataset details page:
  • Retention section, no policies yet — the section shows an empty state with a New Policy + button. Click the button to configure the policy manually, or click its dropdown arrow to choose between Ask Rosetta (AI-assisted) and Configure manually.
  • Retention section, existing policies — click the … button at the top of the section’s card and select New policy, or Ask Rosetta for an AI-assisted policy.
  • Details panel — under Behavior, click the pencil icon on the Retention row. On a narrow window, click Details to open the panel first.
  • Actions menu — click Actions, then under the Retention group select Configure retention policy.
Except for Ask Rosetta, each of these opens the Add retention policy form in the details panel, in place of the dataset’s details.
3

Configure the policy

In the configuration form, 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 P60D for 60 days.Class-specific settings:
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.
Policy enabled — Toggle the policy on or off. Policies are enabled by default.
4

Save the policy

Click Save. The policy appears in the retention policies table, and the details panel shows the dataset’s details again.

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.
1

Open Ask Rosetta

From the Retention section, click the … button at the top of the section’s card and select Ask Rosetta. If the dataset has no policies yet, click the dropdown arrow on the New Policy + button and select Ask Rosetta instead.
2

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.
3

Generate and review

Click Generate Policy. Rosetta converts your description into a structured policy configuration and opens the configuration form with the values pre-filled. Review the settings and adjust if needed.
4

Save the policy

Click Save to save the generated configuration.
If you prefer to configure manually instead, click the Manual button in the Ask Rosetta dialog to switch to the manual configuration form.

Editing a retention policy

To modify an existing policy, click the actions menu (three dots) on the policy row and select Edit. The Edit retention policy form opens in the details panel 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
Disabled policies remain in the configuration but are not evaluated during retention runs.

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.

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