> ## Documentation Index
> Fetch the complete documentation index at: https://braintrust.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure data retention

> Extend your retention window to keep data longer, or automate and manually delete data to meet compliance obligations and store less.

export const feature_0 = "Custom retention policies"

export const verb_0 = "are"

Retention controls how long Braintrust keeps your data before it's deleted. Your [plan](/plans-and-limits) sets a base retention window (14-day retention on Starter and 30-day retention on Pro) that applies across your organization. From there, you can:

* [**Extend the retention window**](#extend-the-retention-window) to keep data longer for an additional storage charge (Pro and Enterprise).
* [**Automate data deletion**](#automate-data-deletion) to keep less data on specific projects and object types (Enterprise).
* [**Delete data manually**](#delete-data-manually) to remove specific data on demand (any plan).

<Note>
  Retention automations only shorten retention. Setting an automation period longer than your plan-level window doesn't keep data longer. To retain data beyond your plan's base window, extend your retention window as described below.
</Note>

## Extend the retention window

Pro and Enterprise plans can extend the base retention window to keep logs and playground data, including each row's [activity history](/observe/examine-traces#view-activity-history), queryable for longer, for an additional [storage charge](/admin/billing/monitor-usage#retention-storage).

* **Starter**: 14-day retention window. Not extendable.
* **Pro**: 30-day retention window. Extend up to 180-day retention in **<Icon icon="settings-2" /> Settings** > [**<Icon icon="credit-card" /> Billing**](https://www.braintrust.dev/app/~/configuration/org/billing), in 30-day increments.
* **Enterprise**: Custom retention window, up to 365-day retention, configured with your account team.

Extending applies org-wide. To keep less data on specific projects, [automate data deletion](#automate-data-deletion).

Retention storage is billed on the highest amount retained during the billing month, so extending mid-month isn't prorated. See [Retention storage](/admin/billing/monitor-usage#retention-storage) for how it's measured.

Increasing your retention window takes effect immediately. Decreasing it, or removing the extension, is scheduled for the end of the current billing period and can be canceled before then.

## Automate data deletion

<Note>
  {feature_0} {verb_0} only available on the [Enterprise plan](/plans-and-limits#plans).
</Note>

A retention automation permanently deletes one object type in a project once its data is older than a period you set. Use it to keep less data than your plan-level window, for example to meet a project's compliance requirements. Create a separate automation for each object type (logs, experiments, or datasets) you want to limit.

1. Go to **<Icon icon="settings-2" /> Settings** > [**<Icon icon="database-zap" /> Data management**](https://www.braintrust.dev/app/~/configuration/data-management).
2. Click **+ Create automation**.
3. Select **Data retention** type.
4. Configure settings:
   * **Object type**: Logs, Experiments, or Datasets.
   * **Retention period**: Days to keep data before deletion.
5. Click **Save**.

<Warning>
  Retention policies permanently delete data. Deleted logs, experiments, and dataset rows cannot be recovered.
</Warning>

### What gets deleted

* **Logs**: Individual logs older than the retention period are deleted.
* **Experiments**: The entire experiment (metadata and all rows) is deleted once its creation timestamp passes the retention period.
* **Datasets**: Individual dataset rows older than the retention period are deleted. The dataset itself remains and can accept new rows.

### Example policies

| Scenario         | Retention period  | Rationale                                                                                         |
| ---------------- | ----------------- | ------------------------------------------------------------------------------------------------- |
| Production logs  | 90-day retention  | Keep recent logs for debugging, delete older data you no longer need.                             |
| Development logs | 7-day retention   | Keep short-term history for active development, clean up test data quickly.                       |
| Experiments      | 180-day retention | Retain completed evaluations for half a year, then archive or delete.                             |
| Compliance       | 30-day retention  | Automatically delete user data after the 30-day retention period to meet regulatory requirements. |

## Delete data manually

To remove specific data before it ages out of your retention window, delete it directly. Manual deletion is available on all plans.

* **Traces and logs**: Select traces in the log table and delete them. See [Delete traces](/observe/view-logs#delete-traces).
* **Dataset records**: Select records in a dataset and delete them, or delete them programmatically. See [Delete records](/annotate/datasets/manage#delete-records).
* **Experiment rows**: Select rows in an experiment table and delete them, or delete them through the API.

## Self-hosted deployments

### Soft deletion

For [self-hosted deployments](/admin/self-hosting) (data plane v1.1.21+), data is soft-deleted by marking it unused. A background process purges unused files within 24 hours, providing a grace period to restore accidentally deleted data.

<Note>
  Configure a service token for your data plane to enable retention. See [Data plane manager](/admin/self-hosting/advanced#data-retention) for details.
</Note>

### Cloud provider policies

For [self-hosted deployments](/admin/self-hosting), review your cloud provider's bucket retention policies at the project and organization level before configuring retention in Braintrust. Org-wide policies are common and can conflict with Braintrust retention settings or delete data independently of Braintrust.

All Braintrust deletes are recorded in a delete log. If data goes missing, contact [Braintrust support](mailto:support@braintrust.dev) and Braintrust will audit these logs to determine whether the deletion was caused by a Braintrust retention policy or another process. Braintrust recommends enabling audit logging on your storage bucket to help trace the root cause of unexpected deletes.

## Next steps

* [Export to cloud storage](/admin/data-management/export) for long-term archival
* [Set up alerts](/observe/alerts) to monitor data quality
* [Self-hosting advanced](/admin/self-hosting/advanced) for data plane configuration
