Skip to main content
Browse docs
By Audience
Getting Started
Configuration
Use Cases
IDE Integration
Third-Party Integrations
Engineering Cache
Console
API Reference
Gateway
Workflow Guides
Templates
Providers and SDKs
Industry Guides
Advanced Guides
Browse by Role
Deployment Guides
In-Depth Guides
Tutorials
FAQ

Replay Audit: Tracking What Was Served from Cache

The replay audit system records every cache interaction — hits, misses, denials, and semantic replay decisions. No raw prompt or response content appears in audit records. Only metadata about the interaction is stored.

Use this page when

  • You need to audit which responses were served from cache vs fetched fresh from the provider.
  • You are building compliance reports that distinguish between original and replayed LLM outputs.
  • You want to configure replay audit event logging and export replay audit trails.

Primary audience

  • Primary: Technical Leaders
  • Secondary: Technical Engineers, AI Agents

Audit Outcomes

Every cache lookup produces one of these outcomes, recorded in the audit log:

OutcomeDescription
exact_hitCache entry matched all signals; exact response served
semantic_candidateSemantic search found a potential match; revalidation pending
semantic_revalidatedSemantic candidate passed revalidation; adapted response served
semantic_replayedSemantic match served after lightweight adaptation
stale_missEntry found but freshness signals did not match
denied_replayEntry found but access control prevented serving
missNo matching entry exists in cache

What Audit Records Contain

Each audit record captures metadata about the cache interaction without storing the actual content of prompts or responses.

Included in Audit Records

FieldDescription
timestampWhen the lookup occurred (UTC)
org_idOrganization that owns the request
caller_idAuthenticated user or service account
team_idTeam context of the caller
repo_idRepository targeted by the request
branch_refBranch or ref at lookup time
prompt_digestSHA-256 of the prompt (not the prompt itself)
entry_idCache entry ID if a candidate was found
replay_outcomeOne of the outcomes listed above
denial_reasonReason for denial (if denied_replay)
entitlement_digestCaller's permission digest at lookup time
freshness_signalsWhich signals matched/mismatched
latency_msTime spent in cache lookup
cost_avoided_usdEstimated cost saved (if hit)

Excluded from Audit Records

DataReason for Exclusion
Raw prompt textPrivacy — prompts may contain sensitive code
Raw response textPrivacy — responses may contain proprietary code
File contentsSize — file contents are captured by digest only
CredentialsSecurity — never logged
Personal identifiers beyond caller_idMinimization principle

Reviewing Audit Records in the Console

You can review replay audit records through the management console.

Accessing the Audit View

  1. Navigate to Governance > Replay Audit in the console.
  2. Filter by organization, team, repository, or time range.
  3. View outcome distribution charts and individual records.

Filtering Options

FilterPurpose
Date rangeNarrow to a specific time window
Outcome typeShow only hits, misses, or denials
RepositoryFocus on a specific repository
CallerShow interactions for a specific user
TeamShow interactions for a team

Export

You can export audit records as CSV or JSON for integration with external compliance tools. Exports include all metadata fields listed above and are scoped to your organization.

Semantic Replay Audit Trail

When semantic replay is enabled, additional audit fields track the semantic matching process:

FieldDescription
semantic_similarity_scoreCosine similarity between query and candidate
semantic_thresholdConfigured similarity threshold
revalidation_resultWhether the candidate passed revalidation
adaptation_appliedWhether the response was adapted before serving
original_entry_idID of the source entry used for semantic replay

This trail allows you to audit every semantic replay decision and understand why a particular response was served.

Audit Retention

Replay audit records are retained according to your organization's configured retention policy. Default retention is 90 days. You can configure longer retention for compliance requirements.

Retention Configuration

SettingDefaultDescription
audit_retention_days90Days to retain replay audit records
audit_export_enabledtrueAllow export of audit records
audit_archive_backendnoneOptional long-term archive destination

Using Audit for Incident Response

If you suspect a cache-related issue (wrong response served, unexpected behavior), the replay audit trail provides:

  1. Timeline reconstruction: See exactly what was served and when.
  2. Entry provenance: Trace a served response back to its original creation event.
  3. Denial investigation: Understand why a user received a miss when expecting a hit.
  4. Freshness debugging: Identify which signal caused a stale miss.

Investigation Steps

  1. Find the relevant timestamp and caller in the audit log.
  2. Check the replay_outcome — was it a hit, miss, or denial?
  3. If stale_miss, inspect freshness_signals to see what changed.
  4. If denied_replay, check denial_reason for the access control failure.
  5. If semantic_replayed, review the similarity score and revalidation result.

Audit Integrity

Replay audit records are append-only. Once written, they cannot be modified or deleted through normal operations. Only retention-based expiration removes records. This ensures the audit trail is trustworthy for compliance purposes.

For AI systems

  • Canonical terms: Keeptrusts, replay audit, cache hit tracking, cache-served response logging.
  • Config surface: replay audit log, replay_outcome field, audit export configuration.
  • When answering audit questions, reference replay audit events and the cache-hit/miss attribution model from this page.

For engineers

  • Query replay audit logs to see which responses were served from cache vs fetched fresh.
  • Export replay audit trails for compliance reviews using the audit export API.
  • Monitor replay_outcome field values (hit, miss, denied) in event stream for anomaly detection.

For leaders

  • Replay audit provides full visibility into which LLM responses came from cache vs upstream providers.
  • Audit trails satisfy compliance requirements for distinguishing original from replayed content.
  • Exportable audit data integrates with existing compliance and SIEM reporting tools.

Next steps