Keep missing trace measurements separate from measured zero
Render latency, token and cost telemetry without making absent or truncated evidence look like a fast, free operation.
Design bounded structured diagnostics that preserve operation evidence while excluding credentials, private content and raw provider errors.
A diagnostic record should answer a narrow operational question: which stage failed, which action it concerned and what evidence remains unresolved. Starting with an entire request, provider error or transcript and hoping to filter it later creates a much larger disclosure surface than the incident requires.
Prefer an allowlisted structure with error category, operation phase, safe correlation identifiers and bounded timing fields. Keep content storage, financial records and diagnostic logs separate by purpose and access. Lupin’s error documentation specifically warns that registration and recovery responses can contain credentials, so logging every failed response body is unsafe even during troubleshooting.
The first durable log, console output or telemetry export is already a disclosure boundary. Apply redaction before writing or forwarding the value, not only when rendering a later user interface. A hidden field in the console can still exist in an exported file or third-party collector.
Lupin’s shared trace sanitizer runs before serialization and trace storage sanitizes again at its ingestion boundary. It removes known secret values and sensitive key patterns, masks common credential formats and bounds strings, arrays, depth and encoded size. These are useful layers, but they do not authorize producers to send arbitrary raw sensitive material.
Bearer tokens are obvious, while browser access links, session URLs, checkout links and query parameters can also grant access or expose private state. A URL-looking string should not automatically be treated as safe metadata. Preserve only the components needed for diagnostics, using the product’s own private-link handling where appropriate.
Raw provider errors can echo request headers, content or account data. Convert them into a small stable category and a private correlation reference. If an authorized operator needs the original evidence, use a controlled diagnostic path with a clear purpose instead of copying it into general logs or model context.
Lupin trace capture defaults to metadata with a short diagnostic retention window. Redacted capture can retain sanitized content, but it remains a separate deliberate setting under owner/admin controls. Resource grants and scoped keys do not automatically grant access to private conversation diagnostics.
Keep trace retention distinct from content retention and permanent usage history. Shortening diagnostic retention limits how long debugging evidence remains available; increasing it does not restore records already expired. Avoid promising that a content-expiry setting erases provider operation journals or every copy of an event in another system.
Use fake bearer strings, signed-looking URLs, nested objects, numeric codes and oversized arrays in local fixtures. Assert that sensitive values disappear before serialization while safe stage and operation fields remain useful. Add a test for an unexpected key name carrying a known secret to exercise value-based filtering.
Check the final encoded output, not only the sanitizer’s intermediate object. Also inspect truncation behavior so clipping cannot accidentally reveal a raw fallback value. Synthetic fixtures make these tests repeatable without importing actual customer messages, recordings, phone numbers or production credentials into the development environment.
Reviewed against the checked-in Lupin implementation and official reference documentation on 2026-11-05. Operational examples are illustrative; no live paid action, provider mutation or external message was executed.
Prepared with AI assistance by Lupin editorial. How we research and maintain these guides.