sgasser/pasteguard

AI gets the context. Not your private data. Local-first privacy proxy for browser chat, AI APIs, and coding agents.

PasteGuard – A Local Privacy Proxy for AI Requests

What it does

  • Runs as a local HTTP proxy (Docker image) that sits between your application (or browser) and any LLM provider (OpenAI, Anthropic, Gemini, etc.).
  • Before the request reaches the provider, the service scans the payload for personally‑identifiable information (PII) and secrets (API keys, tokens, passwords, etc.) and replaces them with harmless placeholders.
  • When the provider returns a response, the placeholders are restored so you see the original data on your side.
  • Two operating modes:
    1. Mask Mode – always redacts sensitive data before sending it to the cloud model.
    2. Route Mode – routes requests that contain sensitive data to a local LLM (Ollama, vLLM, llama.cpp) while non‑sensitive requests can still go to the cloud.

Why it matters

  • Companies that must protect client data, logs, or credentials can still leverage powerful hosted LLMs without exposing raw private information.
  • Provides a single point‑of‑control for compliance (GDPR, HIPAA, etc.) without rewriting every app’s code.

How to use it

  1. Run the proxy
    docker run --rm -p 3000:3000 ghcr.io/sgasser/pasteguard:latest
    
    (Add -e ORT_DISABLE_TELEMETRY=1 if you hit a SIGSEGV in version 0.9.3.)
  2. Point your client to the proxy – e.g. for OpenAI:
    from openai import OpenAI
    client = OpenAI(base_url="http://localhost:3000/openai/v1")
    
    The same pattern works for Anthropic, Codex, etc.
  3. Optional: Browser extension – an experimental add‑on for ChatGPT, Claude and Gemini that masks data entered in the web UI.
  4. Dashboard – visit http://localhost:3000 to see each request, what was masked, and logs for audit.

Detection technology

  • Uses GLiNER (a lightweight NER model) together with format‑based checks and the python-stdnum library to recognise names, emails, phone numbers, credit‑card numbers, IBANs, IPs, VAT numbers, and a wide range of API keys and private keys.
  • Works on streaming payloads, so even real‑time chat completions are protected.

Tech stack

  • Runtime: Bun (JavaScript/TypeScript runtime) with the Hono web framework.
  • Detection back‑end: GLiNER + python-stdnum (in the detector/ folder).
  • Persistence: SQLite or PostgreSQL for request logs.

Who might use it

  • Development teams building internal AI‑assisted tools (support bots, code‑assistants, data‑analysis helpers) that need to keep customer data private.
  • Enterprises with strict data‑privacy policies that still want to leverage hosted LLM APIs.
  • Anyone wanting a quick, self‑hosted way to redact secrets before sending them to AI services.

Getting more info

  • Full documentation: https://pasteguard.com/docs
  • Installation guide, configuration of custom GLiNER models, and Route‑Mode details are linked from the README.

PasteGuard is an open‑source Apache‑2.0 project that provides a privacy‑first gateway for AI workloads.

Related

  • Project
  • Project
  • Project
  • Dispatch
  • Project