# Data retention

How long each kind of data is kept, and what happens after. Read-only: the rows are the service's policy, with the version and date it last changed, so nothing here can drift from what actually happens.

- Registry name: `data-retention` (`@candor/data-retention`)
- Tier: Pro. Installing it needs a Pro, Premium or Team licence key: the person runs `npx candor-ui key <key>` themselves; never ask for the key in chat or write it to a file.
- Docs: https://candor.themethodic.com/docs/data-retention

## Install

```bash
npx candor-ui add data-retention
```

Run `npx candor-ui@latest init` once first (https://candor.themethodic.com/get-started.md). Without the CLI: `npx shadcn@latest add @candor/data-retention`.
It brings in: locale, utils.
npm packages: lucide-react@^1.67.0.

## Example

```tsx
"use client"

import { DataRetention, type RetentionRow } from "@/components/data-retention"

const rows: RetentionRow[] = [
  { kind: "Threads and messages", kept: "Until you delete it", after: "Deleted within 30 days", note: "Visible to members of the account" },
  { kind: "Run logs", kept: "90 days", after: "Summarised, then deleted" },
  { kind: "Audit log", kept: "1 year", after: "Deleted" },
  { kind: "Uploaded files", kept: "Until you delete it", after: "Deleted within 30 days" },
]

export default function Example() {
  return <DataRetention className="max-w-2xl" rows={rows} version="v4" changedAt="2026-09-14" />
}
```

## <DataRetention>

Props:

- `rows: RetentionRow[]`: One row per kind of data: how long it's kept and what happens after.
- `version: string`: The policy's version, shown in the header.
- `changedAt: string`: When the policy last changed, as an ISO date.
- `className?: string | undefined`

## Strings (`dataRetention`)

The fixed words, English by default. Override any of them under `dataRetention` in `<LocaleProvider strings={{ dataRetention: { … } }}>`; the table is exported as `dataRetentionStrings`.

- `label`: Data retention
- `heading`: How long data is kept
- `policy`: Policy {version} · changed {changed}
- `data`: Data
- `kept`: Kept
- `then`: Then

## Types

### RetentionRow

```ts
{ /** What kind of data, e.g. "Threads and messages". */ kind: string /** How long it's kept, e.g. "Until you delete it", "90 days". */ kept: string /** What happens then, e.g. "Deleted", "Summarised, then deleted". */ after: string /** Optional detail: where it lives, who can see it. */ note?: string | undefined }
```

## Rules for using Candor UI

- Components take plain typed data. Never pass model output as HTML or render it as a link; messages are typed blocks.
- A control that can't be used says why: wrap it in `<Locked reason="…">`, don't just disable it.
- Don't show a value you don't have: leave it out (it renders as —) rather than guess. An estimate is labelled as one.
- Nothing is pre-selected in a decision a person makes, and the agent is named from your app's data, never from model output.
- Your app's words go in `LocaleProvider` (fixed strings) and `TermsProvider` (nouns); entity kinds and agent roles in `EntityKindsProvider` and `AgentRolesProvider`.
