PasteGuard is an open-source privacy proxy that protects sensitive information like personal data and API secrets by detecting and masking them before they reach large language model APIs such as OpenAI or Anthropic Claude. It sits between an application and the LLM provider, automatically replacing names, emails, tokens, and other personally identifiable information (PII) with placeholders so that external services never see raw sensitive values, and then optionally unmasking them in the returned output. PasteGuard supports two primary modes: mask mode, which anonymizes data and still uses external APIs; and route mode, which forwards sensitive requests to a local LLM inference engine while sending the rest to the cloud. It can be self-hosted via Docker, works with a wide range of SDKs and tools, and includes a browser extension for automatic protection in everyday AI chats.
Features
- Automatic PII detection and masking
- Secrets and API key protection
- Mask mode and route-to-local mode
- Self-hostable proxy server
- Support for multiple languages
- Browser extension for real-time protection