Skip to main content

Updates

Probe caches key on token fingerprints and are bounded (issue #910) WRITABLE_ENRICHMENT_CACHE and _ENRICHMENT_OPTION_CACHE — the process-level caches behind the select-schema drift guard (#914) — were keyed by (token, slug) with the raw workspace API token in the key. At the time, preflight._owner_member_cache also used raw-token keys; that separate cache was hardened in issue #924. In a long-lived process (Modal webhook handlers) serving many workspaces that left two problems: the raw API token of every workspace served was copied into a second, unbounded-lifetime dict outside any key-scope lifecycle and never evicted, and nothing capped either dict, so distinct (token, slug) pairs accumulated forever. Low severity on its own — guard behavior was correct — but cheap to close. Both caches now key on (token_fingerprint, slug) where the fingerprint is a process-local HMAC-SHA256 from libs.attio.client.token_fingerprint. The key material is generated at process start and is not persisted; cache identities are never raw credentials. Per-workspace separation is preserved: distinct tokens receive distinct cache identities, so the schema of one workspace continues to never govern the writes of another. Both caches cap at 256 entries with FIFO eviction past the cap — probes carry no recency signal worth LRU tracking, and the cap exists to bound memory across workspaces, not to optimize hit rate. This composes with the #911 TTL entries: eviction swaps whole (value, expires_at) pairs, so a capped cache never serves an expired verdict as fresh, and the drift-shaped invalidation paths are untouched.
Last modified on October 5, 2026