From bc1492032d64ac1742d87fbdcaba3421eebf121d Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 29 Mar 2026 19:32:02 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20PPI=20=E2=86=92=20PII=20terminology=20acr?= =?UTF-8?q?oss=20entire=20codebase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All references to "PPI" (Personal Private Information) have been corrected to the industry-standard "PII" (Personally Identifiable Information). This includes UI labels, comments, CSS class comments, and variable/function names (PPI_PATTERNS → PII_PATTERNS, autoDetectPPI → autoDetectPII, scanInputForPPI → scanInputForPII, ppiWarnings → piiWarnings). Files changed: README.md, content.css, content.js, auto-detect.js, org-policy.js, storage.js, options.html, popup.html, popup.js https://claude.ai/code/session_01NNBEPuXMFGWezJb1f958nL --- README.md | 2 +- src/content/content.css | 4 ++-- src/content/content.js | 38 +++++++++++++++++++------------------- src/lib/auto-detect.js | 12 ++++++------ src/lib/org-policy.js | 4 ++-- src/lib/storage.js | 2 +- src/options/options.html | 10 +++++----- src/popup/popup.html | 2 +- src/popup/popup.js | 14 +++++++------- 9 files changed, 44 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index 2c87dda..3858550 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ A browser extension (Chrome, Firefox, and Safari) that intercepts personal infor > **Browsers:** Chrome, Edge, Brave, Firefox, and Safari. Edge and Brave use the Chrome extension directly. > -> **Desktop apps** (Claude, ChatGPT, Copilot) bypass the browser — use the web version with the extension for PPI protection. +> **Desktop apps** (Claude, ChatGPT, Copilot) bypass the browser — use the web version with the extension for PII protection. > > **Note:** Claude and ChatGPT are tested. Other services have interception patterns defined but may need adjustments. PRs welcome. diff --git a/src/content/content.css b/src/content/content.css index dd5a5f6..f50cc84 100644 --- a/src/content/content.css +++ b/src/content/content.css @@ -35,7 +35,7 @@ border-radius: 2px; } -/* Auto-detect PPI warning banner */ +/* Auto-detect PII warning banner */ .ss-autodetect-warning { position: fixed; top: 16px; @@ -136,7 +136,7 @@ font-style: italic; } -/* Pre-send PPI warning (spellcheck-style, appears while typing) */ +/* Pre-send PII warning (spellcheck-style, appears while typing) */ .ss-presend-warning { position: fixed; top: 16px; diff --git a/src/content/content.js b/src/content/content.js index 29e0796..e53436e 100644 --- a/src/content/content.js +++ b/src/content/content.js @@ -254,7 +254,7 @@ // ============================================================ // Combined substitution: smart patterns + explicit + secret scan - // + auto-detect warning for unconfigured PPI + // + auto-detect warning for unconfigured PII // ============================================================ function substituteAll(text) { const allReplacements = []; @@ -275,12 +275,12 @@ finalText = secrets.text; } - // 4. Auto-detect: scan the FINAL text for unconfigured PPI + // 4. Auto-detect: scan the FINAL text for unconfigured PII // Auto-redact if enabled, otherwise just warn if (settings.autoDetect !== false) { - const warnings = autoDetectPPI(finalText, identity); + const warnings = autoDetectPII(finalText, identity); if (warnings.length > 0) { - // Auto-redact detected PPI in the outbound text + // Auto-redact detected PII in the outbound text if (settings.autoRedactDetected !== false) { for (let i = warnings.length - 1; i >= 0; i--) { const w = warnings[i]; @@ -309,9 +309,9 @@ } // ============================================================ - // Auto-Detect PPI Scanner (inline for page world) + // Auto-Detect PII Scanner (inline for page world) // ============================================================ - const PPI_PATTERNS = [ + const PII_PATTERNS = [ // Network { name: 'Private IP', re: /\b(?:10\.\d{1,3}\.\d{1,3}\.\d{1,3}|172\.(?:1[6-9]|2\d|3[01])\.\d{1,3}\.\d{1,3}|192\.168\.\d{1,3}\.\d{1,3})\b/g, hint: 'Private IP address', cat: 'network' }, @@ -389,7 +389,7 @@ // Common sentence starters that aren't names 'please', 'thanks', 'hello', 'hi', 'hey', 'dear', 'sincerely', 'regards', 'best', 'cheers', 'sorry', 'yes', 'no', 'ok', 'okay', - // Days and months (not PPI) + // Days and months (not PII) 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday', 'january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december', @@ -454,7 +454,7 @@ }); } - function autoDetectPPI(text, ident) { + function autoDetectPII(text, ident) { if (!text || text.length < 5) return []; const hasContext = CONTEXT_WORDS_RE.test(text); @@ -470,7 +470,7 @@ } const findings = []; - for (const pat of PPI_PATTERNS) { + for (const pat of PII_PATTERNS) { if (pat.contextRequired && !hasContext) continue; pat.re.lastIndex = 0; let m; @@ -521,7 +521,7 @@ warningEl.innerHTML = `
- Silent Send detected potential PPI that may not be substituted: + Silent Send detected potential PII that may not be substituted:
${items} @@ -1180,7 +1180,7 @@ } // ============================================================ - // Pre-Send PPI Detection — scans as you type/paste (spellcheck style) + // Pre-Send PII Detection — scans as you type/paste (spellcheck style) // ============================================================ // Generate obviously-fake values using reserved/standard ranges @@ -1244,7 +1244,7 @@ preSendWarningEl.innerHTML = `
- Potential PPI detected — not yet configured: + Potential PII detected — not yet configured:
${items} @@ -1285,12 +1285,12 @@ // Update local mappings so the fetch interceptor uses them immediately mappings = currentMappings; - // Replace the PPI value in the current input right now + // Replace the PII value in the current input right now if (inputEl) { replaceInInput(inputEl, real, fake); - // Re-scan — will dismiss warning if no more PPI remains + // Re-scan — will dismiss warning if no more PII remains if (inputScanTimer) clearTimeout(inputScanTimer); - inputScanTimer = setTimeout(() => scanInputForPPI(inputEl), 150); + inputScanTimer = setTimeout(() => scanInputForPII(inputEl), 150); } // Visual feedback @@ -1346,14 +1346,14 @@ // Scan input on type and paste let inputScanTimer = null; - function scanInputForPPI(target) { + function scanInputForPII(target) { const text = target.textContent || target.value || ''; if (!text || text.length < 5) { if (preSendWarningEl) preSendWarningEl.classList.remove('visible'); return; } - const warnings = autoDetectPPI(text, identity); + const warnings = autoDetectPII(text, identity); if (warnings.length > 0) { showPreSendWarning(warnings, target); } else if (preSendWarningEl) { @@ -1367,7 +1367,7 @@ if (target.matches?.('[contenteditable], textarea, input[type="text"]')) { // Debounce — don't scan on every keystroke if (inputScanTimer) clearTimeout(inputScanTimer); - inputScanTimer = setTimeout(() => scanInputForPPI(target), 800); + inputScanTimer = setTimeout(() => scanInputForPII(target), 800); } }, true); @@ -1377,7 +1377,7 @@ if (target.matches?.('[contenteditable], textarea, input[type="text"]') || target.closest?.('[contenteditable]')) { // Scan shortly after paste completes - setTimeout(() => scanInputForPPI(target.closest?.('[contenteditable]') || target), 200); + setTimeout(() => scanInputForPII(target.closest?.('[contenteditable]') || target), 200); } }, true); diff --git a/src/lib/auto-detect.js b/src/lib/auto-detect.js index 9d3e18c..d87f5af 100644 --- a/src/lib/auto-detect.js +++ b/src/lib/auto-detect.js @@ -1,14 +1,14 @@ /** * Silent Send - Auto-Detect * - * Scans text for potential PPI that the user hasn't configured. + * Scans text for potential PII that the user hasn't configured. * This catches things the identity and secret scanner can't — * because the user forgot or didn't know to configure them. * * Returns warnings (not auto-redactions) so the user can decide. */ -const PPI_PATTERNS = [ +const PII_PATTERNS = [ // --- Network --- { name: 'Private IP Address', @@ -21,7 +21,7 @@ const PPI_PATTERNS = [ regex: /\b(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\b/g, category: 'network', hint: 'IP address — could identify your network', - // Exclude common non-PPI IPs + // Exclude common non-PII IPs exclude: /^(?:127\.0\.0\.1|0\.0\.0\.0|255\.255\.255\.\d+|8\.8\.[84]\.[84]|1\.1\.1\.1|1\.0\.0\.1)$/, }, { @@ -126,12 +126,12 @@ const PPI_PATTERNS = [ }, ]; -// Context words that make ambiguous patterns more likely to be PPI +// Context words that make ambiguous patterns more likely to be PII const CONTEXT_WORDS = /\b(?:born|birthday|dob|birth|passport|license|driver|ssn|social\s*security|address|home|live|lives|reside|zip|postal)\b/i; const AutoDetect = { /** - * Scan text for potential unconfigured PPI. + * Scan text for potential unconfigured PII. * Pass in identity so we can skip values the user already configured. * * Returns array of { name, value, hint, category, index } @@ -167,7 +167,7 @@ const AutoDetect = { } } - for (const pattern of PPI_PATTERNS) { + for (const pattern of PII_PATTERNS) { // Skip context-dependent patterns if no context words present if (pattern.contextRequired && !hasContext) continue; diff --git a/src/lib/org-policy.js b/src/lib/org-policy.js index a4efa70..7f00a6a 100644 --- a/src/lib/org-policy.js +++ b/src/lib/org-policy.js @@ -12,7 +12,7 @@ * - Policy updates are applied automatically * * Privacy: the org admin can check compliance (are required fields - * configured?) but CANNOT see individual PPI values. + * configured?) but CANNOT see individual PII values. */ import api from './browser-polyfill.js'; @@ -220,7 +220,7 @@ const OrgPolicy = { /** * Check if the user's configuration meets org policy requirements. - * Returns compliance status WITHOUT revealing actual PPI values. + * Returns compliance status WITHOUT revealing actual PII values. * * @returns {{ compliant: boolean, missing: string[], configured: string[] }} */ diff --git a/src/lib/storage.js b/src/lib/storage.js index 9a60b2d..75083b2 100644 --- a/src/lib/storage.js +++ b/src/lib/storage.js @@ -23,7 +23,7 @@ const KEYS = { SETTINGS: 'ss_settings', }; -// Keys that contain sensitive PPI and should be encrypted at rest +// Keys that contain sensitive PII and should be encrypted at rest // All user data keys are encrypted at rest — settings included since // custom domains and configuration can reveal what services the user // accesses. Only ss_sync_encryption (salt, verification blob) and diff --git a/src/options/options.html b/src/options/options.html index abac81e..df3cb49 100644 --- a/src/options/options.html +++ b/src/options/options.html @@ -59,7 +59,7 @@
- +

