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

# Data Retention & Deletion

> See where Agent Golf and Uplink keep your data and for how long, choose the retention windows, and delete data.

The place where data stays decides who deletes it. Agent Golf deletes the data in its cloud and on a Cloud Uplink instance, and you delete the data on a Self-Hosted Uplink instance.

## Before you begin

* **View Billing** to see **History Retention** on **Settings > Data**.
* **Manage Billing** to change a retention window on **Settings > Data**. On **Settings > Organization > Data**, you need **Manage Organization Billing**.
* **Delete Data** to delete the usage data of a workspace.
* **Delete Organization Data** to delete the data of the organization on **Settings > Organization > Data**.

For the roles that include these permissions, see [Default roles](https://docs.agent.golf/account/users.md#default-roles).

## What stays, and for how long

| Data | Where it stays | How long it stays |
| - | - | - |
| Session detail: the session graph, the model requests, and the references to session content | Agent Golf cloud | Your workspace's **Session Detail** window. See [History retention](#history-retention). |
| Pull requests, CI runs, attribution, and session totals | Agent Golf cloud | Your workspace's **Pull Request History** window. The organization holds the pull requests and the CI runs, and the window of the organization applies to them. |
| GitHub events: each webhook as GitHub sends it | Agent Golf cloud | 7 days. |
| Pull request reads: the pull request, its commits, its changed files, and its diff, as the GitHub App reads them for an event | Agent Golf cloud | 30 days. |
| Session content on a Cloud Uplink instance | Agent Golf infrastructure | Your workspace's **Session Detail** window. When your plan keeps all history, the instance keeps all session content. |
| Raw telemetry on a Cloud Uplink instance | Agent Golf infrastructure | Until the instance processes it. Raw telemetry that it did not process stays for at most 48 hours, and never longer than the window. |
| Session content on a Self-Hosted Uplink instance | The state directory, on your disk | No time limit, because no window applies. See [State directory](https://docs.agent.golf/uplink/overview.md#state-directory). |
| Raw telemetry on a Self-Hosted Uplink instance | The state directory, on your disk | Until Uplink processes it. By default, Uplink deletes raw telemetry that it did not process after 48 hours. |
| Linear and Jira data, except the change events | Agent Golf cloud | No window applies. See [Linear imports](https://docs.agent.golf/linear/imports.md) and [Connect Jira](https://docs.agent.golf/jira/connect.md). |
| Linear and Jira change events | Agent Golf cloud | 7 days. An event that Agent Golf could not process moves to a separate store and stays there 30 days more, at most 37 days in all. See [Change events](https://docs.agent.golf/linear/imports.md#change-events) and [What Agent Golf keeps](https://docs.agent.golf/jira/connect.md#what-agent-golf-keeps). |

## History retention

**History Retention** on **Settings > Data** shows how long Agent Golf keeps your workspace's history in its cloud. **Settings > Organization > Data** shows the same for the workspaces of your organization.

It has one card for each window:

* **Session Detail** is the full record of each session: its graph, its model requests, and the references to its content. Each day, Agent Golf deletes the detail of each session whose newest activity is older than the window. The session stays in the session list, the **Dashboard**, and the pull request pages with its totals, such as cost, tokens, and duration. The session page shows that its detail expired.
* **Pull Request History** keeps pull requests, CI runs, attribution, and session totals. Each day, Agent Golf deletes the pull requests that were merged or closed before the window. It deletes them with their comments, code changes, CI runs, attribution, and intent classifications. It also deletes the CI runs that ended before the window, and the sessions older than the window that no kept pull request links to. An open pull request keeps its sessions.

Each card shows its window, or **No Limit**, and the plan limit. **Plan Default** means that nobody chose a window, so your plan's maximum applies. For the windows of each plan, see the [pricing page](https://agent.golf/pricing/).

### Change a window

1. On **Settings > Data**, select **Edit** on the card.
2. Under **Keep For**, choose a window that your plan offers, or **Plan Default**, then select **Save**.

**Pull Request History** must keep at least as long as **Session Detail**. When your plan bills the data that a window keeps, the dialog shows the price.

A longer window applies at once. A shorter window does not delete data at once: the card shows the date on which it starts to apply, and the window that Agent Golf keeps until then. Agent Golf emails the [billing email](https://docs.agent.golf/account/billing.md#billing-email) when you save a shorter window and 7 days before it applies.

Kept data counts as storage usage. See [Meters](https://docs.agent.golf/account/usage.md#meters).

## Delete data in the cloud

| Action | Result |
| - | - |
| [Delete Usage Data](#delete-usage-data) | Deletes the session detail or all usage data of the workspace, of a date range or of every date, with the data of its Cloud Uplink instance. |
| [Delete Organization Data](#delete-organization-data) | Deletes a date range or all of the organization's data: the usage data of each workspace, and the pull requests, CI runs, and GitHub event data of the organization. |
| [The plan ends](#data-deletion-after-a-plan-ends) | Deletes the organization's usage data on the date that **Billing** shows. |
| [Turn Off Cloud Uplink](https://docs.agent.golf/uplink/cloud.md#turn-off-cloud-uplink) | Agent Golf deletes the raw telemetry, the session content, and its encryption keys at the end of a grace period. **Settings > Uplink > Cloud** shows the deletion date. |
| [Delete the Linear data](https://docs.agent.golf/linear/connect.md#delete-the-data) | Deletes the data that Agent Golf imported from a disconnected Linear workspace. |
| [Delete the Jira data](https://docs.agent.golf/jira/connect.md#delete-the-data) | Deletes the data that Agent Golf imported from a disconnected Jira site. |

Deleted data can stay in backups for up to 62 days. None of these actions change the data at a Self-Hosted Uplink instance.

### Delete usage data

**Delete Usage Data** on **Settings > Data** deletes usage data that Agent Golf keeps in its cloud for the workspace. The workspace, its users, its settings, its keys, and the Linear and Jira data of the organization stay. The organization keeps the pull requests, the CI runs, and the GitHub event data of its GitHub organizations. To delete them, use [Delete Organization Data](#delete-organization-data).

Each deletion asks for the **Data to Delete**:

* **Session Detail**, the default, deletes the prompts, the responses, the tool calls, and the model requests of each session, and the content of the Cloud Uplink instance. The sessions stay with their totals, their analyses, and the pull request history.
* **Session Detail and Pull Request History** deletes all usage data: the sessions with their detail, totals, analyses, and pull request attributions, and the trend data.

The card has two actions:

* **Delete a Date Range** deletes the chosen data of the sessions last active in the range. **Session Detail and Pull Request History** also deletes the trend data of the range. Choose a quick range, such as **Last 7 Days**, or a **From** and a **To** date. The dates are UTC days, up to today.
* **Delete Usage Data** deletes the chosen data of every date.

To confirm, type the workspace name. The deletion starts at once and runs in the background. You cannot undo it. The dialog shows the last day on which backups can keep the deleted data.

### Delete organization data

**Delete Organization Data** on **Settings > Organization > Data** deletes the data that Agent Golf keeps in its cloud for the organization:

* The usage data of each workspace of the organization, as [Delete Usage Data](#delete-usage-data) deletes it.
* The pull requests, the CI runs, their attribution, and the GitHub event data of the organization's GitHub organizations.
* The sessions of the publishing keys without a workspace of the organization.

The organization, its workspaces, users, roles, settings, keys, and connections stay, with the Linear and Jira data. GitHub stays connected, so new GitHub activity arrives again.

* **Delete a Date Range** deletes, in each workspace, the sessions last active in the range and the range's trend data. It also deletes the pull requests merged or closed in the range, with their CI runs, attribution, comments, reviews, code changes, and intent classifications, and the CI runs of the range that no pull request links. The Cloud Uplink instances delete their sessions from these dates.
* **Delete All Organization Data** deletes all of it.

To confirm, type the organization name. The deletion starts at once and runs in the background. You cannot undo it. The Administrator role of the organization has **Delete Organization Data**.

The raw telemetry and the session content at your Self-Hosted Uplink instances stay on your network. To delete them, see [Delete data at a Self-Hosted Uplink instance](#delete-data-at-a-self-hosted-uplink-instance).

### Data deletion after a plan ends

Agent Golf deletes the usage data of your organization a number of days after a trial ends without a plan, or after a paid plan ends. Your plan sets the days after a paid plan ends. See the [pricing page](https://agent.golf/pricing/). Until then, **Billing** shows **Data Deletion Planned** with the date. Start a plan before then to keep the data.

The deletion removes the usage data in the cloud, and keeps your organization, its users, and its settings. The data at your Self-Hosted Uplink instances does not change.

> [accordion] What the deletion removes and keeps
>
> * **Removed:** the sessions, the pull request data, the analyses, the model requests, the contributor identities, the CI runs, the GitHub event data, and the data of your Cloud Uplink instance.
> * **Kept:** your organization, its users, roles, invitations, GitHub organization links, uplink instances, keys, settings, and Linear and Jira data.

## Delete data at a Self-Hosted Uplink instance

A Self-Hosted Uplink instance has no retention window for session content. Agent Golf cannot reach its disk, so only you can delete this data.

Uplink has no command that deletes one session or one user's data. The smallest part that you can delete is one uplink instance's state directory, which holds all of that instance's session content, raw telemetry, and encryption keys.

> [!WARNING]
>
> You cannot undo this deletion. Uplink has no copy of the state directory in the cloud.

First, stop the Self-Hosted Uplink instance and delete its state:

> [tab] Host
>
> With the systemd service of [Install Uplink](https://docs.agent.golf/uplink/install.md#run-uplink-as-a-systemd-service), the state directory is under `/var/lib/uplink`:
>
> ```bash theme={null}
> sudo systemctl stop uplink
> sudo rm -rf /var/lib/uplink/.ag-uplink
> ```
>
> For another service, the state directory is `~/.ag-uplink/prod/` under the home directory of the user that runs Uplink. See [State directory](https://docs.agent.golf/uplink/overview.md#state-directory).

> [tab] Docker
>
> Remove the container and its volume:
>
> ```bash theme={null}
> docker rm --force uplink
> docker volume rm uplink-state
> ```

> [tab] Kubernetes
>
> The chart keeps the volume claim when you uninstall the release, so delete the claim too. With the release name `uplink`, the claim is `data-uplink-0`:
>
> ```bash theme={null}
> helm uninstall uplink --namespace uplink
> kubectl --namespace uplink delete pvc data-uplink-0
> ```

Then do these steps:

1. If you set `UPLINK_STORE_DIR` to a path outside the state directory, delete that path too.
2. Delete each backup and each snapshot of that directory, volume, or disk. Agent Golf cannot see your backups.
3. If you retire the instance, [remove it](https://docs.agent.golf/uplink/monitoring.md#remove-an-instance) from the dashboard. When no other uplink instance uses its Uplink key, revoke the key in **Settings > Uplink > Self-Hosted**.
4. To delete the data that Agent Golf keeps for these sessions, use [Delete Usage Data](#delete-usage-data). The steps above do not change the cloud data.

After you delete the state directory, later pull requests cannot link to these sessions through attribution, because the instance no longer holds them. For the other effects, see [State directory](https://docs.agent.golf/uplink/overview.md#state-directory).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.