Contact Us

Tell us about your stack and the privacy problems you're trying to solve. We typically respond within one business day.

Prefer email? support@philterd.ai

Please do not enter PII or PHI in this form. If you need to share an example, use a sanitized one.

Knowledge base How-to

Using Claude Desktop with Philter AI Proxy

Route Claude Desktop through Philter AI Proxy to redact PII from prompts before they reach Anthropic.

For Philter AI Proxy

Claude Desktop can send its model requests to a gateway of your choosing instead of straight to Anthropic. Point it at Philter AI Proxy and the proxy redacts each prompt before it leaves your machine or network: names, SSNs, email addresses, phone numbers, and credit card numbers are replaced with tokens such as {{{REDACTED-ssn}}}, and Anthropic sees only the tokens.

This guide runs the proxy in Docker on the same computer as Claude Desktop. The same steps work for a proxy on a shared server; use its hostname in place of localhost.

Before you start:

  • Claude Desktop uses an Anthropic API key in this mode, set up in Anthropic’s third-party inference mode. Usage is billed per token to that key’s account, not to a Claude subscription. Claude on the web and the mobile apps cannot be routed this way.
  • Redaction is probabilistic. The policy is designed to catch the listed types of data, and it can miss values or replace text that is not sensitive. Test it with your own prompts before relying on it.
  • You need Docker, openssl, and curl.

1. Create a certificate Claude Desktop trusts

Claude Desktop must trust the proxy’s certificate, so the self-signed certificate the proxy generates by default will not work. Create a small certificate authority (CA) and a certificate for localhost signed by it. On Windows, run these commands in WSL or Git Bash:

mkdir philter-ai-proxy && cd philter-ai-proxy

openssl req -x509 -newkey rsa:2048 -nodes -keyout ca.key -out ca.crt -days 825 \
  -subj "/CN=Philter AI Proxy Local CA"

openssl req -newkey rsa:2048 -nodes -keyout tls.key -out tls.csr -subj "/CN=localhost"

openssl x509 -req -in tls.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out tls.crt -days 825 \
  -extfile <(printf "subjectAltName=DNS:localhost,IP:127.0.0.1\nextendedKeyUsage=serverAuth")

# The proxy runs as user 10001 in its container, which must be able to read the key.
chmod 644 tls.key

Then trust the CA (ca.crt, not tls.crt) on the computer running Claude Desktop:

  • macOS: sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ca.crt
  • Windows (PowerShell as administrator): Import-Certificate -FilePath ca.crt -CertStoreLocation Cert:\LocalMachine\Root

Anthropic documents that Claude Desktop trusts the operating system’s certificate store, and on macOS the System keychain. If sessions still report a certificate error, give them ca.crt with NODE_EXTRA_CA_CERTS as Anthropic’s network proxy page describes.

Keep ca.key private: anything signed with it is trusted by this computer. If your organization already issues certificates, use one of those instead and skip this step.

2. Write the proxy’s configuration

Save this as application.yaml in the same directory:

server:
  ssl:
    certificate: /etc/philter-ai-proxy/tls/tls.crt
    certificate-private-key: /etc/philter-ai-proxy/tls/tls.key
    enabled-protocols: TLSv1.3,TLSv1.2
proxy:
  providers:
    anthropic:
      target: https://api.anthropic.com
  defaults:
    # Created in step 4.
    policy: claude-desktop
  audit:
    file: /var/lib/philter-ai-proxy/audit.jsonl

It serves HTTPS with your certificate, sends Claude traffic to Anthropic, applies the claude-desktop policy, and writes each request’s audit entry to a file as well as to the container’s log. Every setting is described in the proxy’s configuration reference.

3. Start the proxy

Generate the two secrets the proxy needs, and keep a copy of the encryption key: the proxy’s database cannot be read without it.

export ENCRYPTION_KEY="$(openssl rand -hex 32)"
export BOOTSTRAP_API_KEY="$(openssl rand -hex 32)"

docker run -d --name philter-ai-proxy \
  -p 127.0.0.1:8080:8080 \
  -v philter-ai-proxy-data:/var/lib/philter-ai-proxy \
  -v "$PWD/tls.crt:/etc/philter-ai-proxy/tls/tls.crt:ro" \
  -v "$PWD/tls.key:/etc/philter-ai-proxy/tls/tls.key:ro" \
  -v "$PWD/application.yaml:/etc/philter-ai-proxy/application.yaml:ro" \
  -e SPRING_CONFIG_ADDITIONAL_LOCATION=file:/etc/philter-ai-proxy/application.yaml \
  -e PHILTER_AI_PROXY_ENCRYPTION_KEY="$ENCRYPTION_KEY" \
  -e PHILTER_AI_PROXY_BOOTSTRAP_API_KEY="$BOOTSTRAP_API_KEY" \
  philterd/philter-ai-proxy:1.0.0

Publishing the port on 127.0.0.1 keeps the proxy reachable from this computer only. The bootstrap key becomes the proxy’s first admin key. Wait until the proxy has loaded its model, checking the certificate as Claude Desktop will:

curl --cacert ca.crt https://localhost:8080/readyz
{"status":"ok"}

4. Create the policy

The policy decides what is redacted. This one finds person names with the PhEye model bundled in the image, and SSNs, email addresses, phone numbers, and credit card numbers with patterns, and replaces each with a token naming its type. Save it as claude-desktop-policy.json:

