What Baton scrubs from your events
PII scrubbing runs on your machine inside the proxy, before any event leaves your laptop. The default ruleset is on by default and ships baked into the proxy — there's no env var to turn it off in v1, and Baton's servers never see the raw values.
Pattern-based redaction
Each rule replaces matched strings with a [REDACTED:<category>] token. The token preserves the structural position so a friction report still shows what kind of value was there.
Email addresses
alice@example.com → [REDACTED:email]
RFC-ish regex on the standard local@domain.tld shape.
Bearer tokens
Bearer abc123... → [REDACTED:bearer]
Authorization-header-style values: ``Bearer`` followed by 16+ token chars.
OpenAI / Anthropic style API keys
sk-ABC...XYZ → [REDACTED:sk_key]
``sk-`` prefix + 20+ alphanumeric/underscore/hyphen chars.
AWS access key IDs
AKIAIOSFODNN7EXAMPLE → [REDACTED:aws_key]
``AKIA`` prefix + exactly 16 uppercase alphanumerics.
JSON Web Tokens (JWT)
eyJhbGc.eyJzdWI.SflKxw → [REDACTED:jwt]
Three base64url segments separated by dots, leading ``eyJ`` header.
Phone numbers
(555) 123-4567 → [REDACTED:phone]
Optional +1 country code, optional area-code parens, common separators, 10 digits.
Credit card numbers
4111 1111 1111 1111 → [REDACTED:cc]
13-19 digit candidates filtered by Luhn checksum.
Field-name overrides
Any dict key matching one of these names (case-insensitive) has its string value redacted regardless of pattern. Catches things like {"password": "ok123"} where the value itself isn't pattern-detectable.
emailphonessnapi_keytokensecretpassword
What scrubbing doesn't cover yet
- Free-text names, addresses, and other unstructured identifiers. Regex won't catch these reliably; ML-based PII detection (Presidio, AWS Comprehend) is on the roadmap as a paid enterprise tier.
- Custom rules — v1 ships the fixed list above. Public configurability lands once a customer asks for it.
- Scrub counts are visible in the in-Claude
baton_session_reporttool today; the dashboard rollup ("Baton has redacted N emails this month") arrives with the customer dashboard.