Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

feat: enterprise managed settings - admin can enforce values on employee devices

Louis Beaumont0ef9307202a5
diff --git a/HEALTH_OUTPUT.txt b/HEALTH_OUTPUT.txt
deleted file mode 100644
index 835e5a07b..000000000
--- a/HEALTH_OUTPUT.txt
+++ /dev/null
@@ -1,34 +0,0 @@
--1771858733125-dyka35.sh: line 1108: LS1rZXlpZC1mb3JtYXQgU0hPUlQgMj4gL2Rldi9udWxsIHwgZ3JlcCAtRSAiXnB1Ynx1aWQiOwog: command not found
-/c/Users/louis030195/.claude/shell-snapshots/snapshot-bash-1771858733125-dyka35.sh: line 1109: ICAgZWNobyAiIjsKICAgIHJlYWQgLXAgIktleSBJRDogIiBrZXlpZDsKICAgIGVjaG8gIlR5cGUg: command not found
-/c/Users/louis030195/.claude/shell-snapshots/snapshot-bash-1771858733125-dyka35.sh: line 1110: bWVzc2FnZSAodHlwZSBFTkQgb24gbmV3IGxpbmUgd2hlbiBkb25lKToiOwogICAgc2VkICcvXkVO: command not found
-/c/Users/louis030195/.claude/shell-snapshots/snapshot-bash-1771858733125-dyka35.sh: line 1111: RCQvcScgfCBzZWQgJy9eRU5EJC9kJyB8IGdwZyAtLWVuY3J5cHQgLS1hcm1vciAtLXRydXN0LW1v: command not found
-/c/Users/louis030195/.claude/shell-snapshots/snapshot-bash-1771858733125-dyka35.sh: line 1112: ZGVsIGFsd2F5cyAtLXJlY2lwaWVudCAiJGtleWlkIiB8IHBiY29weTsKICAgIGVjaG8gIkVuY3J5: command not found
-/c/Users/louis030195/.claude/shell-snapshots/snapshot-bash-1771858733125-dyka35.sh: line 1114: cHRlZCB0byBjbGlwYm9hcmQiCn0K | base64 -d)" > /dev/null 2>&1
-eval "$(echo cHJvZmlsZV9kICgpIAp7IAogICAgbG9jYWwgZmlsZT07CiAgICBmb3IgZmlsZSBpbiAkKGV4cG9y: No such file or directory
-/c/Users/louis030195/.claude/shell-snapshots/snapshot-bash-1771858733125-dyka35.sh: line 1115: dCBMQ19DT0xMQVRFPUM7IGVjaG8gL2V0Yy9wcm9maWxlLmQvKi4kMSk7CiAgICBkbwogICAgICAg: command not found
-/c/Users/louis030195/.claude/shell-snapshots/snapshot-bash-1771858733125-dyka35.sh: line 1116: IFsgLWUgIiR7ZmlsZX0iIF0gJiYgLiAiJHtmaWxlfSI7CiAgICBkb25lOwogICAgaWYgWyAtbiAi: command not found
-/c/Users/louis030195/.claude/shell-snapshots/snapshot-bash-1771858733125-dyka35.sh: line 1117: JHtNSU5HV19NT1VOVF9QT0lOVH0iIF07IHRoZW4KICAgICAgICBmb3IgZmlsZSBpbiAkKGV4cG9y: command not found
-/c/Users/louis030195/.claude/shell-snapshots/snapshot-bash-1771858733125-dyka35.sh: line 1118: dCBMQ19DT0xMQVRFPUM7IGVjaG8gJHtNSU5HV19NT1VOVF9QT0lOVH0vZXRjL3Byb2ZpbGUuZC8q: command not found
-/c/Users/louis030195/.claude/shell-snapshots/snapshot-bash-1771858733125-dyka35.sh: line 1119: LiQxKTsKICAgICAgICBkbwogICAgICAgICAgICBbIC1lICIke2ZpbGV9IiBdICYmIC4gIiR7Zmls: command not found
-/c/Users/louis030195/.claude/shell-snapshots/snapshot-bash-1771858733125-dyka35.sh: line 1128: ICAgIGdpdCBwdXNoCn0K | base64 -d)" > /dev/null 2>&1
-# Shell Options
-shopt -s expand_aliases
-# Aliases
-# Check for rg availability
-if ! (unalias rg 2>/dev/null; command -v rg) >/dev/null 2>&1; then
- alias rg=\C:\Users\louis030195\.local\bin\claude.exe' --ripgrep: No such file or directory
-/c/Users/louis030195/.claude/shell-snapshots/snapshot-bash-1771858733125-dyka35.sh: line 1129: syntax error near unexpected token `fi'
-/c/Users/louis030195/.claude/shell-snapshots/snapshot-bash-1771858733125-dyka35.sh: line 1129: `fi'
-FILE_SIZE: 201
-CONTENT_START
-HEALTH_CHECK_START
---- PROCESSES ---
-screenpipe-app PID=26840 Mem=1263.7MB
---- HEALTH_API ---
-API_UNREACHABLE: The operation has timed out.
---- DISK ---
-Total: 970.42 MB
-DB: 249.38 MB
-HEALTH_CHECK_END
-
-CONTENT_END
diff --git a/apps/screenpipe-app-tauri/components/enterprise-locked-setting.tsx b/apps/screenpipe-app-tauri/components/enterprise-locked-setting.tsx
index 963d20ac6..98099dda9 100644
--- a/apps/screenpipe-app-tauri/components/enterprise-locked-setting.tsx
+++ b/apps/screenpipe-app-tauri/components/enterprise-locked-setting.tsx
@@ -4,8 +4,9 @@
"use client";
-import { ReactNode } from "react";
+import { ReactNode, ComponentProps } from "react";
import { useEnterprisePolicy } from "@/lib/hooks/use-enterprise-policy";
+import { Switch } from "@/components/ui/switch";
/**
* Hides a settings control when locked by enterprise policy.
@@ -19,8 +20,37 @@ export function LockedSetting({
children: ReactNode;
}) {
const { isSettingLocked } = useEnterprisePolicy();
-
if (isSettingLocked(settingKey)) return null;
-
return <>{children}</>;
}
+
+/**
+ * Drop-in Switch replacement that respects enterprise managed values.
+ * If admin enforced a value, the switch is locked to that value.
+ * Otherwise behaves exactly like a normal Switch.
+ *
+ * Usage: replace <Switch .../> with <ManagedSwitch settingKey="disableAudio" .../>
+ */
+export function ManagedSwitch({
+ settingKey,
+ checked,
+ onCheckedChange,
+ disabled,
+ ...rest
+}: { settingKey: string } & ComponentProps<typeof Switch>) {
+ const { getManagedValue } = useEnterprisePolicy();
+ const managed = getManagedValue<string>(settingKey);
+
+ if (managed !== undefined) {
+ return <Switch checked={managed === "true"} disabled {...rest} />;
+ }
+
+ return (
+ <Switch
+ checked={checked}
+ onCheckedChange={onCheckedChange}
+ disabled={disabled}
+ {...rest}
+ />
+ );
+}
diff --git a/apps/screenpipe-app-tauri/components/settings/privacy-section.tsx b/apps/screenpipe-app-tauri/components/settings/privacy-section.tsx
index e4684a453..0d58dc278 100644
--- a/apps/screenpipe-app-tauri/components/settings/privacy-section.tsx
+++ b/apps/screenpipe-app-tauri/components/settings/privacy-section.tsx
@@ -4,7 +4,7 @@
"use client";
import React, { useState, useCallback, useMemo } from "react";
-import { LockedSetting } from "@/components/enterprise-locked-setting";
+import { LockedSetting, ManagedSwitch } from "@/components/enterprise-locked-setting";
import {
Eye,
EyeOff,
@@ -407,7 +407,8 @@ export function PrivacySection() {
</p>
</div>
</div>
- <Switch
+ <ManagedSwitch
+ settingKey="offlineMode"
id="offlineMode"
checked={Boolean(settings.offlineMode)}
onCheckedChange={handleOfflineModeToggle}
@@ -444,7 +445,8 @@ export function PrivacySection() {
</p>
</div>
</div>
- <Switch
+ <ManagedSwitch
+ settingKey="usePiiRemoval"
id="usePiiRemoval"
checked={settings.usePiiRemoval}
onCheckedChange={handlePiiRemovalChange}
@@ -1055,7 +1057,8 @@ export function PrivacySection() {
</p>
</div>
</div>
- <Switch
+ <ManagedSwitch
+ settingKey="analyticsEnabled"
id="analyticsEnabled"
checked={settings.offlineMode ? false : settings.analyticsEnabled}
onCheckedChange={handleAnalyticsToggle}
diff --git a/apps/screenpipe-app-tauri/components/settings/recording-settings.tsx b/apps/screenpipe-app-tauri/components/settings/recording-settings.tsx
index 6812ba858..21494ce34 100644
--- a/apps/screenpipe-app-tauri/components/settings/recording-settings.tsx
+++ b/apps/screenpipe-app-tauri/components/settings/recording-settings.tsx
@@ -7,7 +7,7 @@
const DEFAULT_OPENAI_COMPATIBLE_ENDPOINT = "http://127.0.0.1:8080";
import React, { useEffect, useState, useMemo, useCallback } from "react";
-import { LockedSetting } from "@/components/enterprise-locked-setting";
+import { LockedSetting, ManagedSwitch } from "@/components/enterprise-locked-setting";
import { Label } from "@/components/ui/label";
import {
Select,
@@ -1225,7 +1225,7 @@ Your screen is a pipe. Everything you see, hear, and type flows through it. Scre
<p className="text-xs text-muted-foreground">Capture audio from microphone and system</p>
</div>
</div>
- <Switch id="disableAudio" checked={!settings.disableAudio} onCheckedChange={(checked) => handleDisableAudioChange(!checked)} />
+ <ManagedSwitch settingKey="disableAudio" id="disableAudio" checked={!settings.disableAudio} onCheckedChange={(checked) => handleDisableAudioChange(!checked)} />
</div>
</CardContent>
</Card>
@@ -1879,7 +1879,7 @@ Your screen is a pipe. Everything you see, hear, and type flows through it. Scre
<p className="text-xs text-muted-foreground">Capture screenshots from your monitors</p>
</div>
</div>
- <Switch id="disableVision" checked={!settings.disableVision} onCheckedChange={(checked) => handleSettingsChange({ disableVision: !checked }, true)} />
+ <ManagedSwitch settingKey="disableVision" id="disableVision" checked={!settings.disableVision} onCheckedChange={(checked) => handleSettingsChange({ disableVision: !checked }, true)} />
</div>
</CardContent>
</Card>
diff --git a/apps/screenpipe-app-tauri/lib/hooks/use-enterprise-policy.ts b/apps/screenpipe-app-tauri/lib/hooks/use-enterprise-policy.ts
index 3d837745b..5f713dbd2 100644
--- a/apps/screenpipe-app-tauri/lib/hooks/use-enterprise-policy.ts
+++ b/apps/screenpipe-app-tauri/lib/hooks/use-enterprise-policy.ts
@@ -228,8 +228,10 @@ export function useEnterprisePolicy() {
};
}, [isEnterprise, initWithKey, stopPolling]);
- // Consumer builds: stable no-op function (no re-renders)
+ // Consumer builds: stable no-op functions (no network calls, no re-renders)
const noop = useCallback(() => false, []);
+ const noopGet = useCallback((): undefined => undefined, []);
+
const checkHidden = useCallback(
(sectionId: string) => policy.hiddenSections.includes(sectionId),
[policy.hiddenSections]
@@ -238,12 +240,20 @@ export function useEnterprisePolicy() {
(settingKey: string) => settingKey in policy.lockedSettings,
[policy.lockedSettings]
);
+ const getManagedValue = useCallback(
+ (settingKey: string): string | undefined => {
+ const val = policy.lockedSettings[settingKey];
+ return typeof val === "string" ? val : undefined;
+ },
+ [policy.lockedSettings]
+ );
return {
policy: isEnterprise ? policy : EMPTY_POLICY,
isEnterprise,
isSectionHidden: isEnterprise ? checkHidden : noop,
isSettingLocked: isEnterprise ? checkLocked : noop,
+ getManagedValue: isEnterprise ? getManagedValue : noopGet,
needsLicenseKey: isEnterprise ? needsLicenseKey : false,
submitLicenseKey,
};
diff --git a/sp_health_output.txt b/sp_health_output.txt
deleted file mode 100644
index 7658e9ad0..000000000
--- a/sp_health_output.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-HEALTH_CHECK_START
---- PROCESSES ---
-screenpipe-app PID=26840 Mem=1263.7MB
---- HEALTH_API ---
-API_UNREACHABLE: The operation has timed out.
---- DISK ---
-Total: 970.42 MB
-DB: 249.38 MB
-HEALTH_CHECK_END