Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

fix(branding): disable LLM telemetry for zero data retention scrapes (#4822)

Abimael Martellc7440c65c0b0
diff --git a/apps/api/src/__tests__/lib/branding/llm-telemetry.test.ts b/apps/api/src/__tests__/lib/branding/llm-telemetry.test.ts
index 71a4e51f9..8eb024f91 100644
--- a/apps/api/src/__tests__/lib/branding/llm-telemetry.test.ts
+++ b/apps/api/src/__tests__/lib/branding/llm-telemetry.test.ts
@@ -25,7 +25,11 @@ import { enhanceBrandingWithLLM } from "../../../lib/branding/llm";
import { logger } from "../../../lib/logger";
import { CostTracking } from "../../../lib/cost-tracking";
-function run(ids: { teamId?: string; scrapeId?: string }) {
+function run(ids: {
+ teamId?: string;
+ scrapeId?: string;
+ zeroDataRetention?: boolean;
+}) {
return enhanceBrandingWithLLM({
jsAnalysis: {},
buttons: [],
@@ -67,4 +71,14 @@ describe("branding LLM telemetry", () => {
feature: "branding",
});
});
+
+ it("disables telemetry for zero data retention scrapes", async () => {
+ await run({
+ teamId: "test-team",
+ scrapeId: "test-scrape",
+ zeroDataRetention: true,
+ });
+
+ expect(telemetry().isEnabled).toBe(false);
+ });
});
diff --git a/apps/api/src/lib/branding/llm.ts b/apps/api/src/lib/branding/llm.ts
index 217109481..2d13f7cb6 100644
--- a/apps/api/src/lib/branding/llm.ts
+++ b/apps/api/src/lib/branding/llm.ts
@@ -214,7 +214,7 @@ export async function enhanceBrandingWithLLM(
experimental_repairText: async ({ text }) =>
unwrapSchemaShapedAnswer(text),
experimental_telemetry: {
- isEnabled: true,
+ isEnabled: !input.zeroDataRetention,
// The input carries the page screenshot / raw page content; too large
// for span attributes. Outputs stay recorded.
recordInputs: false,