Repository navigation
fix(privacy): DO_NOT_TRACK stops every request to a vendor-operated host (#4499) - #4504
Merged
Merged
Conversation
…ost (#4499) DO_NOT_TRACK was documented as the opt-out for air-gapped and privacy-strict installs but covered two channels out of five. The help widget's Ask tab and the ask_trinity MCP tool had no switch, and the report switch was a frontend build argument: inert on the published images, and never passed by docker-compose.yml. - config: BUG_REPORTING_ENABLED and ASK_TRINITY_ENABLED, read at run time and both off under DO_NOT_TRACK. - GET /api/version carries them as `help`. The help widget shows a channel only for a literal true, so it fails closed, and is not rendered with both off. - mcp-server: ask_trinity is not registered when switched off. - render-nginx.sh writes the served security headers without the host of a channel that is off. It removes two fixed strings and writes no environment value into the configuration. - All three compose files pass the switches to the backend, the MCP server and the nginx frontend. - A census test fails when a vendor-operated host appears in the source without a switch that DO_NOT_TRACK also turns off. Fixes #4499 Co-Authored-By: Claude Fable 5.2 <[email protected]>
obasilakis
approved these changes
Nov 12, 2026
obasilakis
left a comment
Contributor
There was a problem hiding this comment.
/review + /validate-pr — #4504
Verdict: APPROVE. No blocking findings. Lane C (compose files), Tier 1 green, journey-smoke and both e2e runs green on the PR.
Scope / acceptance criteria (#4499)
| AC | Status |
|---|---|
DO_NOT_TRACK=1 disables all five channels at run time, on published images too |
DONE: config.py (backend), docs.ts::askTrinityEnabled (MCP), render-nginx.sh (CSP), widget via /api/version → help |
| Widget reads switches at run time; tabs and widget hidden when off | DONE: HelpChatWidget.vue visibleTabs / anyChannel, fails closed |
ask_trinity has a real off switch, unlisted for every scope |
DONE: tool dropped from createDocsTools() before addAllTools |
CSP connect-src drops both hosts when everything is off |
DONE: render-nginx.sh, all four includes point at the generated copy |
| Census test of hardcoded vendor hosts | DONE, with a limit (I2) |
.env.example + user docs state what is and is not covered |
DONE: .env.example, single-server.md, faq/security.md |
Execution coverage
| symbol | executed by | live consumer | verdict |
|---|---|---|---|
config.BUG_REPORTING_ENABLED / ASK_TRINITY_ENABLED |
TestTheSwitches (exec of real config.py) |
main.py::get_version |
✅ |
payload["help"] |
test_the_handler_sends_both_switches_as_help (AST) |
HelpChatWidget.vue |
🛡 shape guard; widget side executed by the mount spec |
askTrinityEnabled / createDocsTools(env) |
ask_trinity_switch.test.ts |
server.ts:662 |
✅ |
render-nginx.sh CSP block |
TestTheServedPolicy runs the real script |
Dockerfile.prod entrypoint |
✅ |
HelpChatWidget gating |
helpWidgetVendorSwitch4499.mount.spec.js (jsdom mount) |
App.vue:37 |
✅ |
Mutation: dropping and not _DO_NOT_TRACK from config.py turns 12 tests red.
Informational (non-blocking)
- I1:
render-nginx.shtests fail on macOS.sed -i "s|…||g" fileis GNU/busybox syntax; BSD sed reads the next argument as the backup suffix, so 4 tests inTestTheServedPolicyfail locally on a Mac (sed: 1: "...": invalid command code v). Production (alpine) and CI (Linux) are fine. Portable fix:sed "s|…||g" "$f" > "$f.2" && mv "$f.2" "$f". - I2: the census matches only
abilityai.devandcloudfunctions.net. A new channel on another vendor domain passes it silently. Worth a one-line comment naming that limit, or widening the regex when the next domain shows up. - I3: two docs still describe the report switch as build-time.
docs/user-docs/getting-started/help.md:87("disable the report tabs or repoint the intake URL at build time") anddocs/memory/feature-flows/in-app-bug-reporting.md:64(config knobs listed as build-time). Neither mentionsBUG_REPORTING_ENABLED/ASK_TRINITY_ENABLED/DO_NOT_TRACK. - I4:
DO_NOT_TRACKalso turns off a self-hosted mirror. WithASK_TRINITY_ENDPOINTorVITE_BUG_INTAKE_URLpointed at an internal host,DO_NOT_TRACK=1still removes the tool and the tabs. This matches the PR's stated contract. An operator who mirrors internally has to leaveDO_NOT_TRACKunset and use the per-channel switches. Could be one line in.env.example.
Validation
- Commit: conventional, descriptive. Base
dev. 19 files. Fixes #4499present (P1, type-bug), so status auto-promotes on merge.- Security greps (keys, emails, IPs, host paths, file modes): clean. New env vars are wired into all three compose files and
.env.example. - Architecture:
architecture/security.mdandarchitecture/mcp-server.mdupdated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DO_NOT_TRACK=1is documented as the opt-out for air-gapped and privacy-strict installs, but it covered two outbound channels out of five. The help widget's Ask tab and theask_trinityMCP tool had no switch at all, and the report switch was a frontend build argument: inert on the published images, and never passed bydocker-compose.yml. Reproduced onv1.0.5-rc2(issue comment).After this PR one run-time setting stops every request to a vendor-operated host, with no rebuild.
Changes
src/backend/config.py:BUG_REPORTING_ENABLEDandASK_TRINITY_ENABLED, read at run time, both off underDO_NOT_TRACK(same truthiness as OPERATOR_INTAKE_ENABLED / DO_NOT_TRACK privacy kill switch is inert (not forwarded by compose) #1486).src/backend/main.py:GET /api/versioncarries them ashelp: {docs_qa, bug_reporting}.HelpChatWidget.vue: tabs followhelp. A channel shows only for a literaltrue, so the widget fails closed: nothing before the answer, on a failed read, or on a backend that sends nohelp. With both off it is not rendered. The build-timeVITE_BUG_REPORTING_ENABLEDcan still turn reporting off and can no longer turn it on.src/mcp-server/src/tools/docs.ts:ask_trinityis not registered when switched off, so it is absent from every listing and cannot be called.render-nginx.sh,nginx-server.conf: the servedsecurity-headers.confis written at container start without the host of a channel that is off. Only two fixed strings are removed; no environment value is written into the configuration..env.example, the single-server guide, the security FAQ (which said there were "exactly two outbound paths"), the architecture notes and the helper-mcp README.Behaviour change to know about
A new frontend against an older backend (no
helpin/api/version), or a failed/api/versionread, hides the help widget. That is the fail-closed direction and is deliberate.Test plan
tests/unit/test_4499_vendor_egress_switch.py: the switch matrix, thehelpkeys, compose wiring per service, the rendered policy (including a hostile switch value), and a census that fails when a vendor-operated host appears in the source without a switchDO_NOT_TRACKalso turns offsrc/mcp-server:ask_trinity_switch.test.ts; full suite 1425 passed;tsc --noEmitcleansrc/frontend:helpWidgetVendorSwitch4499.mount.spec.js; the two specs that mount the widget; the raw-colour and loading-gate ratchets.env.example, the nginx configuration or the user docs: 2468 passedconnect-src),DO_NOT_TRACK=1(neither), each single switch (only its own host gone)One existing spec is edited:
helpWidgetChatTab.mount.spec.jsnow supplies the flags in its setup. No assertion changed.Fixes #4499
🤖 Generated with Claude Code