AI Code Exposure Monitor



Know exactly how much of your source code has been seen by an AI assistant.
Every time you open a file in your editor, it can be picked up by AI assistants (Copilot, Claude, Gemini, Cursor, Continue, Pando, etc.) as context. Most developers have no idea what percentage of their codebase has already been streamed to a model. This extension shows that number — live — in your status bar.
Works in: VS Code · Cursor · Windsurf · VSCodium · Trae (any VS Code–compatible host).
🛰 MCP + team-work exposure features are ready — just ask. Drop an issue if you want the MCP server (let AI agents read their own exposure cost) or team aggregation (opt-in cloud roll-up across developers) enabled for your org.
What it does
- 📊 Live percentage in the status bar:
👁 AI exposure: 37.4% (colored — orange >25%, red >50%)
- 🚨 Live sensitive-file alert — pops a warning when you open a file containing secrets (AWS/GCP keys, GitHub PATs, OpenAI/Anthropic keys, JWTs, private key blocks, DB URLs with credentials), hardcoded passwords/usernames, or PII (emails, SSN, credit cards, phone numbers, IBAN, date of birth)
- 🖍 Inline highlighting — the exact secret/credential/PII bytes are highlighted right in the editor (🔴 secret · 🟠 credential · 🟡 PII), with overview-ruler markers and hover details, so you see precisely what an AI tool could read
- 🛡 PSDE (Proactive Sensitive Data Exposure) — optional proactive mode: prescans the workspace, and blocks a sensitive file from being silently exposed to AI until you confirm (Expose anyway / Mark as test data / Close file)
- 🗃 Sensitive files by project — a dashboard section listing every detected sensitive file, grouped by project, with category badges and one-click Open (opens + highlights, without tripping the PSDE prompt)
- 🧪 Mark as test data — flag fixtures/sample files so they're excluded from sensitive counts (remembered across restarts)
- 🤖 AI assistants detected banner — automatically detects Copilot, Claude Code, Cursor (native), Windsurf (native), Gemini, Codeium, Continue, Cline, Cody, pandō, etc.
- 📈 Live sparkline of % over the last 60 seconds (1 sample/sec)
- 📰 Live activity feed — file opened, modified, created, deleted, reset, rescan; sensitive files visually flagged
- 💓 Heartbeat indicator + "Xs ago" so you can see the monitor is alive
- 🔢 Animated counters for exposed lines / files / sensitive files
- 🏔 Peaks per project, retained across editor restarts
- 🗂 Multi-project dashboard — every workspace you've ever opened, ranked by current exposure %
- 🔁 Reset, rescan, forget project controls — full local control of the data
Everything is computed and stored locally in your editor's globalState. Nothing is sent anywhere.
Why it matters
Exposure ≠ leak. But exposure is the precondition for a leak.
If 80% of your source has already been shown to an AI agent this week, you have effectively no air gap left. This extension lets you measure that surface, set personal limits, and keep peaks under control across projects.
Useful for:
- Solo devs who want awareness without changing tooling
- Teams sharing a heuristic ("keep peak under 60%")
- Compliance / IP-sensitive codebases where exposure surface is auditable
- Pen-testers / security researchers auditing what AI tooling can see
How "exposure" is counted
A file counts as exposed the moment it is opened in the editor (active tab or background tab) in the current session, or any session in the past if persistence is enabled.
percent = exposed_lines / total_lines × 100
total_lines is the sum of newline-counted lines across all source files matching aiExposure.includeGlobs and not matching aiExposure.excludeGlobs.
exposed_files ⊆ all indexed files. Files outside the include globs (e.g. node_modules) are ignored for both numerator and denominator.
- File size cap (
aiExposure.maxFileSizeKB, default 2 MB) skips bulky lockfiles.
Editing a file re-counts its lines (debounced 800 ms). Deleting a file removes it from both totals.
UI walkthrough
Status bar
Always-on. Click to open the dashboard.
👁 AI exposure: 37.4%
Compact panel with:
- current % + progress bar + peak marker
- live sparkline (collapsible)
- live activity feed (collapsible)
- heartbeat dot — pulses on every event, fades when stale (>10s without events)
- animated counters for exposed lines / files / peak
Dashboard webview
Larger view, opened from status bar click or from AI Code Exposure: Show Dashboard:
- All projects table — every workspace ever seen, ranked by current exposure %, with color-coded
Now %, Peak %, Exposed L and Exposed F columns, plus per-project Secrets / Pass / PII counts
- 🛡 PSDE — Proactive Sensitive Data Exposure section — every detected sensitive file grouped by project, file paths in red with
SECRET / PASS / PII badges, and one-click Open (opens + highlights inline). Toggle PSDE and bulk-Review sensitive right here.
- Files (current project) table — searchable, "only exposed" filter, exposed paths in red, click to open