{
  "identifiers": {
    "person": {
      "phEyeConfiguration": {
        "modelPath": "ph-eye-pii-en-small",
        "labels": ["name"],
        "threshold": 0.9
      },
      "phEyeFilterStrategies": [{"strategy": "REDACT"}]
    },
    "ssn": {
      "ssnFilterStrategies": [{"strategy": "REDACT"}]
    },
    "emailAddress": {
      "emailAddressFilterStrategies": [{"strategy": "REDACT"}]
    },
    "phoneNumber": {
      "phoneNumberFilterStrategies": [{"strategy": "REDACT"}]
    },
    "creditCard": {
      "creditCardFilterStrategies": [{"strategy": "REDACT"}]
    }
  }
}

Create it with the admin API:

curl --cacert ca.crt "https://localhost:8080/admin/api/policies?name=claude-desktop" \
  -H "Authorization: Bearer $BOOTSTRAP_API_KEY" \
  -H "Content-Type: application/json" \
  --data @claude-desktop-policy.json

The proxy checks the policy when it is saved and answers 201 when it is accepted. To add other types of data, see the proxy’s policy documentation.

5. Create a key for Claude Desktop

Claude Desktop authenticates to the proxy with a proxy key, separate from its Anthropic API key. Create one that can reach only Anthropic and always uses the claude-desktop policy:

curl --cacert ca.crt https://localhost:8080/admin/api/keys \
  -H "Authorization: Bearer $BOOTSTRAP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "claude-desktop", "roles": ["proxy"], "providers": ["anthropic"], "policy": "claude-desktop"}'
{"roles":["proxy"],"providers":["anthropic"],"models":[],"paths":[],"policy":"claude-desktop","id":"b2ab640e-...","name":"claude-desktop","createdAt":"...","key":"pap_..."}

Copy the key: it is shown only this once.

6. Test the proxy

Send a prompt the way Claude Desktop will, with your Anthropic API key and the proxy key:

export PROXY_KEY="pap_..."
export ANTHROPIC_API_KEY="sk-ant-..."

curl --cacert ca.crt https://localhost:8080/v1/messages \
  -H "x-philter-proxy-key: $PROXY_KEY" \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{"model": "claude-sonnet-5-5", "max_tokens": 200, "messages": [{"role": "user", "content": "Draft a reply to Maria Lopez (maria.lopez@example.com, 215-555-0142) about the card ending 4111 1111 1111 1111 and SSN 123-45-6789."}]}'

Anthropic receives this prompt:

Draft a reply to {{{REDACTED-name}}} ({{{REDACTED-email-address}}}, {{{REDACTED-phone-number}}}) about the card ending {{{REDACTED-credit-card}}} and SSN {{{REDACTED-ssn}}}.

The proxy key stays with the proxy; the Anthropic key is passed on so Anthropic can bill your account.

7. Configure Claude Desktop

In Claude Desktop, choose Help → Troubleshooting → Enable Developer Mode, then Developer → Configure Third-Party Inference (on Windows and Linux, start from the ☰ menu at the top left of the login screen), and set:

SettingValue
inferenceProvidergateway
inferenceGatewayBaseUrlhttps://localhost:8080 (without /v1)
inferenceGatewayApiKeyYour Anthropic API key
inferenceGatewayAuthSchemex-api-key
inferenceCustomHeaders{"x-philter-proxy-key": "pap_..."}, with the key from step 5

Anthropic’s reference describes inferenceCustomHeaders as meant for routing headers, not credentials. Claude Desktop sends only one credential of its own, the Anthropic API key, so the proxy key has to travel as a custom header. It is the less sensitive of the two: it is limited to Anthropic, and is no use without an Anthropic API key.

Settings take effect when Claude Desktop starts, so quit and reopen it. Chat, Cowork, and Code sessions all send their requests to the proxy. The login screen still offers to sign in to Claude.ai, which would bypass the proxy; to remove that choice, also set deploymentMode to 3p (Claude Desktop 4.16336.0 or later).

To roll the same settings out to many computers, deploy them with your device management tool instead. Anthropic’s MDM page lists where each operating system reads them from. Every computer then shares the one proxy key, so create a key per team or group rather than per person, and run the proxy on a server they can all reach.

8. Check the audit log

Each request adds one line to the audit file:

docker exec philter-ai-proxy tail -n 1 /var/lib/philter-ai-proxy/audit.jsonl
{"timestamp":"2026-12-03T23:07:25.292Z","request_id":"449bee59-...","event":"proxy_request","provider":"anthropic","model":"claude-sonnet-5-5","policy_name":"claude-desktop","key_id":"b2ab640e-...","trace_id":"9fd18ec61d088c1675f3eb0c56f9b38d","client_ip":"172.17.0.1","http_status":200,"fields_redacted":1,"entity_count":5,"entity_types":{"credit-card":1,"email-address":1,"person":1,"phone-number":1,"ssn":1},"redact_latency_ms":44,"duration_ms":100,"streamed":false}

It records which policy ran and how many values of each type it replaced, never the prompt itself.

What to know

  • Images and files are not redacted. The proxy redacts text only, so by default it refuses a request that carries an image or file rather than send it unredacted. To send them on unredacted instead, set proxy.defaults.media: forward.
  • Responses keep the tokens. Claude answers about {{{REDACTED-name}}}, not the person, because it never saw the name.
  • Watch for false positives. Version numbers, IDs, and code can resemble phone or card numbers. Adjust the policy if the tokens get in the way.