Integration Guide

Claude Code + AI Privacy Gateway

Stop Claude Code from reading your proprietary source code raw

TL;DR: Claude Code is Anthropic's agentic coding tool that reads your entire codebase. AI Privacy Gateway masks sensitive patterns in your code before they reach Anthropic's servers..
Integration = one config change. No SDK changes needed.

Why Add PII Masking to Claude Code?

Claude Code is Anthropic's agentic coding tool that reads your entire codebase. AI Privacy Gateway masks sensitive patterns in your code before they reach Anthropic's servers.

How It Works

Your App + Claude Code
Privacy Gateway
(masks PII locally)
AI API
(receives clean data)
✓ PII masked before leaving your machine ✓ Zero code changes in your Claude Code integration

Benefits

Protect API keys, tokens, and secrets embedded in code
Mask PII in test fixtures and database seeds
Keep proprietary algorithms confidential from AI analysis

Setup: Connect Claude Code to AI Privacy Gateway

Configuration — Change One Line
# Set environment variable to route through gateway
export ANTHROPIC_BASE_URL="http://localhost:9999/v1"

# Or configure in Claude Code settings
claude config set ANTHROPIC_BASE_URL "http://localhost:9999/v1"

Step-by-Step Setup

  1. 1 Deploy gateway: docker run -d -p 9999:9999 ghcr.io/gunxueqiu6/ai-privacy-gateway:lite
  2. 2 Set ANTHROPIC_BASE_URL=http://localhost:9999/v1
  3. 3 Run Claude Code normally — PII and secrets in code are auto-masked

Start Protecting Your Claude Code Data

Deploy AI Privacy Gateway in 30 seconds. Free and open source.

Frequently Asked Questions

Does this work with the latest version of Claude Code?

Yes. AI Privacy Gateway works at the HTTP layer as a transparent proxy. It is compatible with any version of Claude Code that makes HTTP API calls.

Will this affect my Claude Code performance?

The gateway adds less than 1ms per request. The PII detection engine is written in Rust for maximum throughput, so your Claude Code application performance will not be noticeably affected.

Can I use this with multiple AI providers through Claude Code?

Yes. Route all your AI API calls through the same gateway. It works transparently with any OpenAI-compatible API — just change the base URL.