explaingit

afk-surf/safeclipper

16PythonAudience · developerComplexity · 3/5Setup · moderate

TLDR

A local privacy filter that OCR-scans screenshots, detects sensitive text like API keys, emails, and account numbers using an on-device AI model, and paints black redaction boxes over those regions before the image leaves your machine.

Mindmap

mindmap
  root((safeclipper))
    What it does
      Screenshot redaction
      Sensitive text detection
      Local privacy filter
    Tech stack
      Rust CLI
      SwiftUI macOS app
      ONNX model
      Apple Vision OCR
    Platforms
      macOS
      Linux
      Windows
    Use cases
      AI agent safety
      Support workflows
      Screenshot sharing
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Automatically redact API keys, emails, and account numbers from screenshots before passing them to an AI coding agent.

USE CASE 2

Process screenshots in bulk to black out all personally identifiable information before uploading to a support ticket.

USE CASE 3

Use the macOS SwiftUI app to one-click redact a screenshot before sharing it with a cloud service.

USE CASE 4

Scan copied plain text to identify which spans a privacy model flags as sensitive before pasting into an AI chat.

Tech stack

RustPythonSwiftUIONNXTesseractApple Vision

Getting it running

Difficulty · moderate Time to first run · 30min

Requires Rust 1.88+ to build and a provided script to download ONNX model files separately, image redaction needs macOS or a Tesseract installation on other platforms.

No license is mentioned in the project description.

In plain English

safeclipper is a local privacy filter for screenshots intended for use before sending images to AI agents, cloud services, or support workflows. The problem it addresses is that AI agents increasingly need screen context to do their work, but screenshots often contain names, email addresses, phone numbers, API keys, account numbers, and other private data that should not leave the device. safeclipper runs an OCR step to read the text in an image, then runs a local AI model to identify which spans are sensitive, then paints black masks over those regions before the image is passed anywhere. All processing happens on the user's machine. The privacy detection model is a quantized version of OpenAI's Privacy Filter, stored as an ONNX file and run locally. OCR is handled by Apple Vision on macOS or by Tesseract on other platforms. The tool can work on plain text as well as images: for plain text input it returns the detected sensitive spans, for image input it maps those spans back to their locations in the image and outputs a redacted copy. The repository has two main components. A Rust command-line tool handles text and image redaction and works on macOS, Linux, and Windows (image redaction requires macOS or a Tesseract installation). A native macOS app built with SwiftUI wraps the same Rust library with a graphical interface. Performance on an Apple M3 Max is around 1.4 seconds end-to-end for a screenshot, including process startup, model loading, OCR, inference, and writing the output image. The README includes benchmark results on a dataset of 210 synthetic desktop screenshots showing that safeclipper blocked about 70% of private information while preserving 91.5% of the image's utility for a downstream question-answering task. A comparison table in the README places it ahead of two other redaction tools on overall score, and just behind a cloud-based approach that uses a much larger model. Building requires Rust 1.88 or newer. The ONNX model files are downloaded separately via a provided script before building.

Copy-paste prompts

Prompt 1
Use safeclipper to redact all sensitive information from screenshot.png and save the cleaned version as output.png without sending anything to the cloud.
Prompt 2
How do I build safeclipper from source on macOS? I have Rust 1.88 installed. Which script downloads the ONNX model files before building?
Prompt 3
I want to run safeclipper on Linux with Tesseract. Does image redaction work the same as on macOS, or are there limitations?
Prompt 4
How do I run safeclipper in plain-text mode to see which spans in a log file are flagged as sensitive before I paste it into Claude?
Prompt 5
My safeclipper redaction is only blocking 70% of sensitive content. How do I tune the detection threshold to be more aggressive?
Open on GitHub → Explain another repo

← afk-surf on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.