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

# Data retention

> Choose how long Opper stores call content, or keep none of it.

Data retention controls whether you can open a full trace after a call and how
long that trace remains available. Set a default for the organization, then
shorten it for projects that handle more sensitive data.

<Frame>
  <img src="https://mintcdn.com/opper/HpZjXXCz_g0abd94/images/rules/rules-retention.png?fit=max&auto=format&n=HpZjXXCz_g0abd94&q=85&s=dfd6c60c66883faa32fed994235590fd" alt="A 30-day organization retention rule with a 7-day project override" width="780" height="310" data-path="images/rules/rules-retention.png" />
</Frame>

## Choose a retention period

Set retention from **0 to 30 days**.

* **1–30 days:** Opper stores spans, inputs, and outputs until they expire.
* **0 days:** Opper does not store trace content or files for the affected
  scope.
* **No rule:** Opper records usage metadata, but does not create a trace with
  stored spans, inputs, or outputs.

The new period applies to calls made after you save. Existing traces keep the
expiry date they received when they were created.

<Warning>
  An unset retention rule does not mean “keep forever.” To inspect full traces or
  run [score checks](/control-plane/rules/checks#score-checks), set retention to at
  least 1 day.
</Warning>

## Shorten retention for a project

Select **Shorten retention for a project** to add an override. The effective
period is always the shortest rule that applies.

For example, if the organization keeps data for 30 days and `order-bot` has a
7-day override, that project keeps data for 7 days. A project cannot extend the
organization period.

## Usage metadata is retained separately

Opper keeps a separate usage record for billing and reporting. It contains cost,
tokens, latency, status, provider, model, and any `X-Opper-Tags` used for
[usage attribution](/build/gateway/usage-attribution). It does not contain
prompts or responses.

Usage records are retained for **5 years**. Retention rules and Zero Data
Retention do not shorten this period.

<Note>
  Tags are kept with usage records. Avoid putting sensitive data in tags; include
  only the identifiers you need for attribution.
</Note>

## Enable Zero Data Retention

Zero Data Retention (ZDR) prevents call content from being stored and limits
routing to providers with zero-retention agreements. Turning it on also disables
response caching.

<Frame>
  <img src="https://mintcdn.com/opper/HpZjXXCz_g0abd94/images/rules/rules-zdr-active.png?fit=max&auto=format&n=HpZjXXCz_g0abd94&q=85&s=b8f67c94ec197ab23360fa92484a7a4c" alt="Zero Data Retention enabled with retention locked to 0 days" width="780" height="180" data-path="images/rules/rules-zdr-active.png" />
</Frame>

ZDR has three effects across the organization:

1. Retention is fixed at 0 days.
2. [Model access](/control-plane/rules/model-access) is restricted to
   ZDR-eligible providers.
3. Response caching is disabled because cached responses store content.

The toggle on this page applies to the whole organization. Existing
project-scoped ZDR rules still appear in the override list and continue to apply
to those projects.

### Resolve conflicts before enabling ZDR

The ZDR toggle is disabled when an existing rule would conflict with it.

<Frame>
  <img src="https://mintcdn.com/opper/HpZjXXCz_g0abd94/images/rules/rules-zdr-blocked.png?fit=max&auto=format&n=HpZjXXCz_g0abd94&q=85&s=343aa0859a6f907dec34e963875def97" alt="The ZDR toggle disabled because a retention rule conflicts with it" width="780" height="170" data-path="images/rules/rules-zdr-blocked.png" />
</Frame>

| Conflict                         | What to do                                             |
| -------------------------------- | ------------------------------------------------------ |
| A retention rule is set          | Remove the retention rule, then enable ZDR.            |
| A response-cache rule is enabled | Remove the cache rule from **Route**, then enable ZDR. |

### Existing files

A scope with 0-day retention cannot contain stored files. If files already
exist, saving asks you to confirm the number that will be deleted.

Deletion is permanent and completes within an hour.

### Checks under ZDR

Checks that act during the request still enforce. Score checks pause because
they need stored outputs.

<Frame>
  <img src="https://mintcdn.com/opper/HpZjXXCz_g0abd94/images/rules/rules-zdr-checks.png?fit=max&auto=format&n=HpZjXXCz_g0abd94&q=85&s=fef41af91bbee0c8bf1b5dcbbab7293c" alt="The Checks section explaining how Zero Data Retention affects each action" width="780" height="170" data-path="images/rules/rules-zdr-checks.png" />
</Frame>

| Action     | Under ZDR                                                                    |
| ---------- | ---------------------------------------------------------------------------- |
| **Block**  | Still rejects matching calls.                                                |
| **Redact** | Still replaces matching content.                                             |
| **Flag**   | Still evaluates, but there is no stored trace on which to record the result. |
| **Score**  | Pauses until retention is enabled again.                                     |

<Tip>
  If you need scoring with minimal storage, use a 1-day retention period instead
  of ZDR.
</Tip>
