Skip to content

sgasser/pasteguard

Repository files navigation

PasteGuard

CI License Release

AI gets the context. Not your secrets.
Automatically hides names, emails, and API keys before you send prompts to AI.

Quick Start · Chat · Coding Tools · Documentation


PasteGuard — Without vs. With: masks names, emails, and API keys before they reach AI

Detects 30+ types of sensitive data across 24 languages.
Your data never leaves your machine.

Works Everywhere

Chat — Masks PII and secrets when you paste into ChatGPT, Claude, and Gemini. You see originals, AI sees placeholders.

Apps — Open WebUI, LibreChat, or any self-hosted AI setup. Optionally routes sensitive requests to a local model.

Coding Tools — Cursor, Claude Code, Copilot, Windsurf — your codebase context flows to the provider. PasteGuard masks secrets and PII before they leave.

API Integration — Sits between your code and OpenAI or Anthropic. Change one URL, your users' data stays protected.

Quick Start

Run PasteGuard as a local proxy:

docker run --rm -p 3000:3000 ghcr.io/sgasser/pasteguard:en

Point your tools or app to PasteGuard instead of the provider:

API PasteGuard URL Original URL
OpenAI http://localhost:3000/openai/v1 https://api.openai.com/v1
Anthropic http://localhost:3000/anthropic https://api.anthropic.com
# One line to protect your data
client = OpenAI(base_url="http://localhost:3000/openai/v1")
European Languages

For German, Spanish, French, Italian, Dutch, Polish, Portuguese, and Romanian:

docker run --rm -p 3000:3000 ghcr.io/sgasser/pasteguard:eu

For custom config, persistent logs, or other languages: Read the docs →

Route Mode

Route Mode sends requests containing sensitive data to a local LLM (Ollama, vLLM, llama.cpp). Everything else goes to OpenAI or Anthropic. Sensitive data stays on your network.

Route Mode docs →

Chat

Open-source browser extension for ChatGPT, Claude, and Gemini.

  • Paste customer data → masked before it reaches the AI
  • AI responds with placeholders → you see the originals
  • Works with the same detection engine as the proxy

Currently in beta. Apache 2.0.

Join the Beta → · Chat docs →

Coding Tools

Protect your codebase context and secrets when using AI coding assistants.

Claude Code:

ANTHROPIC_BASE_URL=http://localhost:3000/anthropic claude

Cursor: Settings → Models → Enable "Override OpenAI Base URL" → http://localhost:3000/openai/v1

Coding Tools docs →

Dashboard

Every request is logged with masking details. See what was detected, what was masked, and what reached the provider.

PasteGuard Dashboard

localhost:3000/dashboard

What it catches

Personal data — Names, emails, phone numbers, credit cards, IBANs, IP addresses, locations. Powered by Microsoft Presidio. 24 languages.

Secrets — API keys (OpenAI, Anthropic, Stripe, AWS, GitHub), SSH and PEM private keys, JWT tokens, bearer tokens, passwords, connection strings.

Both detected and masked in real time, including streaming responses.

Tech Stack

Bun · Hono · Microsoft Presidio · SQLite

Contributing

See CONTRIBUTING.md for guidelines on how to contribute.

License

Apache 2.0