Dev.to Security πŸ” Cybersecurity πŸ‘ 0 πŸ“– 3 min read

How to Auto-Redact Emails, API Keys & PII in Screenshots Before Pasting to ChatGPT (100% Offline on Windows)

Every day, developers and knowledge workers take screenshots of error logs, dashboards, billing pages, or Slack threads and paste them directly into ChatGPT, Claude, GitHub Issues, or X (Twitter). Even when the main par

How to Auto-Redact Emails, API Keys & PII in Screenshots Before Pasting to ChatGPT (100% Offline on Windows)

Every day, developers and knowledge workers take screenshots of error logs, dashboards, billing pages, or Slack threads and paste them directly into ChatGPT, Claude, GitHub Issues, or X (Twitter).

Even when the main part of your screen looks safe, sensitive PII (Personally Identifiable Information) and secrets often lurk in the corners:

  • An email address or account name in the top-right navbar
  • An sk-... OpenAI API key, AWS key (AKIA...), or Bearer token in a terminal or .env preview
  • A customer phone number, IPv4 address, or credit card number in a debug payload

Manually drawing blur/pixelate boxes over 6 different places in an image editor takes 30+ secondsβ€”so people either skip it (risking a leak) or avoid sharing screenshots altogether.

To solve this, I built 1-Click Offline Auto-Redact PII (Ctrl + Shift + M) into SnapBolt v2.6.4 for Windows 10/11.

πŸ‘‰ Free Download (Manual Pixelate + Step Badges Free Forever / First 10 Auto-Redactions Free):
https://snapbolt.dev/en/auto-redact-pii-screenshot-windows

πŸ”’ 1. How 1-Click Offline Auto-Redact (Ctrl + Shift + M) Works

SnapBolt Screenshot & Annotation Workflow

When you capture a region with SnapBolt (PrintScreen or Ctrl + Shift + S):

  1. Click the πŸ”’ Auto-Redact button on the toolbar (or press Ctrl + Shift + M).
  2. SnapBolt runs Windows native on-device OCR (Windows.Media.Ocr) in memoryβ€”100% offline with zero cloud uploads.
  3. It scans every recognized word and line against a multi-pattern PII & secret detector:
    • Emails: [email protected]
    • API Keys & Tokens: sk-..., ghp_..., AKIA..., AIza..., JWTs
    • Phone Numbers & Credit Cards: International & local phone formats, 13–16 digit card numbers
    • Network & IDs: Private/public IPv4 addresses, postal codes, and labeled personal names/addresses
  4. Every matched bounding box (OcrWord.BoundingRect) is immediately pixelated on the canvas (and supports Ctrl + Z Undo if you want to un-redact a box).
  5. Press Ctrl + C (or just close to auto-copy) and hit Ctrl + V directly into ChatGPT, Claude, Slack, or GitHub!

πŸ’» Under the Hood: C# / WPF On-Device OCR + Bounding-Box Pixelation

Because security-conscious users never want raw screenshots uploaded to a third-party OCR API, we use Windows 10/11's built-in Windows.Media.Ocr.OcrEngine, which runs locally on the client machine:

using Windows.Graphics.Imaging;
using Windows.Media.Ocr;

public async Task<IReadOnlyList<Rect>> DetectPiiRegionsAsync(SoftwareBitmap bitmap)
{
    var ocrEngine = OcrEngine.TryCreateFromUserProfileLanguages()
                 ?? OcrEngine.TryCreateFromLanguage(new Windows.Globalization.Language("en-US"));
    if (ocrEngine == null) return Array.Empty<Rect>();

    OcrResult result = await ocrEngine.RecognizeAsync(bitmap);
    var regions = new List<Rect>();

    foreach (var line in result.Lines)
    {
        foreach (var word in line.Words)
        {
            if (PiiRegexMatcher.IsSensitiveToken(word.Text))
            {
                var r = word.BoundingRect;
                regions.Add(new Rect(r.X - 4, r.Y - 2, r.Width + 8, r.Height + 4));
            }
        }
    }
    return regions;
}

Because OcrWord.BoundingRect gives exact pixel coordinates for each token on the captured SoftwareBitmap, we can apply an irreversible block-mosaic filter directly to those rectangles without touching the rest of the screenshot.

πŸ“ 2. Bonus in v2.6.4: Smart Edge-Detecting Pixel Ruler (D Key)

For frontend developers and UI designers checking padding, margins, and alignment on Windows:

  • Press D (or select the πŸ“ Ruler tool) during capture.
  • Hover anywhere on your screen: SnapBolt automatically ray-casts in 4 directions (Left, Right, Top, Bottom) to detect UI container edges by luminance contrast and displays the exact W Γ— H px dimensions in real time.
  • You can also drag to measure any custom distance and bake the measurement line directly into your screenshot for design QA tickets!
  • Learn more: https://snapbolt.dev/en/screen-pixel-ruler-measure-windows

πŸ–ΌοΈ 3. Floating Pin with Translucent Drag-and-Drop

Pin any screenshot always-on-top (Pin button), and when you're ready to use it, simply drag the pinned window (with a live translucent preview thumbnail following your cursor) and drop it straight into ChatGPT, Slack, Discord, Notion, or VS Code.

πŸš€ Try SnapBolt v2.6.4 for Windows 10 / 11

Manual pixelation, β‘ β‘‘β‘’ auto-incrementing step badges, arrows, frames, floating pins, and 10-second MP4/GIF screen recordings are 100% free forever with zero watermarks. And the new 1-Click Auto-Redact PII (Ctrl + Shift + M) includes 10 free uses out of the box (plus a 14-day full Pro trial via the invite link below):

πŸ“° Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.