{"slug": "ai-chrome-extension-privacy-redaction-consent-and-code", "title": "AI Chrome Extension Privacy: Redaction, Consent and Code", "summary": "A developer published a guide for building privacy-preserving AI Chrome extensions under Manifest V3, citing Chrome team data from I/O 2026 that 17% of extensions created for the Chrome Web Store in the past year use AI. The guide recommends replacing all-sites host permissions with activeTab or context menus, redacting emails, tokens, card numbers and phone numbers before any request leaves the browser, keeping model API keys on a backend, and gating AI features behind in-product consent that discloses what is sent, where it goes, retention and who can read it. It also notes Google's July 2026 user data policy update, enforced from August 1, 2026, requires consent inside the extension UI and bans extensions built to circumvent AI services' safety guardrails.", "body_md": "*Originally published on [ExtensionBooster](https://extensionbooster.net/blog/ai-chrome-extension-privacy-user-trust-ratings-guide/?ref=devto).*\n\nAI Chrome extension privacy stopped being a footnote once Google's Chrome team reported at I/O 2026 that 17% of extensions created for the Chrome Web Store in the past year use AI. Each one ships part of a user's page to a model. Here is how to send less, ask properly, and prove what you sent, with code you can drop into a Manifest V3 extension.\n\nTwo investigations from late 2025 set the tone:\n\n`fetch()` and `XMLHttpRequest`, collected by default, and had no off switch.\nIn both cases at least one extension carried a **Featured badge**, so a badge is no longer proof of safety. What your extension visibly does is.\n\nThere is no separate AI policy. The general user data rules apply, and the July 2026 update (enforced from August 1, 2026) tightened them:\n\n| Rule | What it means for an AI feature | \n|---|---|\n| Strictly necessary data | Only send what the single purpose needs | \n| Limited third-party transfers | Passing data to a model API must be necessary for that purpose | \n| No human reading by default | Exceptions need explicit consent, anonymized aggregates, or security/legal reasons | \n| Browsing activity | Only as a prominently described, user-facing feature | \n| In-product disclosure | Consent must live inside the extension UI; a privacy policy or listing text alone does not count | \n| Secure transport | HTTPS for anything that leaves the browser | \n\nThe same update also bans extensions built to get around AI services' safety guardrails.\n\nRetention and training terms differ by provider and tier, and your users inherit them:\n\n| Provider and tier | Trains on your inputs? | Retention and review | \n|---|---|---|\n| OpenAI API (default) | No, unless you opt in | Abuse-monitoring logs up to 30 days; Zero Data Retention needs approval | \n| Gemini API, unpaid | May be used to improve Google products | Human reviewers may read inputs and outputs after they are disconnected from your account | \n| Gemini API, paid | No | Logs kept for a limited period to detect abuse | \n| Chrome built-in AI (on-device) | Text stays on the device | No server involved | \n\nRule of thumb: never route personal data through the free Gemini tier.\n\nSwap all-sites access for `activeTab` or a context menu, so the user chooses exactly what leaves the page. A minimal service worker:\n\n``` js\n// background.js (MV3)\nimport { redact } from './redact.js';\nimport { hasAiConsent } from './consent-store.js';\n\nchrome.runtime.onInstalled.addListener(() => {\n  chrome.contextMenus.create({\n    id: 'explain',\n    title: 'Explain selection with AI',\n    contexts: ['selection'],\n  });\n});\n\nchrome.contextMenus.onClicked.addListener(async (info) => {\n  if (!(await hasAiConsent())) {\n    chrome.tabs.create({ url: chrome.runtime.getURL('consent.html') });\n    return;\n  }\n  const text = redact(info.selectionText).slice(0, 4000);\n  // Only the text goes out: no URL, no page title, no user ID.\n  await fetch('https://api.your-backend.example/explain', {\n    method: 'POST',\n    headers: { 'Content-Type': 'application/json' },\n    body: JSON.stringify({ text }),\n  });\n});\n```\n\nScrub the obvious secrets before they leave:\n\n``` js\n// redact.js\nconst rules = [\n  [/[\\w.+-]+@[\\w-]+\\.[\\w.-]+/g, '[email]'],\n  [/\\b(?:sk|pk|ghp|xox[bp])[-_][A-Za-z0-9_-]{10,}/g, '[token]'],\n  [/\\b\\d(?:[ -]?\\d){12,18}\\b/g, '[card-number]'],\n  [/\\+?\\d[\\d ().-]{7,}\\d/g, '[phone]'],\n];\nexport const redact = (s) => rules.reduce((t, [re, sub]) => t.replace(re, sub), s);\n```\n\nTwo more habits: keep the model API key on your own backend, and ship a default block list (online banking, health portals, password managers) where AI stays off, which users can extend.\n\nBefore the first request, open a consent page that answers four questions in plain words: **what is sent, where it goes, how long it is kept, and who can read it.** Give \"Turn on AI features\" and \"Not now\" equal visual weight, and keep the rest of the extension working if the user declines. Version the consent so a changed data flow asks again:\n\n``` js\n// consent-store.js\nconst CONSENT_VERSION = 2;\nexport async function grantAiConsent() {\n  await chrome.storage.local.set({ aiConsent: { v: CONSENT_VERSION, at: Date.now() } });\n}\nexport async function hasAiConsent() {\n  const { aiConsent } = await chrome.storage.local.get('aiConsent');\n  return aiConsent?.v === CONSENT_VERSION;\n}\n```\n\nAfter consent, keep it visible: a \"sent to AI\" indicator, a local history of the last 20 requests in `chrome.storage.local`, and a single AI on/off switch in the popup. Then say the same thing on your listing: name the model provider, what is sent and how long it is kept, and make sure your Privacy practices answers, policy and description all match. When a review raises privacy, reply within a day with specifics.\n\nThe original post has the full nine-point checklist and FAQ in its [guide to AI Chrome extension privacy and earning user trust](https://extensionbooster.net/blog/ai-chrome-extension-privacy-user-trust-ratings-guide/?ref=devto), and [ExtensionBooster has more resources on growing Chrome extension ratings and reviews](https://extensionbooster.net/?ref=devto).\n\nIf you ship an AI feature in an extension, what do you send to the model today: the full page, the selection, or something in between?", "url": "https://wpnews.pro/news/ai-chrome-extension-privacy-redaction-consent-and-code", "canonical_source": "https://dev.to/extensionbooster/ai-chrome-extension-privacy-redaction-consent-and-code-1m06", "published_at": "2026-11-10 05:37:42+00:00", "updated_at": "2026-11-10 05:50:47.331551+00:00", "lang": "en", "topics": ["ai-products", "ai-tools", "ai-policy", "developer-tools"], "entities": ["Google", "Chrome Web Store", "OpenAI", "Gemini API", "Chrome"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/ai-chrome-extension-privacy-redaction-consent-and-code", "markdown": "https://wpnews.pro/news/ai-chrome-extension-privacy-redaction-consent-and-code.md", "text": "https://wpnews.pro/news/ai-chrome-extension-privacy-redaction-consent-and-code.txt", "jsonld": "https://wpnews.pro/news/ai-chrome-extension-privacy-redaction-consent-and-code.jsonld"}}