feat: agent install telemetry (installer side, spec §8.3)#30
Conversation
|
@claude review |
|
🤖 Claude security review requested by @lxcong. Running against HEAD |
|
🤖 Claude security review — HEAD: ba123d1 Scope:
|
… capture
Three review findings addressed:
1. Misleading opt-out semantics (both scripts) — when --no-telemetry /
-NoTelemetry was active, only AGENTKEY_TELEMETRY=0 signaled the server,
but AGENTKEY_DEVICE_FINGERPRINT (sha256 of hostname|platform|user) +
AGENTKEY_DETECTED_AGENTS + AGENTKEY_SELECTED_AGENTS + the rest were
still computed and exported to the child `npx @agentkey/mcp` process.
The help text "Disable anonymous usage telemetry" and the UI banner
"Telemetry: disabled" implied source-level suppression — the actual
behavior leaked hostname-derived data regardless. Now opt-out is
honored at the source: TELEMETRY=0 is the only env exported, the
fingerprint is never computed, agent lists never passed.
2. install.ps1 -NoTelemetry help text and inline comment referenced
~/.config/agentkey/telemetry-disabled (Unix path notation) while
actually writing to %USERPROFILE%\.config\agentkey\telemetry-disabled.
Updated to Windows path notation for both.
3. install.sh: `for _f in "$@"` ran on an exhausted $@ — main()'s arg
parse loop shifts every positional out via `shift`, so by the time the
telemetry block executed, AGENTKEY_INSTALLER_FLAGS was always empty.
Snapshot args at main() entry into _orig_args=("$@") and iterate that.
install.ps1 was already correct because $PSBoundParameters captures
the parameter set at script entry and is not modified by execution.
Verified opt-out path now exports ONLY AGENTKEY_TELEMETRY=0; opt-in path
exports all 5 context vars with AGENTKEY_INSTALLER_FLAGS correctly
populated (e.g. "--yes,--skip-skill").
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@claude review |
|
🤖 Claude security review requested by @lxcong. Running against HEAD |
|
🤖 Claude security review — HEAD: cc2b90c Scope: 💡 Suggestion (nice-to-have)
✅ No credential leaks, shell injection, or supply-chain issues found. Review triggered by @lxcong |
Summary
Installer-side half of the agent-install telemetry rollout (spec §8.3). Adds
--no-telemetryopt-out, telemetry status banner, and 7-var env passthrough tonpx -y @agentkey/mcp --auth-loginso the server can captureinstall_completedwith full install context.scripts/install.sh:--no-telemetryflag,compute_device_fingerprint()helper, env exports immediately before the--auth-logininvocationscripts/install.ps1: PowerShell-mirror of the same —-NoTelemetry, SHA-256 fingerprint,$env:AGENTKEY_*exportsBlocked on
AgentKey-Server PR that consumes the 7 transparent env vars (
AGENTKEY_TELEMETRY,AGENTKEY_INSTALL_SOURCE,AGENTKEY_DETECTED_AGENTS,AGENTKEY_SELECTED_AGENTS,AGENTKEY_INSTALLER_FLAGS,AGENTKEY_DEVICE_FINGERPRINT— plus implicit skill-version detection on the server side) and captureinstall_completed. Until that lands, the env passthrough goes to a process that does nothing with them — harmless, but the telemetry signal is incomplete.This PR can be merged independently — it does not break the existing installer flow either way.
Test plan
bash -n scripts/install.sh— syntactic check passesbash scripts/install.sh --help—--no-telemetrydocumented in Optionsbash scripts/install.sh --list-agents— early-return path unaffectedbash scripts/install.sh --no-telemetry --skip-skill --skip-mcp --yes— creates~/.config/agentkey/telemetry-disabled, prints "Telemetry: disabled (--no-telemetry)"install.ps1structural checks (line count,\$NoTelemetryreferences, singleparam(...)block, brace balance)🤖 Generated with Claude Code