Warn when potential personal data (IPs, addresses, paths) is detected that you haven't configured

- -

Automatically replace detected PPI with generic placeholders (192.0.2.1, 123 Example Street, etc.) when sending

+ +

Automatically replace detected PII with generic placeholders (192.0.2.1, 123 Example Street, etc.) when sending

- -

Show a + button on detected PPI to instantly create a mapping with a suggested fake value

+ +

Show a + button on detected PII to instantly create a mapping with a suggested fake value

Silent Send is a convenience tool, not a security guarantee. It can miss - PPI in images, file uploads, unusual name forms, or data you forgot to + PII in images, file uploads, unusual name forms, or data you forgot to configure. Always verify sensitive messages before sending.
Options diff --git a/src/popup/popup.js b/src/popup/popup.js index 4fdcf25..444909c 100644 --- a/src/popup/popup.js +++ b/src/popup/popup.js @@ -715,17 +715,17 @@ function renderTestDiff() { if (secretCount > 0) parts.push(`${secretCount} secrets redacted`); if (warnCount > 0) parts.push(`${warnCount} warnings`); - // Auto-detect unconfigured PPI in the final text - const ppiWarnings = AutoDetect.scan(finalText, identity); - if (ppiWarnings.length > 0) parts.push(`${ppiWarnings.length} PPI detected`); + // Auto-detect unconfigured PII in the final text + const piiWarnings = AutoDetect.scan(finalText, identity); + if (piiWarnings.length > 0) parts.push(`${piiWarnings.length} PII detected`); stats.textContent = `${allReplacements.length} substitution${allReplacements.length !== 1 ? 's' : ''} (${parts.join(', ')})`; - // Show PPI warnings below stats - if (ppiWarnings.length > 0) { + // Show PII warnings below stats + if (piiWarnings.length > 0) { stats.innerHTML += `
- Unconfigured PPI detected: - ${ppiWarnings.map(w => `
${escapeHtml(w.value)} — ${w.hint}
`).join('')} + Unconfigured PII detected: + ${piiWarnings.map(w => `
${escapeHtml(w.value)} — ${w.hint}
`).join('')}
`; } }