> ## 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

> Control storage costs and meet compliance obligations by setting per-object retention windows that automatically delete aged data.

export const feature_0 = "Custom retention policies"

export const verb_0 = "are"

Retention is configured per project. Set separate windows for logs, experiments, and datasets.

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

## Create retention policy

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>

## How retention works

**Logs**: Individual logs are deleted when their creation timestamp exceeds the retention period.

**Experiments**: Entire experiments (metadata and all rows) are deleted when the experiment creation timestamp exceeds the retention period.

**Datasets**: Individual dataset rows are deleted when their creation timestamp exceeds the retention period. The dataset itself remains and can accept new rows.

## 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 retention 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.

## Common retention patterns

**Production logs**: 90 days

```
Keep recent logs for debugging, delete older data to manage costs.
```

**Development logs**: 7 days

```
Keep short-term history for active development, clean up test data quickly.
```

**Experiments**: 180 days

```
Retain completed evaluations for half a year, then archive or delete.
```

**Compliance**: 30 days

```
Meet regulatory requirements by automatically deleting user data after 30 days.
```

## Next steps

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