From 5dbc607bc01b0f8f7e33837240d18e4f5478467c Mon Sep 17 00:00:00 2001 From: Daniel Petty Date: Thu, 1 Oct 2026 14:37:41 +0000 Subject: [PATCH 1/2] feat(telemetry): disable third-party telemetry and phone-home across k8s and devcontainer (#803) --- .devcontainer/devcontainer.json | 23 ++- ...y-telemetry-across-k8s-and-devcontainer.md | 42 +++++ k8s/ingress/traefik-values.yaml | 4 + k8s/llm/gateway/configmap.yaml | 1 + k8s/llm/gateway/deployment.yaml | 2 + k8s/llm/values-open-webui.yaml | 8 + k8s/logging/loki-values.yaml | 2 + k8s/monitoring/grafana-values.yaml | 8 + k8s/monitoring/k8s-monitoring-values.yaml | 7 + src/devops_cli/templates/devcontainer.json.j2 | 23 ++- tests/test_third_party_telemetry.py | 166 ++++++++++++++++++ 11 files changed, 284 insertions(+), 2 deletions(-) create mode 100644 docs/agent/tasks/task-803-disable-third-party-telemetry-across-k8s-and-devcontainer.md create mode 100644 tests/test_third_party_telemetry.py diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 8463f2d75d..4b68b11f9a 100755 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -54,7 +54,22 @@ "GIT_CONFIG_KEY_3": "credential.https://gist.github.com.helper", "GIT_CONFIG_VALUE_3": "!gh auth git-credential", "UV_MALWARE_CHECK": "1", - "UV_CACHE_DIR": "${containerWorkspaceFolder}/.uv" + "UV_CACHE_DIR": "${containerWorkspaceFolder}/.uv", + "DO_NOT_TRACK": "1", + "HF_HUB_DISABLE_TELEMETRY": "1", + "SCARF_NO_ANALYTICS": "true", + "NEXT_TELEMETRY_DISABLED": "1", + "CHECKPOINT_DISABLE": "1", + "DOTNET_CLI_TELEMETRY_OPTOUT": "1", + "ANONYMIZED_TELEMETRY": "false", + "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1", + "DISABLE_TELEMETRY": "1", + "GOTELEMETRY": "off", + "PIP_DISABLE_PIP_VERSION_CHECK": "1", + "npm_config_update_notifier": "false", + "DOCKER_CLI_HINTS": "false", + "MINIKUBE_WANTUPDATENOTIFICATION": "false", + "MINIKUBE_WANTREPORTERRORPROMPT": "false" }, "forwardPorts": [ 9418 @@ -90,6 +105,9 @@ "saoudrizwan.claude-dev" ], "settings": { + "telemetry.telemetryLevel": "off", + "redhat.telemetry.enabled": false, + "workbench.enableExperiments": false, "editor.formatOnSave": true, "editor.tabSize": 2, "editor.insertSpaces": true, @@ -134,6 +152,9 @@ "anthropic.claude-code" ], "settings": { + "telemetry.telemetryLevel": "off", + "redhat.telemetry.enabled": false, + "workbench.enableExperiments": false, "editor.formatOnSave": true, "editor.tabSize": 2, "editor.insertSpaces": true, diff --git a/docs/agent/tasks/task-803-disable-third-party-telemetry-across-k8s-and-devcontainer.md b/docs/agent/tasks/task-803-disable-third-party-telemetry-across-k8s-and-devcontainer.md new file mode 100644 index 0000000000..529bfb1cc6 --- /dev/null +++ b/docs/agent/tasks/task-803-disable-third-party-telemetry-across-k8s-and-devcontainer.md @@ -0,0 +1,42 @@ +# Task 803: Disable Third-Party Telemetry Across K8s Stack and DevContainer + +**Issue**: [#803](https://github.com/dan-petty/devops-cli/issues/803) +**Status**: Done +**Milestone**: `v0.2.24` +**Priority**: `priority/p2-medium` +**Scope**: `type/infra`, `type/security`, `scope/k8s`, `priority/p2-medium` + +--- + +## 1. Description & Objectives + +Disables third-party telemetry, phone-home mechanisms, version update checks, and crash reporting across the Kubernetes stack (Grafana, Alloy, Loki, Traefik, Open WebUI, LiteLLM Gateway) and the DevContainer development environment. + +Root causes & telemetry vectors addressed: +1. **Grafana & Logging**: + - Grafana sent anonymous telemetry to `stats.grafana.org`, polled `grafana.com` for application and plugin updates, and pulled news feeds. + - Grafana Alloy instances (`alloy-metrics`, `alloy-singleton`, `alloy-logs`) sent periodic usage reports to `https://stats.grafana.org/alloy-usage-report`. + - Grafana Loki reported operational analytics to `https://stats.grafana.org/loki-usage-report`. +2. **Ingress & LLM Services**: + - Traefik sent anonymous usage telemetry and performed version checks. + - Open WebUI polled GitHub releases for version updates and lacked explicit opt-outs for Scarf and anonymized telemetry. + - LiteLLM Gateway lacked explicit telemetry opt-outs in its deployment and ConfigMap. +3. **DevContainer Environment**: + - VS Code / Antigravity editor lacked explicit telemetry opt-outs for `telemetryLevel`, Red Hat extensions, and workbench experiments. + - Developer toolchains (Claude Code, Go, Pip, Minikube, NPM, Docker, Hugging Face, Scarf) lacked explicit opt-out environment variables. + +### Key Deliverables Completed: +- [x] **Kubernetes Monitoring & Logging Configuration** (`k8s/monitoring/grafana-values.yaml`, `k8s/monitoring/k8s-monitoring-values.yaml`, `k8s/logging/loki-values.yaml`): + - Added `analytics` and `news` blocks to `grafana.ini` disabling `reporting_enabled`, `check_for_updates`, `check_for_plugin_updates`, `feedback_links_enabled`, and `news_feed_enabled`. + - Added `selfReporting: enabled: false` and `enableReporting: false` across all Alloy collectors (`alloy-metrics`, `alloy-singleton`, `alloy-logs`). + - Added `analytics: reporting_enabled: false` to Loki Helm values. +- [x] **Ingress & LLM Stack Configuration** (`k8s/ingress/traefik-values.yaml`, `k8s/llm/values-open-webui.yaml`, `k8s/llm/gateway/configmap.yaml`, `k8s/llm/gateway/deployment.yaml`): + - Configured `--global.sendanonymoususage=false` and `--global.checknewversion=false` in Traefik values. + - Injected `ENABLE_VERSION_UPDATE_CHECK: "false"`, `ANONYMIZED_TELEMETRY: "false"`, `DO_NOT_TRACK: "true"`, and `SCARF_NO_ANALYTICS: "true"` into Open WebUI values. + - Set `telemetry: false` in LiteLLM Gateway ConfigMap and injected `LITELLM_TELEMETRY: "False"` into LiteLLM deployment. +- [x] **DevContainer Environment & Template** (`.devcontainer/devcontainer.json`, `src/devops_cli/templates/devcontainer.json.j2`): + - Set `telemetry.telemetryLevel: "off"`, `redhat.telemetry.enabled: false`, and `workbench.enableExperiments: false` under editor customizations. + - Injected environment variables into `containerEnv`: `DO_NOT_TRACK`, `HF_HUB_DISABLE_TELEMETRY`, `SCARF_NO_ANALYTICS`, `NEXT_TELEMETRY_DISABLED`, `CHECKPOINT_DISABLE`, `DOTNET_CLI_TELEMETRY_OPTOUT`, `ANONYMIZED_TELEMETRY`, `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`, `DISABLE_TELEMETRY`, `GOTELEMETRY`, `PIP_DISABLE_PIP_VERSION_CHECK`, `npm_config_update_notifier`, `DOCKER_CLI_HINTS`, `MINIKUBE_WANTUPDATENOTIFICATION`, and `MINIKUBE_WANTREPORTERRORPROMPT`. +- [x] **Automated Regression Test Suite** (`tests/test_third_party_telemetry.py`): + - Authored comprehensive structural assertions verifying zero telemetry across all modified manifests, configs, and devcontainer definitions. + - Validated 100% pass rate with zero flaky tests. diff --git a/k8s/ingress/traefik-values.yaml b/k8s/ingress/traefik-values.yaml index b8b21fd8e2..4b745d6b5b 100644 --- a/k8s/ingress/traefik-values.yaml +++ b/k8s/ingress/traefik-values.yaml @@ -2,6 +2,10 @@ # Configures Traefik as an internal ClusterIP ingress controller so external traffic # enters solely through the authenticated Cloudflare Tunnel. +additionalArguments: + - "--global.sendanonymoususage=false" + - "--global.checknewversion=false" + service: spec: type: ClusterIP diff --git a/k8s/llm/gateway/configmap.yaml b/k8s/llm/gateway/configmap.yaml index d9f923992e..8959b5cb87 100644 --- a/k8s/llm/gateway/configmap.yaml +++ b/k8s/llm/gateway/configmap.yaml @@ -164,6 +164,7 @@ data: callbacks: ["prometheus"] require_auth_for_metrics_endpoint: false drop_params: true + telemetry: false router_settings: # simple-shuffle routes requests weighted by throughput (litellm_params.weight), diff --git a/k8s/llm/gateway/deployment.yaml b/k8s/llm/gateway/deployment.yaml index 73f10fa629..2cf28e9459 100644 --- a/k8s/llm/gateway/deployment.yaml +++ b/k8s/llm/gateway/deployment.yaml @@ -57,6 +57,8 @@ spec: # Use the bundled model cost map; egress is limited to the inference backends. - name: LITELLM_LOCAL_MODEL_COST_MAP value: "True" + - name: LITELLM_TELEMETRY + value: "False" - name: LITELLM_REDIS_HOST value: "valkey.llm.svc.cluster.local" - name: LITELLM_REDIS_PORT diff --git a/k8s/llm/values-open-webui.yaml b/k8s/llm/values-open-webui.yaml index cf7010de3e..7f4cb38552 100644 --- a/k8s/llm/values-open-webui.yaml +++ b/k8s/llm/values-open-webui.yaml @@ -54,6 +54,14 @@ extraEnvVars: value: "true" - name: WEBUI_SECRET_KEY_FILE value: "/app/backend/data/.webui_secret_key" + - name: ENABLE_VERSION_UPDATE_CHECK + value: "false" + - name: ANONYMIZED_TELEMETRY + value: "false" + - name: DO_NOT_TRACK + value: "true" + - name: SCARF_NO_ANALYTICS + value: "true" # Valkey cache integration (replaces Redis) websocket: diff --git a/k8s/logging/loki-values.yaml b/k8s/logging/loki-values.yaml index 5a7fa92386..7cdf188185 100644 --- a/k8s/logging/loki-values.yaml +++ b/k8s/logging/loki-values.yaml @@ -6,6 +6,8 @@ deploymentMode: SingleBinary loki: auth_enabled: false + analytics: + reporting_enabled: false commonConfig: replication_factor: 1 diff --git a/k8s/monitoring/grafana-values.yaml b/k8s/monitoring/grafana-values.yaml index d4babc24bc..de2f099b48 100644 --- a/k8s/monitoring/grafana-values.yaml +++ b/k8s/monitoring/grafana-values.yaml @@ -32,6 +32,14 @@ grafana.ini: auth.anonymous: enabled: true org_role: Viewer + analytics: + reporting_enabled: false + check_for_updates: false + check_for_plugin_updates: false + feedback_links_enabled: false + news: + news_feed_enabled: false + datasources: datasources.yaml: diff --git a/k8s/monitoring/k8s-monitoring-values.yaml b/k8s/monitoring/k8s-monitoring-values.yaml index 359a72ab39..9899402c3b 100644 --- a/k8s/monitoring/k8s-monitoring-values.yaml +++ b/k8s/monitoring/k8s-monitoring-values.yaml @@ -14,6 +14,10 @@ destinations: type: loki url: http://loki.logging.svc.cluster.local:3100/loki/api/v1/push +# ── Self-Reporting ─────────────────────────────────────────────────────────── +selfReporting: + enabled: false + # ── Features ───────────────────────────────────────────────────────────────── clusterMetrics: enabled: true @@ -93,6 +97,7 @@ collectors: - clustered - statefulset alloy: + enableReporting: false resources: requests: cpu: 100m @@ -102,6 +107,7 @@ collectors: memory: 1024Mi alloy-singleton: alloy: + enableReporting: false resources: requests: cpu: 50m @@ -114,6 +120,7 @@ collectors: - daemonset - filesystem-log-reader alloy: + enableReporting: false resources: requests: cpu: 50m diff --git a/src/devops_cli/templates/devcontainer.json.j2 b/src/devops_cli/templates/devcontainer.json.j2 index f7094cd5bb..283beca958 100755 --- a/src/devops_cli/templates/devcontainer.json.j2 +++ b/src/devops_cli/templates/devcontainer.json.j2 @@ -53,7 +53,22 @@ "GIT_CONFIG_VALUE_2": "", "GIT_CONFIG_KEY_3": "credential.https://gist.github.com.helper", "GIT_CONFIG_VALUE_3": "!gh auth git-credential", - "UV_MALWARE_CHECK": "1" + "UV_MALWARE_CHECK": "1", + "DO_NOT_TRACK": "1", + "HF_HUB_DISABLE_TELEMETRY": "1", + "SCARF_NO_ANALYTICS": "true", + "NEXT_TELEMETRY_DISABLED": "1", + "CHECKPOINT_DISABLE": "1", + "DOTNET_CLI_TELEMETRY_OPTOUT": "1", + "ANONYMIZED_TELEMETRY": "false", + "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1", + "DISABLE_TELEMETRY": "1", + "GOTELEMETRY": "off", + "PIP_DISABLE_PIP_VERSION_CHECK": "1", + "npm_config_update_notifier": "false", + "DOCKER_CLI_HINTS": "false", + "MINIKUBE_WANTUPDATENOTIFICATION": "false", + "MINIKUBE_WANTREPORTERRORPROMPT": "false" }, {% if minikube %} "forwardPorts": [ @@ -122,6 +137,9 @@ "anthropic.claude-code" ], "settings": { + "telemetry.telemetryLevel": "off", + "redhat.telemetry.enabled": false, + "workbench.enableExperiments": false, "editor.formatOnSave": true, "editor.tabSize": 2, "editor.insertSpaces": true, @@ -151,6 +169,9 @@ "anthropic.claude-code" ], "settings": { + "telemetry.telemetryLevel": "off", + "redhat.telemetry.enabled": false, + "workbench.enableExperiments": false, "editor.formatOnSave": true, "editor.tabSize": 2, "editor.insertSpaces": true, diff --git a/tests/test_third_party_telemetry.py b/tests/test_third_party_telemetry.py new file mode 100644 index 0000000000..c948aa105f --- /dev/null +++ b/tests/test_third_party_telemetry.py @@ -0,0 +1,166 @@ +"""Tests verifying third-party telemetry, phone-home, and update checks are disabled.""" + +import json +from pathlib import Path + +import yaml + +REPO_ROOT = Path(__file__).resolve().parent.parent +K8S_DIR = REPO_ROOT / "k8s" +DEVCONTAINER_JSON = REPO_ROOT / ".devcontainer" / "devcontainer.json" + + +def test_grafana_values_disables_telemetry_and_news() -> None: + """Verify Grafana Helm values disables telemetry reporting, update checks, and news.""" + values_path = K8S_DIR / "monitoring" / "grafana-values.yaml" + assert values_path.is_file(), f"Missing {values_path}" + + with open(values_path, encoding="utf-8") as f: + data = yaml.safe_load(f) + + ini = data.get("grafana.ini", {}) + analytics = ini.get("analytics", {}) + news = ini.get("news", {}) + + actual = ( + analytics.get("reporting_enabled"), + analytics.get("check_for_updates"), + analytics.get("check_for_plugin_updates"), + analytics.get("feedback_links_enabled"), + news.get("news_feed_enabled"), + ) + expected = (False, False, False, False, False) + assert actual == expected + + +def test_k8s_monitoring_values_disables_alloy_telemetry() -> None: + """Verify k8s-monitoring Helm values disables self-reporting and Alloy telemetry.""" + values_path = K8S_DIR / "monitoring" / "k8s-monitoring-values.yaml" + assert values_path.is_file(), f"Missing {values_path}" + + with open(values_path, encoding="utf-8") as f: + data = yaml.safe_load(f) + + self_reporting = data.get("selfReporting", {}).get("enabled") + collectors = data.get("collectors", {}) + metrics_rep = collectors.get("alloy-metrics", {}).get("alloy", {}).get("enableReporting") + singleton_rep = collectors.get("alloy-singleton", {}).get("alloy", {}).get("enableReporting") + logs_rep = collectors.get("alloy-logs", {}).get("alloy", {}).get("enableReporting") + + assert (self_reporting, metrics_rep, singleton_rep, logs_rep) == (False, False, False, False) + + +def test_loki_values_disables_analytics() -> None: + """Verify Loki Helm values disables anonymous usage reporting.""" + values_path = K8S_DIR / "logging" / "loki-values.yaml" + assert values_path.is_file(), f"Missing {values_path}" + + with open(values_path, encoding="utf-8") as f: + data = yaml.safe_load(f) + + analytics = data.get("loki", {}).get("analytics", {}) + assert analytics.get("reporting_enabled") is False + + +def test_traefik_values_disables_telemetry_and_version_check() -> None: + """Verify Traefik Helm values passes flags to disable anonymous usage and version check.""" + values_path = K8S_DIR / "ingress" / "traefik-values.yaml" + assert values_path.is_file(), f"Missing {values_path}" + + with open(values_path, encoding="utf-8") as f: + data = yaml.safe_load(f) + + args = data.get("additionalArguments", []) + assert "--global.sendanonymoususage=false" in args + assert "--global.checknewversion=false" in args + + +def test_open_webui_values_disables_telemetry_and_version_check() -> None: + """Verify Open-WebUI Helm values disables version update check and analytics.""" + values_path = K8S_DIR / "llm" / "values-open-webui.yaml" + assert values_path.is_file(), f"Missing {values_path}" + + with open(values_path, encoding="utf-8") as f: + data = yaml.safe_load(f) + + env_map = {item["name"]: item["value"] for item in data.get("extraEnvVars", [])} + actual = ( + env_map.get("ENABLE_VERSION_UPDATE_CHECK"), + env_map.get("ANONYMIZED_TELEMETRY"), + env_map.get("DO_NOT_TRACK"), + env_map.get("SCARF_NO_ANALYTICS"), + ) + expected = ("false", "false", "true", "true") + assert actual == expected + + +def test_litellm_gateway_disables_telemetry() -> None: + """Verify LiteLLM Gateway configmap and deployment disable telemetry.""" + configmap_path = K8S_DIR / "llm" / "gateway" / "configmap.yaml" + deployment_path = K8S_DIR / "llm" / "gateway" / "deployment.yaml" + assert configmap_path.is_file() and deployment_path.is_file() + + cm_data = yaml.safe_load(configmap_path.read_text(encoding="utf-8")) + config_yaml = yaml.safe_load(cm_data.get("data", {}).get("config.yaml", "")) + litellm_settings = config_yaml.get("litellm_settings", {}) + assert litellm_settings.get("telemetry") is False + + dep_data = yaml.safe_load(deployment_path.read_text(encoding="utf-8")) + container = dep_data["spec"]["template"]["spec"]["containers"][0] + dep_env = { + item["name"]: item.get("value") for item in container.get("env", []) if "value" in item + } + assert dep_env.get("LITELLM_TELEMETRY") == "False" + + +def test_devcontainer_disables_telemetry() -> None: + """Verify devcontainer.json specifies telemetry opt-out variables and editor settings.""" + assert DEVCONTAINER_JSON.is_file(), f"Missing {DEVCONTAINER_JSON}" + + data = json.loads(DEVCONTAINER_JSON.read_text(encoding="utf-8")) + env = data.get("containerEnv", {}) + + actual_env = ( + env.get("DO_NOT_TRACK"), + env.get("HF_HUB_DISABLE_TELEMETRY"), + env.get("SCARF_NO_ANALYTICS"), + env.get("NEXT_TELEMETRY_DISABLED"), + env.get("CHECKPOINT_DISABLE"), + env.get("DOTNET_CLI_TELEMETRY_OPTOUT"), + env.get("ANONYMIZED_TELEMETRY"), + env.get("CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC"), + env.get("DISABLE_TELEMETRY"), + env.get("GOTELEMETRY"), + env.get("PIP_DISABLE_PIP_VERSION_CHECK"), + env.get("npm_config_update_notifier"), + env.get("DOCKER_CLI_HINTS"), + env.get("MINIKUBE_WANTUPDATENOTIFICATION"), + env.get("MINIKUBE_WANTREPORTERRORPROMPT"), + ) + expected_env = ( + "1", + "1", + "true", + "1", + "1", + "1", + "false", + "1", + "1", + "off", + "1", + "false", + "false", + "false", + "false", + ) + assert actual_env == expected_env + + vscode_settings = data.get("customizations", {}).get("vscode", {}).get("settings", {}) + actual_settings = ( + vscode_settings.get("telemetry.telemetryLevel"), + vscode_settings.get("redhat.telemetry.enabled"), + vscode_settings.get("workbench.enableExperiments"), + ) + expected_settings = ("off", False, False) + assert actual_settings == expected_settings From 9aaf375ff8417f134a6862c9d6e1942a79275e13 Mon Sep 17 00:00:00 2001 From: Daniel Petty Date: Thu, 1 Oct 2026 14:49:24 +0000 Subject: [PATCH 2/2] docs(instructions): require third-party telemetry opt-outs and confirmation for functional web integrations (#803) --- AGENTS.md | 3 +++ ...party-telemetry-across-k8s-and-devcontainer.md | 6 +++++- src/devops_cli/ai/instruction_generator.py | 15 +++++++++++++++ tests/test_instruction_generator.py | 3 +++ 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 1bf6ddc384..79d8ab00b8 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -51,6 +51,9 @@ This document provides foundational context, architectural principles, and opera - **Defensive Filesystem, Symlink & Resource Containment**: - Always enforce pre-flight file size caps (e.g. `MAX_REPOMAP_FILE_SIZE_BYTES` $\le 50$MB) before ingesting, parsing, or packing files into memory (via Python AST, Tree-Sitter, or text loaders) to prevent out-of-memory crashes and denial-of-service from minified bundles, database dumps, or large binaries. - Always defensively resolve filesystem symlinks (`path.resolve()`) and verify that target paths remain strictly confined within the intended root workspace (`resolved_path.is_relative_to(base_root)`), catching `(OSError, RuntimeError)` to prevent circular symlink loops (`ELOOP`) and directory traversal escapes. + - **Mandatory Third-Party Telemetry & Phone-Home Opt-Outs**: + - **Strict Opt-Out of Non-Functional Third-Party Telemetry**: AI agents, automated workflows, and configuration templates MUST always disable and opt out of third-party telemetry, phone-home mechanisms, anonymous usage reporting, crash analytics, and background phone-home update checks across all tools, services, workloads, container environments, and CLI configurations whenever doing so does not impact functional user experience (e.g. Grafana `analytics.reporting_enabled: false`, Alloy `enableReporting: false`, Loki `analytics.reporting_enabled: false`, Traefik `--global.sendanonymoususage=false` / `--global.checknewversion=false`, Open WebUI `ANONYMIZED_TELEMETRY: "false"` / `DO_NOT_TRACK: "true"` / `SCARF_NO_ANALYTICS: "true"` / `ENABLE_VERSION_UPDATE_CHECK: "false"`, LiteLLM Gateway `telemetry: false` / `LITELLM_TELEMETRY: "False"`, and devcontainer environment opt-outs `DO_NOT_TRACK=1`, `GOTELEMETRY=off`, `PIP_DISABLE_PIP_VERSION_CHECK=1`, `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1`, `HF_HUB_DISABLE_TELEMETRY=1`). + - **User Confirmation Required for Functional Web Integrations**: For web integrations and external network calls that provide tangible user-facing functionality or dynamic content (such as IDE plugin and extension update notifications, live community news feeds, or remote marketplace catalogs), AI agents MUST NOT unilaterally disable them without confirming with the user first. Always distinguish purely passive background telemetry and phone-home traffic from active user-facing capabilities, confirming user intent before suppressing functional web integrations. - **Never Lower Security Standards or Quality Thresholds**: Never lower, relax, disable, bypass, or weaken security standards, quality thresholds (such as minimum 90% code coverage, strict static type checks, or lint rules), or compliance validations unless explicitly instructed by the user. - **Continuous Standards Compliance & Solution Refinement**: Ensure every proposed solution, design, code change, or architecture meets all project standards and conventions, iteratively refining until every standard is met or exceeded. - **Strict Pre-Push Quality Gate Mandate (Zero Pushes Without Passing `devops ci`)**: diff --git a/docs/agent/tasks/task-803-disable-third-party-telemetry-across-k8s-and-devcontainer.md b/docs/agent/tasks/task-803-disable-third-party-telemetry-across-k8s-and-devcontainer.md index 529bfb1cc6..8f2692afce 100644 --- a/docs/agent/tasks/task-803-disable-third-party-telemetry-across-k8s-and-devcontainer.md +++ b/docs/agent/tasks/task-803-disable-third-party-telemetry-across-k8s-and-devcontainer.md @@ -37,6 +37,10 @@ Root causes & telemetry vectors addressed: - [x] **DevContainer Environment & Template** (`.devcontainer/devcontainer.json`, `src/devops_cli/templates/devcontainer.json.j2`): - Set `telemetry.telemetryLevel: "off"`, `redhat.telemetry.enabled: false`, and `workbench.enableExperiments: false` under editor customizations. - Injected environment variables into `containerEnv`: `DO_NOT_TRACK`, `HF_HUB_DISABLE_TELEMETRY`, `SCARF_NO_ANALYTICS`, `NEXT_TELEMETRY_DISABLED`, `CHECKPOINT_DISABLE`, `DOTNET_CLI_TELEMETRY_OPTOUT`, `ANONYMIZED_TELEMETRY`, `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`, `DISABLE_TELEMETRY`, `GOTELEMETRY`, `PIP_DISABLE_PIP_VERSION_CHECK`, `npm_config_update_notifier`, `DOCKER_CLI_HINTS`, `MINIKUBE_WANTUPDATENOTIFICATION`, and `MINIKUBE_WANTREPORTERRORPROMPT`. -- [x] **Automated Regression Test Suite** (`tests/test_third_party_telemetry.py`): +- [x] **Agent Instructions & Instruction Generator** (`AGENTS.md`, `src/devops_cli/ai/instruction_generator.py`, `tests/test_instruction_generator.py`): + - Codified the Mandatory Third-Party Telemetry & Phone-Home Opt-Outs policy into `AGENTS.md` and `instruction_generator.py`. + - Added requirement for AI agents to disable third-party telemetry and phone-home mechanisms across all tools and configurations when it does not impact functional user experience. + - Added requirement for AI agents to confirm with the user before disabling web integrations that provide tangible functionality (e.g. plugin/extension update checks, news feeds). +- [x] **Automated Regression Test Suite** (`tests/test_third_party_telemetry.py`, `tests/test_instruction_generator.py`): - Authored comprehensive structural assertions verifying zero telemetry across all modified manifests, configs, and devcontainer definitions. - Validated 100% pass rate with zero flaky tests. diff --git a/src/devops_cli/ai/instruction_generator.py b/src/devops_cli/ai/instruction_generator.py index 33b2026c19..ba18c3e406 100644 --- a/src/devops_cli/ai/instruction_generator.py +++ b/src/devops_cli/ai/instruction_generator.py @@ -283,6 +283,21 @@ def generate_agents_md(meta: ProjectMetadata) -> str: endpoints. - Enforce subprocess safety with explicit command argument lists, bounded timeouts, and error handling. + - **Mandatory Third-Party Telemetry & Phone-Home Opt-Outs**: + - **Strict Opt-Out of Non-Functional Third-Party Telemetry**: AI agents, automated workflows, + and configuration templates MUST always disable and opt out of third-party telemetry, phone-home + mechanisms, anonymous usage reporting, crash analytics, and background update checks across all + tools, services, workloads, container environments, and CLI configurations whenever doing so does + not impact the functional user experience (e.g. Grafana reporting, Alloy telemetry, Loki usage + reports, Traefik anonymous usage, Open WebUI analytics, LiteLLM telemetry, and DevContainer + toolchain opt-outs like `DO_NOT_TRACK=1`, `GOTELEMETRY=off`, `PIP_DISABLE_PIP_VERSION_CHECK=1`, + `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1`). + - **Confirmation Required for Functional Web Integrations**: For web integrations and external + network calls that provide tangible user-facing functionality or dynamic content (such as IDE + plugin and extension update notifications, live community news feeds, or marketplace catalogs), + AI agents MUST NOT unilaterally disable them without confirming with the user first. Always + distinguish purely passive background telemetry and phone-home traffic from active user-facing + capabilities, confirming user intent before suppressing functional web integrations. - **Strict Prohibition of Brittle Pattern Subsets & Mandatory Constants/Defaults Placement**: - Matching against a list of strings or regular expressions is **ONLY acceptable if it covers 100% of possible scenarios** (i.e. mathematically bounded, closed, exhaustive domains defined by official RFCs or deterministic language grammars). - Matching against a **limited or arbitrary subset of a larger or unknown list of possible values is strictly prohibited**. Never guess or match against ad-hoc prefixes, suffixes, or partial word lists (e.g. arbitrary identifier prefixes, property suffixes, or selective web TLDs). Instead, use mature, robust engineering solutions such as programming language symbol parsers (e.g. Python AST visitors, tokenizer pipelines), official registries (e.g. Mozilla Public Suffix List via `tldextract`), or system domain lookup tooling. diff --git a/tests/test_instruction_generator.py b/tests/test_instruction_generator.py index 1163e605fd..359c057d4c 100644 --- a/tests/test_instruction_generator.py +++ b/tests/test_instruction_generator.py @@ -128,6 +128,9 @@ def test_generate_agents_md_contains_required_sections() -> None: assert "asyncio.Semaphore(5)" in content assert "Comprehensive Sanitization of Internal Systems & Homelab Data" in content assert "" in content + assert "Mandatory Third-Party Telemetry & Phone-Home Opt-Outs" in content + assert "Strict Opt-Out of Non-Functional Third-Party Telemetry" in content + assert "Confirmation Required for Functional Web Integrations" in content # Verify external/generic project AGENTS.md omits pre-1.0 alpha lifecycle block meta_generic = ProjectMetadata(