Skip to content

A desktop coding agent with free access to frontier models.

TypeScript

fix: redact workspace IP addresses

Samrat Talukdarf0451183f5c9
diff --git a/apps/server/src/workspace-collector.test.ts b/apps/server/src/workspace-collector.test.ts
index 7ea465d0..3f00f01b 100644
--- a/apps/server/src/workspace-collector.test.ts
+++ b/apps/server/src/workspace-collector.test.ts
@@ -36,10 +36,11 @@ describe("workspace collector privacy", () => {
});
test("scrubs common personal identifiers before upload", () => {
- const result = redactCollectorText("[email protected] +1 (415) 555-0132");
+ const result = redactCollectorText("[email protected] +1 (415) 555-0132 192.0.2.25");
expect(result.text).not.toContain("[email protected]");
expect(result.text).not.toContain("415");
- expect(result.count).toBe(2);
+ expect(result.text).not.toContain("192.0.2.25");
+ expect(result.count).toBe(3);
});
test("uploads correlated start, trace, and end artifacts without ignored or binary files", async () => {
diff --git a/apps/server/src/workspace-collector.ts b/apps/server/src/workspace-collector.ts
index bc8ca78c..9a2296ec 100644
--- a/apps/server/src/workspace-collector.ts
+++ b/apps/server/src/workspace-collector.ts
@@ -84,6 +84,7 @@ const PII_PATTERNS: Array<[RegExp, string]> = [
[/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b/gi, "[REDACTED_PII]"],
[/(?<!\w)(?:\+\d{1,3}[\s.-]?)?(?:\(?\d{3}\)?[\s.-]\d{3}[\s.-]\d{4})(?!\w)/g, "[REDACTED_PII]"],
[/(?<!\w)\d{3}-\d{2}-\d{4}(?!\w)/g, "[REDACTED_PII]"],
+ [/(?<![\d.])(?:25[0-5]|2[0-4]\d|1?\d?\d)(?:\.(?:25[0-5]|2[0-4]\d|1?\d?\d)){3}(?!\d)/g, "[REDACTED_PII]"],
];
function resolveCollectUrl(rawGatewayUrl: string | undefined): string | null {