Repository navigation
feat(privacy): disclose the dependency scan and let users decline sharing - #1099
Conversation
…ring The wizard scans dependency manifests and .env variable names to identify third-party tools in a project, then reports what it finds to PostHog. That happened with no disclosure and no way to opt out. The intro screen now says what is read and why, and offers "Continue without sharing what you use". Declining suppresses reporting only: the scan still runs locally, so the outro suggestion, the setup report line, and the warehouse task behave identically for decliners. Consent is tri-state rather than a boolean. An unresolved consent sends nothing, so a future collection path that reports before asking fails quiet. CI and signup runs resolve to granted at session build, since no screen can ask and a scripted run is the user's own automation. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016EXMTphgZGARMRdRw1yeFk
🧙 Wizard CIRun the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands: Test all apps:
Test all apps in a directory:
Test an individual app:
Show more apps
Results will be posted here when complete. |
…yout Review follow-ups on the disclosure change. The consent check was inlined at three call sites that disagreed about whether 'undecided' and 'declined' behave the same. It is now one predicate, following the aiApproved() pattern. sessionProperties() no longer knows what consent means: it calls an accessor that lives beside the field it governs, so the branch stops silently affecting six unrelated capture sites. A scan failure was reported as a clean zero result. Splitting the scan from the reporting meant a thrown error left the same empty state as a project with no detectable tools, so crashes landed in the denominator as successful scans. Failures are now distinguishable and skip the capture, which is what happened before the split. The opt-out label wrapped mid-word because the centered menu box is a fixed 24 columns shared by every intro screen. IntroScreenLayout takes an optional width so this screen can opt into a wider menu without changing the other eleven. The disclosure paragraph was unbounded and spanned the terminal while everything around it was centered. The subtitle claimed .env* contents stay local while the paragraph said .env variable names are read and shared. Both were true and together they read as a contradiction, so this screen now states the distinction once. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016EXMTphgZGARMRdRw1yeFk
Half the added lines in two files were prose. Trimmed to the reasons a reader cannot get from the code, and dropped the rest. Merges main, which had moved five commits ahead, including changes to warehouse source handover and .env reading. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016EXMTphgZGARMRdRw1yeFk
A --signup run creates a brand-new account headlessly, and that user has never seen the disclosure screen. Only --ci still auto-grants: a headless --ci --signup run stays covered by the ci branch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NMkv2CLet2YqY6XxRqfSiy
…d scans Adds Analytics#groupIdentify, mirroring capture()'s structure. Note: capture()/wizardCapture() carry no telemetry enabled/disabled guard today (--no-telemetry only gates the headless task stream), so there is nothing to mirror there. Splits the warehouse-source registry's LLM/AI section into its own array so AI_SOURCE_KINDS derives from the same entries instead of a hand-copied list, then stamps the org group with a boolean only once consent is granted and an AI kind (or a discovered LLM feature) shows up. Never the list of kinds, never other tools, never false or absent on decline/undecided. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NMkv2CLet2YqY6XxRqfSiy
|
|
||
| ctx.setFrameworkContext(DETECTED_WAREHOUSE_SOURCES_KEY, sources); | ||
| } catch (error) { | ||
| ctx.setFrameworkContext(WAREHOUSE_SCAN_FAILED_KEY, true); |
There was a problem hiding this comment.
Low: Scanner errors bypass consent
Detection runs while consent is undecided, but the scanner directly calls analytics.captureException for malformed package.json files and unexpected filesystem errors before this wrapper returns. A malicious repository can supply a malformed or symlinked manifest and cause repository-derived parser text to be transmitted before the user can decline; Node's JSON parse errors include an excerpt of the rejected input. Return a sanitized failure state or log locally during detection, and only capture it after the consent check.
PR overviewThis PR adds disclosure of dependency scanning and lets users decline sharing scan-related information through the PostHog integration. One security issue remains open: dependency detection can report malformed manifest or filesystem errors before consent is resolved. A crafted repository could therefore cause repository-derived parser text to be sent despite the user later declining sharing. Open issues (1)
Fixed/addressed: 0 · PR risk: 5/10 |
…#1157) Co-authored-by: Matt Brooker <matt@posthog.com>
edwinyjlim
left a comment
There was a problem hiding this comment.
@MattBro i trust you to take it the rest of the way
Problem
The wizard scans dependency manifests and
.envvariable names to find third-party tools in a project. It reports what it finds to PostHog. The report includes competitors such as Sentry, Mixpanel and Amplitude.This creates two problems. The wizard does not tell the user that it does this. The user cannot stop it.
The scan also runs first, before the intro screen and before login. No existing consent surface covers it. The OAuth screen is the login itself. The organization AI toggle covers source code sent to Anthropic. Neither surface can move earlier: one is the login, and the other reads a field from an organization the user has not logged into yet.
Changes
The intro screen now states what the wizard reads and why. A new menu option,
Continue, don't share tools, sits directly underContinue, so the first press of the down arrow selects it.A decline stops the report only. The scan still runs on the machine. A user who declines receives the same outro suggestion, the same setup report line, and the same warehouse task as any other user. Only the telemetry stops.
Consent has three states instead of two:
undecided,granted, anddeclined. Undecided consent sends nothing. A future code path that reports before the wizard asks will therefore send nothing instead of everything.grantedwhen the session is built. No screen can ask a question there, and a scripted run is the user's own automation.--signuprun does not resolve togranted. That flag creates a new account with no screens, and that user saw no disclosure.--ci --signuprun resolves togranted, because--cicovers it.One function converts scan results into telemetry. It runs when consent resolves, and a second call makes no further change.
When consent is
grantedand the scan finds an AI SDK, the wizard also setswizard_ai_sdk_detected: trueon the organization group. An AI SDK is an entry in the registry's LLM or AI section, or the LLM feature from dependency discovery. The value is a boolean. It never carries the list of kinds, and it never names a tool that is not an AI SDK. The wizard does not write it on a decline, and it never writesfalse, so an absent value means the wizard reported nothing. The wizard derives the AI kind set from the registry instead of holding a copy. Only wizard versions that carry this disclosure write the stamp, so anything downstream that scores on it is post-consent by construction. Scan results reported before this change stay unused.The privacy panel held a wrong statement. It said that
.env*files stay on your machine. The values do stay on the machine, but a variable name alone can produce a detection that the wizard sends.MIXPANEL_TOKENin a.envfile reports Mixpanel even when the project has no Mixpanel dependency. The panel now states this.A decline sends no
wizard: warehouse sources detectedevent. That event means "the scan ran, and here is what it found". Six saved insights depend on that meaning, and two of them apply no property filter. A row for a decline would give both a wrong result.wizard: intro menu selectedreports the decline rate instead.Test plan
Run the wizard against a project that holds a recognised tool, for example a
package.jsonthat listsstripe. SelectContinue, don't share tools. The outro still offers to connect the detected source. Nowizard: warehouse sources detectedevent arrives.setup wizard finishedcarries nowarehouse_source_kindstag and nodiscovered_featuresproperty.New tests cover these cases:
--cisession builds asgranted. A--signupsession without--cibuilds asundecided.The group stamp has its own tests. It is written for an AI kind, and for the LLM feature alone. It is not written on a decline, on undecided consent, on non-AI kinds only, or without an organization id.
All twelve intro screens share one centered menu box of 24 columns, and that width broke the new label inside a word.
IntroScreenLayoutnow accepts an optional width. Only this screen passes one, so the other eleven do not change. A test measures every label on this menu against that width, so a later addition fails in the test suite instead of in a screenshot.Follow-ups, not in this change
self-drivingprogram runs the same scan throughdetectConnectedTools. It reports the result with no disclosure and no way to decline. It detected Sentry in 292 runs over the last 30 days. It needs the same treatment, and it has its own intro screen.wizard warehousecommand also reports detected sources with no consent check.