Skip to main content

Cassette Modes

Canonical JSON & Fingerprinting

To guarantee identical fingerprints in TypeScript and Python:
  1. Requests are scrubbed before hashing.
  2. Envelopes are serialized using JCS-aligned canonical JSON (UTF-16 code unit key order, -0 normalized to 0, undefined omitted in objects / null in arrays, mcp.id excluded).
  3. Lowercase hex SHA-256 of the canonical UTF-8 envelope becomes interaction.fingerprint.

7-Step Deterministic Scrubber

Executed identically in TypeScript (packages/core/src/scrub.ts) and Python (python/evalvcr/src/evalvcr/scrub.py):
  1. Sensitive Headers -> [REDACTED:SECRET] (authorization, proxy-authorization, x-api-key, api-key, anthropic-api-key, openai-api-key, cookie, set-cookie, x-auth-token)
  2. PEM Private Keys -> [REDACTED:SECRET]
  3. Database Connection Strings -> preserves scheme/user/@, replaces password with [REDACTED:SECRET]
  4. Bearer & API Tokens (Bearer, sk-ant-, sk-, ghp_, github_pat_, AKIA, AIza) -> [REDACTED:SECRET]
  5. US SSNs -> [REDACTED:PII]
  6. Payment Cards (Luhn-validated) -> [REDACTED:PII]
  7. Email Addresses -> [REDACTED:PII]