loki-mode 7.18.0 → 7.18.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,145 @@
1
+ # Loki Mode Privacy and Telemetry
2
+
3
+ This document is an honest, complete disclosure of what Loki Mode collects, what
4
+ it never collects, and how to turn collection off. If anything here does not
5
+ match the code, the code is the bug; please open an issue.
6
+
7
+ ## Summary
8
+
9
+ - Loki Mode collects anonymous diagnostics to help find and fix bugs.
10
+ - It NEVER collects your code, prompts, PRDs, file paths, environment values,
11
+ API keys, repository names, emails, or IP addresses.
12
+ - In this version (crash reporting Phase 0), NOTHING is sent automatically.
13
+ Crash reports are written to a local directory only, so you can inspect
14
+ exactly what a future version would send.
15
+ - You can opt out at any time with a single switch. The same switch also
16
+ disables the existing anonymous usage telemetry described below.
17
+
18
+ ## Two collection paths exist
19
+
20
+ ### 1. Crash reporting (Phase 0: local-only, no network)
21
+
22
+ When Loki Mode hits an unexpected error (an uncaught exception, an unhandled
23
+ promise rejection, a nonzero process exit, or an explicit friction signal such
24
+ as a retry loop, a rate-limit loop, or a quality-gate failure), it captures a
25
+ scrubbed diagnostic report.
26
+
27
+ Phase 0 behavior:
28
+
29
+ - The report is scrubbed by a shared Python module before anything is written.
30
+ If a scrubber is not available (no python3 on the system), Loki Mode writes
31
+ nothing and sends nothing. This is fail-closed by design.
32
+ - The scrubbed report is written locally to `.loki/crash/<id>.json` in your
33
+ project directory.
34
+ - No network request is made. Phase 0 has zero egress.
35
+ - You can read the reports yourself:
36
+ - `loki crash` lists local reports.
37
+ - `loki crash show <id>` prints one report exactly as stored.
38
+ - `loki crash submit [<id>]` prints the full scrubbed payload and a prefilled
39
+ GitHub issue URL so you can submit it manually if you choose. Loki Mode does
40
+ not submit anything for you in this version.
41
+
42
+ ### 2. Usage telemetry (existing, anonymous)
43
+
44
+ Loki Mode already ships anonymous usage telemetry via PostHog. This predates the
45
+ crash-reporting feature and is disclosed here for completeness.
46
+
47
+ - Events: `session_start`, `session_end`, and an install-time event.
48
+ - These are anonymous and gated by the same opt-out described below.
49
+ - They never carry your code, prompts, paths, keys, or repository names.
50
+
51
+ This document and the first-run notice describe BOTH paths. The opt-out is
52
+ unified: one switch disables crash reporting AND usage telemetry together.
53
+
54
+ ## What is collected (the whitelist)
55
+
56
+ Crash reports contain ONLY the following fields. Anything not on this list is
57
+ dropped, not merely redacted:
58
+
59
+ - os (operating system, e.g. Darwin, Linux)
60
+ - arch (CPU architecture, e.g. arm64, x86_64)
61
+ - loki_version (the Loki Mode version)
62
+ - runtime version (node version and/or bun version)
63
+ - error_class (e.g. TypeError, ENOENT, NonZeroExit)
64
+ - stack_signature (a short list of normalized stack frame signatures:
65
+ function or symbol names only, with file paths, line numbers, and columns
66
+ stripped)
67
+ - rarv_phase (which phase of the RARV cycle was active, when known)
68
+ - exit_code
69
+ - friction_kind (retry_loop, rate_limit_loop, or gate_failure) when applicable
70
+ - project_id_hash (a one-way hash, see the tradeoff note below)
71
+ - fingerprint (a dedup key derived from the error class plus the normalized
72
+ stack signatures)
73
+ - rules_version and redactions_count (scrubber bookkeeping)
74
+ - captured_at (UTC timestamp, second precision)
75
+
76
+ ## What is NEVER collected
77
+
78
+ - Your source code
79
+ - Your prompts, briefs, or PRDs
80
+ - File contents of any kind
81
+ - File paths (home paths are stripped to `~`; paths are not whitelisted)
82
+ - Environment variable values
83
+ - API keys, tokens, or other secrets
84
+ - Repository names
85
+ - Email addresses
86
+ - IP addresses
87
+
88
+ Because the report is whitelist-only (deny by default), free-text fields such as
89
+ prompts, briefs, and diffs can never reach the payload even if a redaction rule
90
+ were to miss something. Secrets are additionally scrubbed by the shared redactor
91
+ before whitelisting.
92
+
93
+ ## How to opt out
94
+
95
+ Any one of the following disables BOTH crash reporting and usage telemetry:
96
+
97
+ - Set the environment variable `LOKI_TELEMETRY=off`
98
+ - Run `loki telemetry off`
99
+ - Set `DO_NOT_TRACK=1` (the cross-tool community convention)
100
+ - Set `LOKI_TELEMETRY_DISABLED=true`
101
+
102
+ To re-enable later, run `loki telemetry on` or unset the variables. Once you opt
103
+ out, the first-run notice is never shown again.
104
+
105
+ ## Where reports are stored locally
106
+
107
+ Scrubbed crash reports live in `.loki/crash/` inside your project directory. You
108
+ can open these files in any text editor or use `loki crash show <id>`. In Phase 0
109
+ this directory is the only place crash data exists; it is yours to read or
110
+ delete at any time.
111
+
112
+ ## The unsalted project-id tradeoff (plain language)
113
+
114
+ The `project_id_hash` is a SHA-256 hash of your git remote origin URL, after
115
+ normalizing it (scheme removed, `.git` suffix removed, trailing slash removed,
116
+ host lowercased). It does NOT hash your local filesystem path, so it carries no
117
+ `/Users/<name>/` style information.
118
+
119
+ The hash is unsalted on purpose. An unsalted hash lets two users who hit the
120
+ same bug in the same public repository collapse to a single triage entry, which
121
+ is the entire point of deduplication and occurrence counting. A per-user salt
122
+ would defeat that. The cost of leaving it unsalted is that, for a known PUBLIC
123
+ repository, someone could hash candidate repo URLs and check for a match. But
124
+ the only thing that would reveal is which public repository was involved, which
125
+ is already public information, so the privacy cost is acceptable. For a PRIVATE
126
+ repository, the origin still hashes to an opaque value that leaks no path or
127
+ name. We chose cross-user dedup over per-user unlinkability, and we are stating
128
+ that choice plainly so you can decide whether to opt out.
129
+
130
+ ## Compliance posture
131
+
132
+ - Anonymous by design: no PII is in the whitelist; emails and IP addresses are
133
+ denied outright.
134
+ - Disclosed: this document plus a first-run notice describe collection before
135
+ any egress occurs.
136
+ - Opt-out is persistent and friction-free (see above) and applies to both
137
+ collection paths.
138
+ - The project id is non-reversible (one-way hash).
139
+ - Deletion: you can delete local reports yourself by removing files under
140
+ `.loki/crash/`.
141
+
142
+ ## Questions
143
+
144
+ Open an issue at https://github.com/asklokesh/loki-mode/issues and we will
145
+ clarify or correct this document.