Skip to main content
cac applies multiple independent protection layers. Each works on its own — together they provide defense in depth.

Overview

Layer 0: Proxy routing

When configured. All outbound traffic from claude goes through your proxy.
  • HTTPS_PROXY, HTTP_PROXY, ALL_PROXY set to proxy URL
  • NO_PROXY set to localhost,127.0.0.1
  • Auto-relay when TUN detected
When not configured. No proxy env vars set. Traffic goes direct. ANTHROPIC_API_KEY preserved.

Layer 1: Device fingerprint spoofing

Every environment generates unique device identifiers: Spoofed at two levels: shell shims (for command-line tools) and Node.js hooks (for programmatic access).

Layer 2: Telemetry environment variables

Layer 3: HOSTALIASES

Maps telemetry domains to 0.0.0.0 via the HOSTALIASES environment variable:
Works at the gethostbyname() level — a backup for DNS guard.

Layer 4: DNS guard + fetch interception

cac-dns-guard.js is loaded via NODE_OPTIONS --require:
  • Intercepts dns.lookup() and dns.resolve() to block telemetry domains
  • Replaces global.fetch to block/redirect telemetry requests
  • Manages NO_PROXY for health check bypass timing

Layer 5: Health check bypass

Claude Code pings api.anthropic.com/api/hello at startup. Through a proxy, Cloudflare returns 403 due to Node.js TLS fingerprint rejection (JA3/JA4). cac’s dns-guard.js uses in-process Node.js interception: it patches https.request and fetch so that calls to this URL immediately return a fake HTTP 200 — no local server, no port binding, no root needed. The interception is entirely in-process and produces no network traffic. Only active when proxy is configured.

Layer 6: mTLS certificates

Each environment has a client certificate signed by cac’s CA (~/.cac/ca/ca_cert.pem). Injected via:
  • CAC_MTLS_CERT / CAC_MTLS_KEY — cert paths
  • NODE_EXTRA_CA_CERTS — CA trust

Layer 7: Config isolation

CLAUDE_CONFIG_DIR points to ~/.cac/envs/<name>/.claude/ instead of ~/.claude/. This isolates:
  • Auth tokens (OAuth / session)
  • Settings (settings.json)
  • Project memory
  • Session history
  • Statsig state