|
1 | 1 | # Telemetry |
2 | 2 |
|
3 | | -RTK collects anonymous, aggregate usage metrics once per day to help improve the product. Telemetry is **enabled by default** and can be disabled at any time. |
| 3 | +RTK collects anonymous, aggregate usage metrics once per day to help improve the product. Telemetry is **disabled by default** and requires explicit consent during `rtk init` or `rtk telemetry enable`. |
| 4 | + |
| 5 | +## Data Collector |
| 6 | + |
| 7 | +**Entity**: `RTK AI Labs` |
| 8 | +**Contact**: contact@rtk-ai.app |
4 | 9 |
|
5 | 10 | ## Why we collect telemetry |
6 | 11 |
|
@@ -29,7 +34,7 @@ This data directly drives our roadmap. For example, if telemetry shows that 40% |
29 | 34 |
|
30 | 35 | | Field | Example | Purpose | |
31 | 36 | |-------|---------|---------| |
32 | | -| `device_hash` | `a3f8c9...` (64 hex chars) | Count unique installations. Salted SHA-256 of hostname + username with a per-device random salt stored locally (`~/.local/share/rtk/.device_salt`). Not reversible. | |
| 37 | +| `device_hash` | `a3f8c9...` (64 hex chars) | Count unique installations. SHA-256 of a per-device random salt stored locally (`~/.local/share/rtk/.device_salt`). Not reversible. No hostname or username included. | |
33 | 38 |
|
34 | 39 | ### Environment |
35 | 40 |
|
@@ -109,32 +114,62 @@ This data directly drives our roadmap. For example, if telemetry shows that 40% |
109 | 114 | - Secrets, API keys, or environment variable values |
110 | 115 | - Repository names or URLs |
111 | 116 | - Personally identifiable information |
112 | | -- IP addresses (not logged server-side) |
| 117 | +- IP addresses (not stored in telemetry pings; stored temporarily in erasure audit log for accountability, anonymized after 6 months) |
113 | 118 |
|
114 | | -## Opt-out |
| 119 | +## Consent |
115 | 120 |
|
116 | | -Telemetry can be disabled instantly with either method: |
| 121 | +Telemetry requires explicit opt-in consent (GDPR Art. 6, 7). Consent is requested during `rtk init` or via `rtk telemetry enable`. Without consent, no data is sent. |
117 | 122 |
|
118 | 123 | ```bash |
119 | | -# Environment variable (per-session or in shell profile) |
120 | | -export RTK_TELEMETRY_DISABLED=1 |
| 124 | +rtk telemetry status # Check current consent state |
| 125 | +rtk telemetry enable # Give consent (interactive prompt) |
| 126 | +rtk telemetry disable # Withdraw consent |
| 127 | +rtk telemetry forget # Withdraw consent + delete local data + request server erasure |
| 128 | +``` |
121 | 129 |
|
122 | | -# Or permanently in config file |
123 | | -# ~/.config/rtk/config.toml |
124 | | -[telemetry] |
125 | | -enabled = false |
| 130 | +Environment variable override (blocks telemetry regardless of consent): |
| 131 | +```bash |
| 132 | +export RTK_TELEMETRY_DISABLED=1 |
126 | 133 | ``` |
127 | 134 |
|
128 | | -When disabled, `rtk init` shows `[info] Anonymous telemetry is disabled`. No data is sent, no background thread is spawned, no network requests are made. |
| 135 | +## Retention Policy |
| 136 | + |
| 137 | +- **Server-side**: telemetry records are retained for a maximum of **12 months**, then automatically purged (periodic task every 24 hours). |
| 138 | +- **Server-side (erasure log)**: IP addresses in the erasure audit log are **anonymized after 6 months** (GDPR — IP is personal data). |
| 139 | +- **Client-side**: the local SQLite database (`~/.local/share/rtk/tracking.db`) retains data for **90 days** by default (configurable via `tracking.history_days` in `config.toml`). Deleted entirely by `rtk telemetry forget`. |
129 | 140 |
|
130 | | -## Data handling |
| 141 | +## Your Rights (GDPR) |
| 142 | + |
| 143 | +Under the EU General Data Protection Regulation, you have the right to: |
| 144 | + |
| 145 | +- **Access** your data: `rtk telemetry status` shows your device hash; the telemetry payload is fully documented above. |
| 146 | +- **Rectification**: since data is anonymous and aggregate, rectification is not applicable. |
| 147 | +- **Erasure** (Art. 17): run `rtk telemetry forget` to delete local data and send an erasure request to the server. Alternatively, email contact@rtk-ai.app with your device hash. |
| 148 | +- **Restriction of processing**: `rtk telemetry disable` stops all data collection immediately. |
| 149 | +- **Portability**: the local SQLite database at `~/.local/share/rtk/tracking.db` contains all locally stored data. |
| 150 | +- **Objection**: `rtk telemetry disable` or `export RTK_TELEMETRY_DISABLED=1`. |
| 151 | + |
| 152 | +## Erasure Procedure |
| 153 | + |
| 154 | +1. Run `rtk telemetry forget` — this disables telemetry, deletes your device salt, ping marker, and local tracking database (`history.db`), then sends an erasure request to the server. |
| 155 | +2. If the server is unreachable, the CLI prints your full device hash and fallback instructions to email contact@rtk-ai.app for manual erasure. |
| 156 | +3. You can also email contact@rtk-ai.app directly to request manual erasure. |
| 157 | + |
| 158 | +## Data Handling |
131 | 159 |
|
132 | 160 | - Telemetry endpoint URL and auth token are injected at **compile time** via `option_env!()` — they are not in the source code |
133 | | -- The server is hosted on GCP Cloud Run with TLS |
| 161 | +- All communications use HTTPS (TLS) |
134 | 162 | - Data is used exclusively for RTK product improvement |
135 | 163 | - No data is sold or shared with third parties |
136 | 164 | - Aggregate statistics may be published (e.g. "70% of RTK users are on macOS") |
137 | 165 |
|
| 166 | +### Server-side Requirements |
| 167 | + |
| 168 | +The telemetry server must implement: |
| 169 | +- `POST /erasure` endpoint accepting `{"device_hash": "...", "action": "erasure"}`, authenticated via `X-RTK-Token` |
| 170 | +- Automatic periodic purge of telemetry records older than 12 months |
| 171 | +- Audit log for erasure requests (GDPR Art. 17(2) accountability) with IP anonymization after 6 months |
| 172 | + |
138 | 173 | ## For contributors |
139 | 174 |
|
140 | 175 | The telemetry implementation lives in `src/core/telemetry.rs`. Key design decisions: |
|
0 commit comments