# pasteguard — Local Privacy Proxy for AI Tools > PasteGuard is an open-source local proxy that masks API keys, emails, and PII before requests reach OpenAI/Anthropic. Start via Docker. ## Install Save as a script file and run: ## Quick Use ```bash docker run --rm -p 3000:3000 ghcr.io/sgasser/pasteguard:en # OpenAI-compatible clients: use PasteGuard as base_url echo 'OpenAI base_url: http://localhost:3000/openai/v1' # Claude Code: route Anthropic traffic through PasteGuard ANTHROPIC_BASE_URL=http://localhost:3000/anthropic claude ``` ## Intro PasteGuard is an open-source local proxy that masks API keys, emails, and PII before requests reach OpenAI/Anthropic. Start via Docker. **Best for:** Teams using AI coding tools who must avoid leaking secrets in prompts **Works with:** Docker, OpenAI SDK base_url override, Claude Code via ANTHROPIC_BASE_URL **Setup time:** 3-8 minutes ### Key facts (verified) - GitHub: 628 stars · 26 forks · pushed 2026-05-13. - License: Apache-2.0 · owner avatar + repo URL verified via GitHub API. - README-verified entrypoint: `docker run --rm -p 3000:3000 ghcr.io/sgasser/pasteguard:en`. ## Main - Treat PasteGuard as a drop-in reverse proxy: you change the base URL once, and it masks secrets/PII before the request leaves your machine. - Use it both for chat and coding tools: the proxy path supports OpenAI-style `/v1` routing and a dedicated `/anthropic` endpoint. - If you need higher privacy, enable the project’s “route mode” idea: sensitive requests can be routed to a local model while non-sensitive traffic goes to a hosted provider (see docs). ### Source-backed notes - README Quick Start runs a local proxy container on port 3000 and shows base URLs like `http://localhost:3000/openai/v1`. - README claims it detects 30+ types of sensitive data across 24 languages and keeps data on-device. - README includes a Claude Code example using `ANTHROPIC_BASE_URL=http://localhost:3000/anthropic`. ### FAQ - **Does it require code changes?**: Usually no — you swap the provider base URL to the localhost proxy and keep the rest the same. - **What does it mask?**: README highlights names, emails, and API keys; masking behavior depends on its detection engine and config. - **Can I use it with Claude Code?**: Yes — README shows routing Anthropic requests via `ANTHROPIC_BASE_URL` to the local proxy. ## Source & Thanks > Source: https://github.com/sgasser/pasteguard > License: Apache-2.0 > GitHub stars: 628 · forks: 26 --- ## Quick Use ```bash docker run --rm -p 3000:3000 ghcr.io/sgasser/pasteguard:en # OpenAI-compatible clients: use PasteGuard as base_url echo 'OpenAI base_url: http://localhost:3000/openai/v1' # Claude Code: route Anthropic traffic through PasteGuard ANTHROPIC_BASE_URL=http://localhost:3000/anthropic claude ``` ## Intro PasteGuard 是开源本地代理:在请求到达 OpenAI/Anthropic 前自动遮盖 API key、邮箱等敏感信息。用 Docker 3 分钟跑起,然后把客户端 Base URL 指到 localhost。 **Best for:** 在 Cursor/Claude Code 等场景下,必须防止密钥/隐私外泄的团队 **Works with:** Docker;OpenAI SDK 的 base_url 覆盖;Claude Code 的 ANTHROPIC_BASE_URL **Setup time:** 3-8 minutes ### Key facts (verified) - GitHub:628 stars · 26 forks;最近更新 2026-05-13。 - 许可证:Apache-2.0;作者头像与仓库链接均已通过 GitHub API 复核。 - README 中核对过的入口命令:`docker run --rm -p 3000:3000 ghcr.io/sgasser/pasteguard:en`。 ## Main - 把 PasteGuard 当成“只改一次 URL 的反向代理”:客户端的 base URL 指向 localhost,它会在请求出机前自动脱敏。 - 同时覆盖聊天与编码工具:README 给出 OpenAI 风格 `/openai/v1` 路径以及 `/anthropic` 入口。 - 需要更强隐私时,可参考其“route mode”思路:含敏感信息的请求转发到本地模型,其他请求再走云端(以文档为准)。 ### Source-backed notes - README 的 Quick Start 使用 Docker 在 3000 端口启动本地代理,并给出 `http://localhost:3000/openai/v1` 这样的 base URL 示例。 - README 提到可检测 30+ 类敏感数据、覆盖 24 种语言,并强调数据不离开本机。 - README 给出 Claude Code 的示例:`ANTHROPIC_BASE_URL=http://localhost:3000/anthropic`。 ### FAQ - **需要改业务代码吗?**:大多数情况不需要:把 provider 的 base URL 换成 localhost 代理即可。 - **能脱敏哪些内容?**:README 强调姓名、邮箱、API key 等;具体规则以其检测引擎与配置为准。 - **能和 Claude Code 一起用吗?**:可以。README 给出了通过 `ANTHROPIC_BASE_URL` 走本地代理的示例。 ## Source & Thanks > Source: https://github.com/sgasser/pasteguard > License: Apache-2.0 > GitHub stars: 628 · forks: 26 --- Source: https://tokrepo.com/en/workflows/pasteguard-local-privacy-proxy-for-ai-tools Author: Script Depot