Design a Tamper-Evident Audit Log for Every AI Interaction

Last updated: November 29, 2026

Quick Overview

Design the system that records every prompt, retrieved source, model response, and user action in an AI legal assistant so that firm administrators can search, export, and prove the record has not been altered, while respecting retention and deletion rules.

Harvey
System Design
Software Engineer
Harvey
November 29, 2026
Software Engineer
System Design Round
System Design
Medium

0

0

0 solved


Design the system that records every prompt, retrieved source, model response, and user action in an AI legal assistant so that firm administrators can search, export, and prove the record has not been altered, while respecting retention and deletion rules.

Law firms and their clients demand strong controls over privileged data, and Harvey's enterprise customers expect audit trails, retention settings, and exports for their compliance teams. The interviewer is checking that you capture events reliably off the hot path, make the log tamper evident, and reconcile immutability with deletion obligations.

What the Interviewer Expects
  • Define the event schema: actor, tenant, matter, action, inputs, sources, outputs, model, timestamps
  • Capture events asynchronously without losing them
  • Make the log append-only and tamper evident with hash chaining
  • Support admin search and export with tenant isolation
  • Reconcile retention and deletion with immutability
  • Size the storage and plan tiering
Key Topics to Cover
audit logging
append-only storage
hash chaining
retention
event pipelines
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • How do you delete a matter's content after its retention period while keeping the chain verifiable?
  • How would an auditor verify an export independently?
  • What do you do if the event pipeline is backed up during a peak?
  • Should the log store full prompts, or references, and why?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Functional: record every interaction and admin action, search by user, matter, date, and text, export in a standard format, configurable retention per tenant. Non-functional: no lost events, under 2 m...

High-Level Design

Application services emit events to a local durable buffer (an outbox table or local disk queue), which ships them to a per-region Kafka topic partitioned by tenant. An audit writer consumes, ...


Submit Your Answer
Markdown supported

Related Questions