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

# Uplink Overview

> What Uplink does, how Cloud Uplink and a Self-Hosted Uplink instance differ, and where Uplink keeps its state.

Uplink is the Agent Golf service that receives the OpenTelemetry data of your agent harnesses. You run it in your network as a Self-Hosted Uplink instance, or Agent Golf runs it for your workspace as Cloud Uplink.

## What Uplink does

* **Receives harness telemetry.** Uplink accepts OTLP from Claude Code, Codex, omp, and GitHub Copilot. Each export carries its user's personal publishing key. See [Connect a Harness](https://docs.agent.golf/harnesses/overview.md).
* **Keeps session content.** Prompts, responses, and sensitive tool details stay in the uplink instance. Uplink encrypts the copy that the dashboard shows with its own keys. Agent Golf stores only opaque references to the content.
* **Sends session data.** Uplink sends session structure, measurements, attribution evidence, and its own health metrics to Agent Golf. See [What Leaves Your Network](https://docs.agent.golf/getting-started/data-boundary.md).
* **Shows content to your users.** The dashboard gets session content from the uplink instance for a user who can reveal the session. See [Session content](https://docs.agent.golf/dashboard/sessions.md#session-content).

## Cloud Uplink or Self-Hosted Uplink

| | Cloud Uplink | Self-Hosted Uplink instance |
| - | - | - |
| Who runs it | Agent Golf. An admin turns it on in **Settings > Uplink > Cloud**. | You, on Docker, Kubernetes, or a Linux or macOS host. See [Install Uplink](https://docs.agent.golf/uplink/install.md). |
| Where raw telemetry and session content stay | Agent Golf infrastructure. Session content stays for your workspace's **Session Detail** window. See [History retention](https://docs.agent.golf/account/data-retention.md#history-retention). | Your Uplink host. You manage its disk. |
| Harness endpoint | The **OTLP Endpoint** of Cloud Uplink, over HTTPS. | Your Uplink listener, for example `http://127.0.0.1:4318`. |
| Harness credential | A personal publishing key for each user, in the `x-agentgolf-publishing-key` header. Agent Golf checks that it is live. | The same key in the same header. The listener refuses a revoked key within a minute and checks only the form of other keys, so protect it at the network layer. |
| Who can show session content | The session's [contributor](https://docs.agent.golf/dashboard/sessions.md#contributor), and users with **View Team Sessions** and **Reveal Team Session Content**. See [Session content](https://docs.agent.golf/dashboard/sessions.md#session-content). | The same users. The dashboard needs the instance's [local API](https://docs.agent.golf/uplink/local-api.md). |
| Cost | Usage on the Cloud Uplink meters. Your plan sets the price. See [Cloud Uplink](https://docs.agent.golf/uplink/cloud.md#usage). | Its usage counts on the Self-Hosted Uplink meters. See [Meters](https://docs.agent.golf/account/usage.md#meters). |

You can use Cloud Uplink and Self-Hosted Uplink instances at the same time. One publishing key works with both.

## Set up a Self-Hosted Uplink instance

The **Set Up Uplink** step of the onboarding flow uses the same order.

1. **Create an Uplink key** in **Settings > Uplink > Self-Hosted**. See [Create an Uplink key](https://docs.agent.golf/uplink/install.md#create-an-uplink-key).
2. **Start Uplink with the key.** See [Install Uplink](https://docs.agent.golf/uplink/install.md).
3. **Wait for the uplink instance.** It shows in the **Uplink** section of the dashboard after its first report. See [Verify the installation](https://docs.agent.golf/uplink/verify.md).
4. **Create a publishing key.** Each user creates their own key. See [Publishing keys](https://docs.agent.golf/harnesses/overview.md#publishing-keys).
5. **Connect your harness.** See [Connect a Harness](https://docs.agent.golf/harnesses/overview.md).
6. **Wait for your first session.** Run a task in your harness. The session shows in **Sessions**.

To use Cloud Uplink, [turn it on](https://docs.agent.golf/uplink/cloud.md#turn-on-cloud-uplink).

## Self-Hosted Uplink

A Self-Hosted Uplink instance is one process, and it needs no database or message broker from you. Run one instance for many developers, on a Linux host in your network close to the machines where your harnesses run.

A Self-Hosted Uplink instance. Harnesses send OTLP on port 4318, or over gRPC on port 4317. Port 4319 serves health checks and metrics. The browser can call the optional local API. Uplink can export its own logs and traces to your OTLP collector. Uplink calls api.agent.golf over HTTPS and holds one TLS connection to the Agent Golf data connection on port 7422. Uplink keeps its credentials and session data in a state directory on your host.

Uplink accepts OpenTelemetry data and, when enabled, local API requests. It can export its own logs and traces to
your collector. It opens two kinds of outbound connection: HTTPS to api.agent.golf and one TLS connection to the
Agent Golf data connection. It keeps its credentials and session data in one state directory on your host.

The instance receives OTLP over HTTP on port 4318, and over gRPC on port 4317. The container image and the Helm chart turn on both listeners. The binary turns on the gRPC listener only when you set `OTLP_GRPC_PORT`. The instance serves health checks and metrics on port 4319. It opens every connection to Agent Golf itself, and Agent Golf never connects to it. [Network](https://docs.agent.golf/uplink/network.md) lists each port, its default bind, and each outbound connection.

The instance starts with an Uplink key. The key belongs to your workspace, so the instance does not depend on one person. See [Create an Uplink key](https://docs.agent.golf/uplink/install.md#create-an-uplink-key).

## State directory

Uplink keeps its session data, its encryption keys, and the instance ID in one state directory: `~/.ag-uplink/prod/`, in the home directory of the user that runs it. Uplink writes its files with owner-only permissions.

Uplink encrypts the copy of session content that the dashboard shows with its own keys. The directory also holds working data without encryption:

* A plaintext copy of prompts, responses, and tool details, until Uplink encrypts them. From Uplink 0.1.30, an instance that starts with an Uplink key deletes each plaintext copy that has an encrypted copy, about two hours after its last use. A copy without an encrypted copy stays. See [Delete data at a Self-Hosted Uplink instance](https://docs.agent.golf/account/data-retention.md#delete-data-at-a-self-hosted-uplink-instance).
* The raw telemetry from your harnesses, until Uplink processes it. See [What stays, and for how long](https://docs.agent.golf/account/data-retention.md#what-stays-and-for-how-long).

The encryption keys are in the same directory. You manage this disk, so put the directory on an encrypted disk or volume, and encrypt its backups. If you set `UPLINK_STORE_DIR` to a path outside the state directory, encrypt that disk too.

Keep the directory on a persistent disk on a local file system, not on NFS or SMB. From Uplink 0.1.32, the directory holds an embedded database of the stored sessions (`records`). See [Storage](https://docs.agent.golf/uplink/configuration.md#storage). Back up the directory in one of these ways:

* From Uplink 0.1.40, run `uplink backup -to <new directory>` while Uplink runs, as the user of Uplink. Uplink writes a consistent copy of its streams, its database, and its keys into the new directory, and keeps its work. Give the command the same `-store-dir` or `UPLINK_STORE_DIR` and the same [`AGENTGOLF_API_BASE_URL`](https://docs.agent.golf/uplink/configuration#uplink-key) as Uplink.
* Take a snapshot of the file system, the volume, or the disk. Uplink recovers from a snapshot as after a power loss.
* Stop Uplink, copy the directory, and start Uplink again.

Do not copy the files of the directory while Uplink runs. Such a copy can hold files from different times, and the database then does not open.

To restore a backup of `uplink backup`, stop Uplink, move the store directory away, run `uplink restore -from <backup directory>` with the same settings as Uplink, and start Uplink. The command restores only into a store directory that does not exist or is empty. To restore a snapshot or a copy, put it in the place of the directory before Uplink starts.

The `uplink-key` file and the credentials files are in the state directory, outside the store directory. Keep the `uplink-key` file, or give Uplink its key again. Uplink makes new data connection credentials at start.

If the directory is lost, Uplink starts as a new instance with its Uplink key and cannot show content that it stored before.


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