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
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
Make AI privacy completion opt-in, default off (#7780)
Louis Beaumonte9a3a3a31cbb
diff --git a/apps/screenpipe-app-tauri/components/settings/privacy-section.tsx b/apps/screenpipe-app-tauri/components/settings/privacy-section.tsxindex 9872a0a88..ed4a50f5e 100644--- a/apps/screenpipe-app-tauri/components/settings/privacy-section.tsx+++ b/apps/screenpipe-app-tauri/components/settings/privacy-section.tsx@@ -24,6 +24,7 @@ export const searchIndex: SettingsField[] = [keywords: ["private", "browser", "enhanced", "automation"],},{ label: msg("Help improve Workflows", {}), keywords: ["sharing", "training", "consent", "delete shared chats"] },+ { label: msg("Wait for AI privacy checks", {}), keywords: ["backlog", "queue", "completion", "background", "redaction"] },{ label: msg("PII masking", {}), keywords: ["mask", "redact", "columns", "url", "fields", "dollar", "amount", "currency", "USD"] },{label: msg("Remote support logs", {}),@@ -1397,7 +1398,6 @@ export function PrivacySection() {}/></div>- {piiMode === "smart" && <PrivacyProcessingStatus />}{piiMode !== "off" && (<div className="mt-3 ml-6 space-y-3 border-l-2 border-border pl-3"><div className="space-y-2">@@ -1635,6 +1635,36 @@ export function PrivacySection() {</span></span></label>+ {piiMode === "smart" && (+ <details className="group border-t border-border pt-3">+ <summary className="flex cursor-pointer select-none items-center gap-1.5 text-xs text-muted-foreground list-none [&::-webkit-details-marker]:hidden">+ <ChevronRight className="h-3 w-3 shrink-0 transition-transform group-open:rotate-90" />+ {ui("Optional privacy settings")}+ <span className="rounded-sm border border-border px-1.5 py-0.5 text-[10px]">{ui("Experimental")}</span>+ </summary>+ <div className="mt-3">+ <div className="flex items-start justify-between gap-4">+ <div className="space-y-1">+ <label htmlFor="requirePiiCompletion" className="text-xs font-medium text-foreground">+ {ui("Wait for AI privacy checks")}+ </label>+ <p className="max-w-xl text-xs text-muted-foreground">+ {settings.requirePiiCompletion+ ? ui("Recordings stay unavailable to search, workflows and sync until AI checks finish. Existing history is checked too, which can create a backlog.")+ : ui("AI redaction runs in the background. Recordings can be read and synced before AI checks finish.")}+ </p>+ </div>+ <ManagedSwitch+ settingKey="requirePiiCompletion"+ id="requirePiiCompletion"+ checked={settings.requirePiiCompletion ?? false}+ onCheckedChange={(checked) => handleSettingsChange({ requirePiiCompletion: checked }, true)}+ />+ </div>+ {settings.requirePiiCompletion && <PrivacyProcessingStatus />}+ </div>+ </details>+ )}</div>)}</CardContent>diff --git a/apps/screenpipe-app-tauri/components/settings/recording-settings.tsx b/apps/screenpipe-app-tauri/components/settings/recording-settings.tsxindex 71c178e27..e0816c7f3 100644--- a/apps/screenpipe-app-tauri/components/settings/recording-settings.tsx+++ b/apps/screenpipe-app-tauri/components/settings/recording-settings.tsx@@ -312,6 +312,7 @@ const SERVER_RESTART_SETTINGS = new Set<keyof SettingsStore>(["audioCaptureMode","encryptStore","asyncPiiRedaction",+ "requirePiiCompletion","asyncImagePiiRedaction","piiBackend","useChineseMirror",diff --git a/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx b/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsxindex c721652bc..9dea9624c 100644--- a/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx+++ b/apps/screenpipe-app-tauri/lib/hooks/use-settings.tsx@@ -914,6 +914,7 @@ export function createDefaultSettingsObject(isEnterprise = false): Settings {disableClipboardCapture: !isEnterprise,disableKeyboardCapture: !isEnterprise,asyncPiiRedaction: isEnterprise,+ requirePiiCompletion: false,asyncImagePiiRedaction: isEnterprise,piiBackend: isEnterprise ? "tinfoil" : "local",});@@ -1139,7 +1140,7 @@ function createSettingsStore() {await hydrateCloudToken(settings);let needsUpdate = normalizeSettingsArrays(settings);- for (const key of ["disableClipboardCapture", "disableKeyboardCapture", "asyncPiiRedaction", "asyncImagePiiRedaction"] as const) {+ for (const key of ["disableClipboardCapture", "disableKeyboardCapture", "asyncPiiRedaction", "asyncImagePiiRedaction", "requirePiiCompletion"] as const) {if (settings[key] === undefined) {settings[key] = defaults[key];needsUpdate = true;diff --git a/apps/screenpipe-app-tauri/lib/utils/tauri.ts b/apps/screenpipe-app-tauri/lib/utils/tauri.tsindex d1eebd21f..183d5a26b 100644--- a/apps/screenpipe-app-tauri/lib/utils/tauri.ts+++ b/apps/screenpipe-app-tauri/lib/utils/tauri.ts@@ -4162,6 +4162,12 @@ usePiiRemoval: boolean;* `screenpipe-redact` for the full design.*/asyncPiiRedaction?: boolean;+/**+ * Wait for AI privacy completion before making recordings available.+ * Off by default: redaction runs in the background and records may be+ * read or synced before AI processing finishes.+ */+requirePiiCompletion?: boolean;/*** Strip secrets from coding-agent (pi) session logs at rest. The* agent persists full sessions — bash output, file reads, tooldiff --git a/apps/screenpipe-app-tauri/src-tauri/src/enterprise/managed-settings.json b/apps/screenpipe-app-tauri/src-tauri/src/enterprise/managed-settings.jsonindex a65460908..a9be2cacc 100644--- a/apps/screenpipe-app-tauri/src-tauri/src/enterprise/managed-settings.json+++ b/apps/screenpipe-app-tauri/src-tauri/src/enterprise/managed-settings.json@@ -43,6 +43,7 @@{"policyKey": "enhancedIncognitoDetection", "deviceKey": "enhancedIncognitoDetection", "apply": "engine", "kind": "boolean", "defaultValue": false},{"policyKey": "pauseOnDrmContent", "deviceKey": "pauseOnDrmContent", "apply": "engine", "kind": "boolean", "defaultValue": false},{"policyKey": "usePiiRemoval", "deviceKey": "usePiiRemoval", "apply": "engine", "kind": "boolean", "defaultValue": true},+ {"policyKey": "requirePiiCompletion", "deviceKey": "requirePiiCompletion", "apply": "engine", "kind": "boolean", "defaultValue": false},{"policyKey": "asyncPiiRedaction", "deviceKey": "asyncPiiRedaction", "apply": "engine", "kind": "boolean", "defaultValue": true},{"policyKey": "asyncImagePiiRedaction", "deviceKey": "asyncImagePiiRedaction", "apply": "engine", "kind": "boolean", "defaultValue": true},{"policyKey": "redactAgentSessionSecrets", "deviceKey": "redactAgentSessionSecrets", "apply": "engine", "kind": "boolean", "defaultValue": false},diff --git a/apps/screenpipe-app-tauri/src-tauri/src/server_core.rs b/apps/screenpipe-app-tauri/src-tauri/src/server_core.rsindex a8abee09c..471beb239 100644--- a/apps/screenpipe-app-tauri/src-tauri/src/server_core.rs+++ b/apps/screenpipe-app-tauri/src-tauri/src/server_core.rs@@ -522,8 +522,8 @@ impl ServerCore {config.pii_redaction_columns,config.pii_redaction_pseudonyms),- text: config.async_pii_redaction,- images: config.async_image_pii_redaction,+ text: config.require_pii_completion && config.async_pii_redaction,+ images: config.require_pii_completion && config.async_image_pii_redaction,}).await.map_err(|e| format!("Cannot configure privacy release policy: {e}"))?;diff --git a/crates/screenpipe-config/src/recording.rs b/crates/screenpipe-config/src/recording.rsindex a5afc4970..9b178441b 100644--- a/crates/screenpipe-config/src/recording.rs+++ b/crates/screenpipe-config/src/recording.rs@@ -686,6 +686,12 @@ pub struct RecordingSettings {#[serde(rename = "asyncPiiRedaction", default = "default_ai_pii_redaction")]pub async_pii_redaction: bool,+ /// Wait for AI privacy completion before making recordings available.+ /// Off by default: redaction runs in the background and records may be+ /// read or synced before AI processing finishes.+ #[serde(rename = "requirePiiCompletion", default)]+ pub require_pii_completion: bool,+/// Strip secrets from coding-agent (pi) session logs at rest. The/// agent persists full sessions — bash output, file reads, tool/// results — unredacted, so any credential it touches lands in@@ -1000,6 +1006,7 @@ impl Default for RecordingSettings {languages: vec![],use_pii_removal: default_ai_pii_redaction(),async_pii_redaction: default_ai_pii_redaction(),+ require_pii_completion: false,redact_agent_session_secrets: false,async_image_pii_redaction: default_ai_pii_redaction(),pii_backend: default_pii_backend(),diff --git a/crates/screenpipe-engine/src/bin/screenpipe-engine.rs b/crates/screenpipe-engine/src/bin/screenpipe-engine.rsindex 6583ae3f3..6843f9323 100644--- a/crates/screenpipe-engine/src/bin/screenpipe-engine.rs+++ b/crates/screenpipe-engine/src/bin/screenpipe-engine.rs@@ -1121,8 +1121,8 @@ async fn run(cli: Cli, record_arg_sources: RecordArgSources) -> anyhow::Result<(config.pii_redaction_columns,config.pii_redaction_pseudonyms),- text: config.async_pii_redaction,- images: config.async_image_pii_redaction,+ text: config.require_pii_completion && config.async_pii_redaction,+ images: config.require_pii_completion && config.async_image_pii_redaction,}).await?;let database_failure = Arc::new(tokio::sync::Notify::new());diff --git a/crates/screenpipe-engine/src/cli/mod.rs b/crates/screenpipe-engine/src/cli/mod.rsindex 0508276fd..86dc8698d 100644--- a/crates/screenpipe-engine/src/cli/mod.rs+++ b/crates/screenpipe-engine/src/cli/mod.rs@@ -541,6 +541,10 @@ pub struct RecordArgs {#[arg(long, default_value_t = false)]pub async_pii_redaction: bool,+ /// Wait for AI privacy processing before reads and sync. Off by default.+ #[arg(long, default_value_t = false, action = clap::ArgAction::Set)]+ pub require_pii_completion: bool,+/// Strip secrets from coding-agent (pi) session logs at rest. A/// background worker runs a secrets-only regex scrub over idle/// `pi/sessions/*.jsonl` files (never one a live run is still@@ -928,6 +932,7 @@ pub struct RecordArgSources {pub language: bool,pub use_pii_removal: bool,pub async_pii_redaction: bool,+ pub require_pii_completion: bool,pub redact_agent_session_secrets: bool,pub async_image_pii_redaction: bool,pub pii_backend: bool,@@ -996,6 +1001,7 @@ impl RecordArgSources {language: from_command_line(record, "language"),use_pii_removal: from_command_line(record, "use_pii_removal"),async_pii_redaction: from_command_line(record, "async_pii_redaction"),+ require_pii_completion: from_command_line(record, "require_pii_completion"),redact_agent_session_secrets: from_command_line(record, "redact_agent_session_secrets"),async_image_pii_redaction: from_command_line(record, "async_image_pii_redaction"),pii_backend: from_command_line(record, "pii_backend"),@@ -1056,6 +1062,7 @@ impl RecordArgSources {|| self.language|| self.use_pii_removal|| self.async_pii_redaction+ || self.require_pii_completion|| self.redact_agent_session_secrets|| self.async_image_pii_redaction|| self.pii_backend@@ -1238,6 +1245,7 @@ impl RecordArgs {disable_timeline: false,use_pii_removal: self.use_pii_removal,async_pii_redaction: self.async_pii_redaction,+ require_pii_completion: self.require_pii_completion,redact_agent_session_secrets: self.redact_agent_session_secrets,async_image_pii_redaction: self.async_image_pii_redaction,pii_backend: self.pii_backend.clone(),@@ -1523,6 +1531,9 @@ impl RecordArgs {if sources.use_pii_removal {settings.use_pii_removal = self.use_pii_removal;}+ if sources.require_pii_completion {+ settings.require_pii_completion = self.require_pii_completion;+ }if sources.async_pii_redaction {settings.async_pii_redaction = self.async_pii_redaction;}diff --git a/crates/screenpipe-engine/src/recording_config.rs b/crates/screenpipe-engine/src/recording_config.rsindex a7d2fa807..4ea7e8077 100644--- a/crates/screenpipe-engine/src/recording_config.rs+++ b/crates/screenpipe-engine/src/recording_config.rs@@ -54,6 +54,8 @@ pub struct RecordingConfig {/// overwrites the source columns with the redacted text. Off by/// default.pub async_pii_redaction: bool,+ /// Gate reads and sync on AI completion. False keeps background redaction.+ pub require_pii_completion: bool,/// Secrets-only scrub of coding-agent (pi) session logs at rest: a/// background worker strips credentials from `pi/sessions/*.jsonl`/// (idle files only). On-device regex, no model. Off by default;@@ -309,6 +311,7 @@ impl RecordingConfig {disable_timeline: settings.timeline_cache_disabled(),use_pii_removal: settings.use_pii_removal,async_pii_redaction: settings.async_pii_redaction,+ require_pii_completion: settings.require_pii_completion,redact_agent_session_secrets: settings.redact_agent_session_secrets,async_image_pii_redaction: settings.async_image_pii_redaction,pii_backend: settings.pii_backend.clone(),diff --git a/docs/pr-assets/privacy-completion-opt-in/after-off.png b/docs/pr-assets/privacy-completion-opt-in/after-off.pngnew file mode 100644index 000000000..01ec6e2a5Binary files /dev/null and b/docs/pr-assets/privacy-completion-opt-in/after-off.png differdiff --git a/docs/pr-assets/privacy-completion-opt-in/after-on.png b/docs/pr-assets/privacy-completion-opt-in/after-on.pngnew file mode 100644index 000000000..e886d998aBinary files /dev/null and b/docs/pr-assets/privacy-completion-opt-in/after-on.png differdiff --git a/docs/pr-assets/privacy-completion-opt-in/before.png b/docs/pr-assets/privacy-completion-opt-in/before.pngnew file mode 100644index 000000000..0c1befd3dBinary files /dev/null and b/docs/pr-assets/privacy-completion-opt-in/before.png differ