> ## Documentation Index
> Fetch the complete documentation index at: https://evalvcr.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# VCR Cassettes & Scrubbing

> Cassette v1 schema, replay modes, canonical SHA-256 fingerprinting, and 7-step secret scrubbing.

## Cassette Modes

| Mode | Behavior |
| :- | :- |
| `record` | Always calls live upstream SDKs/servers, scrubs responses, and writes `.evalvcr.json`. |
| `replay` | Replays first unconsumed interaction matching fingerprint (FIFO). Forbids live calls (`CassetteMissError`). |
| `auto` | Replays if the cassette exists on disk; otherwise records live and saves. |
| `strict` | Enforces exact `seq === cursor++` order and fingerprint match. Emits structured diffs via `CassetteDriftError` on mismatch or unconsumed trailing interactions. |

## 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]`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.