Open-source, local-first social media research agent for Instagram, TikTok, and LinkedIn. Jev routes read-only steps; socai CLI captures cited browser evidence.
JavaScript agent-skillsai-agentsbrowser-agentbrowser-automationdecision-modeldeep-researchinstagramjevlinkedinlocal-firstopen-sourceosintresearch-agentsocaisocial-listeningsocial-mediasocial-media-researchsocmintsystem-onetiktok
fix: default socai child telemetry to off (#83)
Asklv609a05447e03
diff --git a/.env.example b/.env.exampleindex 77830fc..6bafd04 100644--- a/.env.example+++ b/.env.example@@ -20,3 +20,10 @@ SOCAI_BIN=# Optional isolated state directory. Defaults to ~/.jev-social.JEV_SOCIAL_HOME=++# Jev Social disables the separate socai CLI telemetry stream by default.+# Set this to 1 only when you explicitly want to opt in.+SOCAI_TELEMETRY=0+# These narrower controls apply only if telemetry is explicitly enabled.+SOCAI_TELEMETRY_QUERY_TEXT=off+SOCAI_TELEMETRY_CHAT_TEXT=offdiff --git a/README.md b/README.mdindex 831406f..a80db1b 100644--- a/README.md+++ b/README.md@@ -82,6 +82,7 @@ The report model defaults to `openai/gpt-4o-mini` and may incur normal provider- Jev Social does not read or copy the browser cookie store directly. The installed `socai CLI` uses the Chrome profile you selected; use a separate profile or test account for sensitive research.- OpenRouter is the default decision provider. Decision requests contain the full research goal plus the requested platform, current action labels, source URLs, earlier action summaries, and short visible-text excerpts. The application does not intentionally add cookies, downloaded media, raw CLI JSON, or filesystem fields, but user input and visible social content are untrusted and can themselves contain personal or path-like text. Optional report synthesis receives a separate bounded, sanitized evidence payload; set `OPENROUTER_REPORT_MODEL=off` to disable that second model call. A configured Kev or Simple Jev endpoint keeps decision requests on the explicit loopback server and never receives the OpenRouter key.+- Jev Social has no analytics endpoint of its own and sets `SOCAI_TELEMETRY=0` for every spawned `socai CLI` process by default. Set `SOCAI_TELEMETRY=1` only to opt in explicitly. In the audited `socai v0.6.1` contract, enabled CLI events can include search text, action targets, device context, and available cloud-account fields before the socai.io proxy forwards them to Axiom; the OpenRouter key itself is filtered from the child environment. A separately running socai desktop app has its own process-level setting. Exact fields, narrower controls, version scope, and the undocumented server-side retention period are detailed in the security policy.- Recoverable checkpoints live under `${JEV_SOCIAL_HOME:-~/.jev-social}`; `socai` stores its own evidence and downloaded media separately. There is no automatic cleanup schedule. Stop the app, inspect the run, and remove only the specific checkpoint or evidence directory you no longer need.- TikTok media download becomes an available action only when the research goal explicitly requests an offline copy. That intent is retained in the operation history; there is no second confirmation after the explicit request.diff --git a/SECURITY.md b/SECURITY.mdindex 65e1a97..ddaedaf 100644--- a/SECURITY.md+++ b/SECURITY.md@@ -26,6 +26,25 @@ Jev Social runs locally, but it is not an offline application.- A local decision server has its own model, log, and retention behavior. Jev Social neither starts nor downloads that server automatically. Set `OPENROUTER_REPORT_MODEL=off` if an OpenRouter key remains configured but the report must stay on the deterministic local path.- The installed socai CLI and Chrome connect to the selected social platform. Their browser and network behavior is maintained by [socai](https://github.com/socai-io/socai), outside the Jev Social process.+### socai CLI telemetry++Jev Social does not proxy OpenRouter traffic through a Jev Social or socai server and does not operate an analytics endpoint of its own. Its OpenRouter requests go directly to OpenRouter. It launches `socai` with an explicit environment allowlist that excludes `OPENROUTER_API_KEY`, `TYPESAFE_API_KEY`, `SOCAI_API_KEY`, and session-token variables.++The installed `socai CLI` has a separate telemetry contract. Jev Social sets `SOCAI_TELEMETRY=0` when it is absent, so its spawned CLI processes do not emit socai telemetry by default. This privacy default applies to capability probes and browser actions and works when the CLI reuses an existing daemon. Set `SOCAI_TELEMETRY=1` in the launching environment or project `.env` only to opt in explicitly.++For the audited `socai v0.6.1` release, explicitly enabled telemetry has these boundaries:++- Structured CLI events go to `https://socai.io/v1/events`, then the first-party proxy forwards every client-supplied scalar field to the third-party observability provider Axiom. The public client does not contact Axiom directly.+- Events include a stable install ID, process-session and request IDs, app/platform/device context, command status and timing, and search query text by default. Shared enrichment code can also add the authenticated cloud account's full phone number, point balance, Pro expiry, and subscription status when that account snapshot is available.+- Every non-`query` command argument is summarized into event metadata. Depending on the selected action, that can include Instagram or LinkedIn profile/company URLs and TikTok author handles or URLs. `SOCAI_TELEMETRY_QUERY_TEXT=off` omits the dedicated search-query text but does not remove those targets or other metadata. Only the master `SOCAI_TELEMETRY=0` setting prevents the CLI event upload.+- Ordinary tool results do not include captured post/comment bodies, downloaded media, cookies, browser storage, raw output, or model output. A bounded unexpected-page OCR diagnostic is a documented exception. socai applies pattern-based secret scrubbing to event text, but it is not a guarantee for arbitrary secret formats pasted into a query, target, error, or other field. Independently, Jev Social prevents its configured OpenRouter and socai credentials from entering the child environment at all.+- `SOCAI_TELEMETRY_CHAT_TEXT=off` controls conversation content and note summaries in agent run traces. Jev Social forwards it, but Jev Social invokes plain CLI tool commands, which emit events rather than uploading traces. The TUI may write `trace.json` locally without uploading it. Only the separately launched desktop app uploads content-bearing run traces, and an already-running desktop process is unaffected by Jev Social's child environment; configure or restart that desktop process with its own `SOCAI_TELEMETRY=off` setting.+- The public `v0.6.1` telemetry contract does not specify a server-side deletion or retention period. Do not assume one. Local Jev Social and socai artifacts still follow the separate manual-retention rules below.++Jev Social does not pin the installed socai executable: onboarding resolves the current official release, and `SOCAI_BIN` can select another build. The statements above are the audited `v0.6.1` behavior, not a promise about another version. Check the version shown by Jev Social and review that release's telemetry contract when it differs.++See the immutable [`socai v0.6.1` telemetry schema](https://github.com/socai-io/socai/blob/v0.6.1/docs/telemetry-schema.md) for the field-level contract and source references.+### Keys and browser sessions- A key entered interactively during `onboard` is saved in `config.json` with file mode `0600`. If `OPENROUTER_API_KEY` is already present in the environment, onboarding can use it without writing a second copy to the config file.diff --git a/src/env.js b/src/env.jsindex b360c7c..c01be66 100644--- a/src/env.js+++ b/src/env.js@@ -12,6 +12,9 @@ const AUTO_ENV_KEYS = new Set(["JEV_SOCIAL_SYSTEM_ONE_URL","JEV_SOCIAL_SYSTEM_ONE_MODEL","JEV_SOCIAL_SYSTEM_ONE_TIMEOUT_MS",+ "SOCAI_TELEMETRY",+ "SOCAI_TELEMETRY_CHAT_TEXT",+ "SOCAI_TELEMETRY_QUERY_TEXT","openrouter",]);diff --git a/src/process.js b/src/process.jsindex 228fbab..cdd8b2e 100644--- a/src/process.js+++ b/src/process.js@@ -54,16 +54,23 @@ const CHILD_ENV_KEYS = new Set(["SOCAI_SESSIONS_DIR","SOCAI_SKIP_UPDATE_CHECK","SOCAI_TELEMETRY",+ "SOCAI_TELEMETRY_CHAT_TEXT",+ "SOCAI_TELEMETRY_QUERY_TEXT","SOCAI_TRACES_ENDPOINT","SOCAI_WHISPER_CLI",]);export function childEnvironment(source = process.env) {- return Object.fromEntries(+ const child = Object.fromEntries(Object.entries(source).filter(([key, value]) => value !== undefined && CHILD_ENV_KEYS.has(key),),);+ // socai treats every value outside its opt-out list as enabled. Require Jev+ // Social callers to use the one documented affirmative value so blanks,+ // typos, and inherited surprises remain privacy-off.+ child.SOCAI_TELEMETRY = String(child.SOCAI_TELEMETRY ?? "").trim() === "1" ? "1" : "0";+ return child;}export function runProcess(command, args, options = {}) {diff --git a/test/distribution-docs.test.js b/test/distribution-docs.test.jsindex b1f67d6..5f61424 100644--- a/test/distribution-docs.test.js+++ b/test/distribution-docs.test.js@@ -300,7 +300,10 @@ test("the local UI keeps project links scoped to Jev Social", async () => {});test("the README exposes the privacy and local-data boundaries", async () => {- const readme = await readFile(new URL("../README.md", import.meta.url), "utf8");+ const [readme, security] = await Promise.all([+ readFile(new URL("../README.md", import.meta.url), "utf8"),+ readFile(new URL("../SECURITY.md", import.meta.url), "utf8"),+ ]);const privacySection = readme.match(/## Privacy and local data\r?\n([\s\S]*?)(?=\r?\n## )/,);@@ -317,8 +320,18 @@ test("the README exposes the privacy and local-data boundaries", async () => {assert.match(privacySection[1], /does not read or copy the browser cookie store directly/i);assert.match(privacySection[1], /user input and visible social content are untrusted/i);assert.match(privacySection[1], /OPENROUTER_REPORT_MODEL=off/);+ assert.match(privacySection[1], /SOCAI_TELEMETRY=0/);assert.match(privacySection[1], /no automatic cleanup schedule/i);assert.match(privacySection[1], /only when the research goal explicitly requests/i);+ assert.match(security, /github\.com\/socai-io\/socai\/blob\/v0\.6\.1\/docs\/telemetry-schema\.md/);+ assert.match(security, /SOCAI_TELEMETRY_QUERY_TEXT=off/);+ assert.match(security, /SOCAI_TELEMETRY_CHAT_TEXT=off/);+ assert.match(security, /third-party observability provider Axiom/i);+ assert.match(security, /full phone number/i);+ assert.match(security, /does not remove those targets or other metadata/i);+ assert.match(security, /pattern-based secret scrubbing/i);+ assert.match(security, /does not pin the installed socai executable/i);+ assert.match(security, /does not specify a server-side deletion or retention period/i);});test("the social research guide is shipped with exact platform and safety boundaries", async () => {diff --git a/test/env.test.js b/test/env.test.jsindex 7c504e2..5861826 100644--- a/test/env.test.js+++ b/test/env.test.js@@ -9,13 +9,19 @@ test("parseEnv reads the lowercase OpenRouter key format without evaluating shel});});-test("project .env values honor the report privacy opt-out", () => {+test("project .env values honor report and socai telemetry privacy controls", () => {const env = {};mergeLocalEnv(env, {OPENROUTER_REPORT_MODEL: "off",+ SOCAI_TELEMETRY: "0",+ SOCAI_TELEMETRY_QUERY_TEXT: "off",+ SOCAI_TELEMETRY_CHAT_TEXT: "false",UNRELATED_SECRET: String(102),});assert.equal(env.OPENROUTER_REPORT_MODEL, "off");+ assert.equal(env.SOCAI_TELEMETRY, "0");+ assert.equal(env.SOCAI_TELEMETRY_QUERY_TEXT, "off");+ assert.equal(env.SOCAI_TELEMETRY_CHAT_TEXT, "false");assert.equal(env.UNRELATED_SECRET, undefined);});diff --git a/test/process.test.js b/test/process.test.jsindex 5df8a4d..3ebe118 100644--- a/test/process.test.js+++ b/test/process.test.js@@ -19,12 +19,30 @@ test("childEnvironment forwards socai/runtime settings but strips API credentialPATH: "/bin",HOME: "/tmp/home",SOCAI_HOME: "/tmp/socai",+ SOCAI_TELEMETRY: "0",+ SOCAI_TELEMETRY_QUERY_TEXT: "off",+ SOCAI_TELEMETRY_CHAT_TEXT: "false",SOCAI_API_KEY: String(1),SOCAI_SESSION_TOKEN: String(2),TYPESAFE_API_KEY: String(3),OPENROUTER_API_KEY: String(4),});- assert.deepEqual(value, { PATH: "/bin", HOME: "/tmp/home", SOCAI_HOME: "/tmp/socai" });+ assert.deepEqual(value, {+ PATH: "/bin",+ HOME: "/tmp/home",+ SOCAI_HOME: "/tmp/socai",+ SOCAI_TELEMETRY: "0",+ SOCAI_TELEMETRY_QUERY_TEXT: "off",+ SOCAI_TELEMETRY_CHAT_TEXT: "false",+ });+});++test("childEnvironment disables socai telemetry unless the caller explicitly opts in", () => {+ for (const value of [undefined, "", " ", "garbage", "0", "off", "true"]) {+ const source = value === undefined ? { PATH: "/bin" } : { PATH: "/bin", SOCAI_TELEMETRY: value };+ assert.deepEqual(childEnvironment(source), { PATH: "/bin", SOCAI_TELEMETRY: "0" });+ }+ assert.equal(childEnvironment({ SOCAI_TELEMETRY: "1" }).SOCAI_TELEMETRY, "1");});test("runProcess force-kills a child that ignores SIGTERM", async () => {diff --git a/test/socai.test.js b/test/socai.test.jsindex 7cf07b4..7ebb460 100644--- a/test/socai.test.js+++ b/test/socai.test.js@@ -114,6 +114,18 @@ test("runSocaiSearch capability-checks and parses the real child process", asyncmock,`#!/usr/bin/env nodeconst args = process.argv.slice(2);+const credentialsPresent = ["OPENROUTER_API_KEY", "TYPESAFE_API_KEY", "SOCAI_API_KEY", "SOCAI_SESSION_TOKEN"]+ .filter((name) => Object.hasOwn(process.env, name));+const privacyControls = {+ telemetry: process.env.SOCAI_TELEMETRY || null,+ queryText: process.env.SOCAI_TELEMETRY_QUERY_TEXT || null,+ chatText: process.env.SOCAI_TELEMETRY_CHAT_TEXT || null,+};+if (privacyControls.telemetry !== "0" || privacyControls.queryText !== "off" ||+ privacyControls.chatText !== "false" || credentialsPresent.length) {+ console.error("unsafe child environment");+ process.exit(9);+}if (args.length === 1 && args[0] === "--help") {console.log("socai mock");} else if (args[0] === "tiktok" && args[1] === "--help") {@@ -122,7 +134,7 @@ if (args.length === 1 && args[0] === "--help") {process.exitCode = 2;} else if (args[0] === "tiktok" && args[1] === "search") {console.error("reading TikTok");- console.log(JSON.stringify({ results: [{ title: args[2] }], received: args, leakedKey: process.env.OPENROUTER_API_KEY || null }));+ console.log(JSON.stringify({ results: [{ title: args[2] }], received: args, credentialsPresent, privacyControls }));} else {process.exitCode = 2;}@@ -132,7 +144,17 @@ if (args.length === 1 && args[0] === "--help") {await chmod(mock, 0o755);try {- const env = { ...process.env, SOCAI_BIN: mock, OPENROUTER_API_KEY: String(101) };+ const env = {+ ...process.env,+ SOCAI_BIN: mock,+ SOCAI_TELEMETRY: "0",+ SOCAI_TELEMETRY_QUERY_TEXT: "off",+ SOCAI_TELEMETRY_CHAT_TEXT: "false",+ OPENROUTER_API_KEY: String(101),+ TYPESAFE_API_KEY: String(102),+ SOCAI_API_KEY: String(103),+ SOCAI_SESSION_TOKEN: String(104),+ };const status = await probeSocai({}, env);assert.equal(status.installed, true);assert.deepEqual(status.capabilities, { instagram: false, tiktok: true, linkedin: false });@@ -147,7 +169,12 @@ if (args.length === 1 && args[0] === "--help") {});assert.equal(result.exitCode, 0);assert.equal(result.data.results[0].title, "wearable AI");- assert.equal(result.data.leakedKey, null);+ assert.deepEqual(result.data.credentialsPresent, []);+ assert.deepEqual(result.data.privacyControls, {+ telemetry: "0",+ queryText: "off",+ chatText: "false",+ });assert.match(result.command, /tiktok search/);assert.match(progress.join(""), /reading TikTok/);