Inline highlighting
Open any file and the exact sensitive values are highlighted in place — 🔴 secret, 🟠 credential, 🟡 PII — with overview-ruler markers and a hover that names the finding. Toggle with aiExposure.highlightSensitive.enabled.

Commands
| Command |
Description |
AI Code Exposure: Show Dashboard |
Open the dashboard webview |
AI Code Exposure: Reset Current Project |
Clear exposed-files set for this workspace |
AI Code Exposure: Reset All Peaks |
Reset peaks for every tracked project |
AI Code Exposure: Forget a Project… |
Remove a project entirely from history |
AI Code Exposure: Rescan Workspace |
Re-index files after large changes |
AI Code Exposure: Toggle Proactive Protection (PSDE) |
Turn proactive blocking of sensitive files on/off |
AI Code Exposure: Review Sensitive Files (PSDE) |
Open the bulk picker to inspect / mark test-data |
AI Code Exposure: Mark Current File as Test Data |
Exclude the active file from sensitive counts |
AI Code Exposure: Remove Test-Data Flag from Current File |
Re-include the active file in sensitive counts |
AI Code Exposure: Clear All Test-Data Flags |
Reset every test-data flag |
Settings
| Setting |
Default |
Description |
aiExposure.includeGlobs |
broad source-code list |
Files counted as source |
aiExposure.excludeGlobs |
node_modules, dist, build, .git, … |
Files excluded |
aiExposure.persistAcrossSessions |
true |
Remember exposed files across restarts |
aiExposure.maxFileSizeKB |
2048 |
Skip files larger than this |
aiExposure.sensitiveAlert.enabled |
true |
Live warning when a file with secrets/PII is opened |
aiExposure.sensitiveAlert.modal |
true |
Show that alert as a blocking modal (vs corner toast) |
aiExposure.highlightSensitive.enabled |
true |
Highlight secrets/credentials/PII inline in open editors |
aiExposure.proactiveProtection.enabled |
false |
PSDE: block sensitive files from AI until confirmed |
aiExposure.proactiveProtection.reviewAfterScan |
true |
After a scan, open the bulk review picker (when PSDE on) |
aiExposure.thresholdAd.enabled |
true |
Show a one-time notice at high exposure |
aiExposure.thresholdAd.percent |
50 |
Threshold for the notice |
Privacy
- 100% local. No network calls. No telemetry.
- Data lives in VS Code
globalState only.
- Reset / Forget commands wipe data immediately.
Want fewer exposures?
When this project crosses 50% exposure, the extension shows a one-time notice recommending pandō — a complementary VS Code extension that adds an AST + MCP security guard layer with reversible in-memory snapshots, helping you reduce code surface shown to AI agents while keeping editing performance and error prevention. The notice auto-suppresses once pandō is installed, and you can dismiss it permanently from the popup.
License
Proprietary — End User License Agreement (EULA).
Starting with version 0.5.0, this extension is licensed under the EULA
included in the LICENSE file. Key points:
- ✅ Free to install and use (personal or internal commercial)
- ✅ Local-only, no telemetry, no data leaves your machine
- ❌ No redistribution, no derivative works, no commercial resale
- ❌ No reverse engineering / forking outside the marketplace channel
- 📜 Versions ≤ 0.4.1 remain under MIT (historical)
For commercial redistribution, enterprise licensing, MCP integration,
or team-aggregation features — contact the publisher via Visual Studio
Marketplace.
| |