Zero Labs
Industry News / AI

Your Traces Are Evidence: Retention, Legal Hold, and Discovery for Agent Logs

Source · Towards AI By Shrashti Singhal

From the publisher’s feed, collected in the ZeroLabs newsroom.

The flight recorder you built for debugging has a second reader. Retention policy, legal hold, and what not to write down.Image 01: The Second Reader- When Agent Traces Become Legal Evidence (Image by Author)The discovery request, in this composite drawn from several teams’ first encounters with litigation, was one sentence long: produce all records of automated decision-making concerning the plaintiff, including system logs, for the relevant period.The team’s first reaction was relief. They had the records — of course they had the records. This series had convinced them years earlier: trace everything, don’t sample, keep the full span tree, every prompt, every tool call, every model response. Forty million traces, searchable. If any company could reconstruct exactly what its agent did to one customer on one afternoon, it was them.The relief lasted until someone actually read the traces the way opposing counsel would. There was the agent’s chain-of-thought at step 14, candidly speculating: “the customer’s pattern suggests they may be attempting to exploit the refund window.” There was the quality judge’s verdict on the run, written by their own system: “2/5 — the agent failed to consider the customer’s stated hardship.” There was a behavior-flag rollout note showing the customer had been served the experimental bundle. Their flight recorder had documented, in fluent first-person prose, something that read exactly like a corporation forming an intent, acting on it, and grading itself as negligent — and every line of it was now going to a law firm whose job was to read it that way. Meanwhile the platform’s 90-day TTL had been quietly deleting adjacent traces for three weeks after the preservation letter arrived, because nobody had connected the legal-hold email to the retention config.The thesis of this article: a trace has two readers — the engineer you built it for, and the adversary the law will eventually hand it to — and a logging discipline designed for only the first reader is a liability dressed as an asset. Your traces are business records. They are discoverable, subpoenaable, holdable, and quotable aloud in depositions. That doesn’t mean stop tracing — regulation is busily making tracing mandatory — it means the flight recorder needs what every real flight recorder has: a retention policy someone chose on purpose, a chain of custody, and a design that assumes the tape will someday be played for a room of people who were not the pilot.This is the fifteenth article in the harness series, the second in its law-and-records arc. The previous piece engineered deletion — the deliberate removal of data. This one is its sibling and its tension: the deliberate keeping of data, on a schedule the law respects, in a form you can stand behind. (The standing caveat travels with us: engineering description of the legal landscape, not legal advice — your obligations are jurisdiction- and sector-specific, and counsel scopes them, not a Medium article.)Part 1: Why Agent Logs Are Records — Whether You Meant Them to BeThe traces this series taught you to keep are, without exaggeration, among the most complete business records any organization has ever produced. A classical audit log records that something happened: user 4471 was refunded, timestamp, actor. An agent trace records that — plus the entire deliberation: what the system was told, what it retrieved, what alternatives it weighed in visible reasoning, what it almost did, what its own supervisor thought of the result. Companies spent a century learning to be careful in memos and email; the agent stack produces something with the evidentiary density of a wiretap on the company’s own decision-making, generated at machine speed, retained by default.The law is arriving at this pile from two directions at once, and the squeeze between them is the design problem.From one side, regulation increasingly requires the logs to exist. The EU AI Act’s Article 12 mandates that high-risk AI systems “automatically record events over the lifetime of the system” at a traceability level fit for purpose; Articles 19 and 26 then require both providers and deployers to retain those logs for “at least six months” — a floor, not a ceiling, stretched further by sector rules and by any live dispute — with high-risk obligations phasing in through 2027–2028 and non-compliance priced at up to €15M or 3% of worldwide turnover. Deployers, note — the common assumption that logging is the vendor’s problem is specifically wrong. Sector regimes go further: financial-services recordkeeping rules (the SEC’s books-and-records regime and its WORM-storage tradition) treat certain communications as records that must be kept immutably for years. And the SEC’s off-channel communications sweep showed what happens when a channel escapes the record: over $2 billion in penalties across more than 100 firms since 2021 — JPMorgan’s $200 million opener, then wave after wave — for business conducted over WhatsApp where the recordkeeping system couldn’t see it. Read that sweep with agent eyes and a warning surfaces: an agent conducting business through channels your record system doesn’t capture — a side API, a vendor tool with its own logs, a sub-agent whose transcript nobody retains — is a new way to manufacture the same violation.From the other side, litigation makes whatever exists discoverable. The trigger is ordinary: a customer dispute, an employment claim, a regulator’s inquiry. A preservation duty attaches — often before any lawsuit is filed, the moment litigation is reasonably anticipated — and from that moment, the deletion machinery the last article built must stop for the covered material, provably. The doctrine has teeth, and the teeth have a famous recent demonstration we’ll return to: a company whose chat system auto-deleted by design, whose holds didn’t actually suspend the auto-deletion, and whose jury was eventually instructed to assume the destroyed evidence was unfavorable.Hold the two sides together and the shape of the problem is clear. You cannot solve discovery risk by not logging — the regulation floor, your debugging, your attribution, and your evals all forbid it, and selective non-logging during disputes is itself sanctionable. You cannot solve it by keeping everything forever — the deletion article spent five thousand words on why every retained byte is obligation. What remains is the only real option: retention as a designed system — deliberate scope, deliberate clocks, deliberate exceptions — instead of what most agent stacks have today, which is whatever the observability platform’s default TTL happens to be.Part 2: The Trace Through Legal Eyes — A StratigraphyBefore designing the system, read your own trace the way the second reader will. It has layers, and they carry different charges.The conversation layer is personal data wearing a transcript’s clothes — the deletion graph’s concern, and discovery’s starting point. Routine, in both directions.The action layer — tool calls, parameters, results, timestamps — is the closest thing to a classical audit log and usually your friend: it’s the layer that proves what actually happened, in order, with receipts. When your agent behaved correctly, this layer is the defense. This is also why its integrity matters most; more below.The reasoning layer is the dangerous stratum. Chain-of-thought is candid by design — we engineered it to explore, speculate, consider and reject. But juries and regulators read first-person prose as mental state. “The customer may be exploiting the refund window” was, mechanically, one hypothesis in a search process that discarded it two steps later; on a projector in a deposition, it’s the company calling the plaintiff a fraud. The models’ anthropomorphic register makes it worse — reasoning text sounds like an employee thinking, and courts have centuries of practice imputing employees’ thoughts to their employers. You built a system that narrates. The narration is evidence.The judgment layer is the stratum nobody anticipates. This series told you to wire LLM judges over production, score runs, log verdicts. Which means your system now generates contemporaneous written records criticizing its own conduct — “2/5, failed to consider stated hardship” — in exactly the form that, in human organizations, becomes the smoking-gun internal memo. The fix is emphatically not to stop judging (the alternative is not knowing); it’s to write rubrics knowing they’ll be read aloud: scores tied to defined operational criteria, not free-form moral commentary; “did not apply hardship policy HP-4” deposes very differently than “treated the customer unfairly.”And the provenance layer — bundle versions, model IDs, flag states stamped on every trace — cuts both ways: it’s how you authenticate and reconstruct (which config produced this?), and it’s how an adversary establishes that you changed behavior, when, and for whom. It’s still unambiguously worth having: in disputes, the party with the reliable timeline usually holds the better cards.Image 02: Two readers of the same trace (image by author)Part 3: The Retention System — Clocks, Tiers, and the Hold That Actually HoldsRetention is a policy you choose, execute, and can defend — the choosing matters less than the executing. The law generally does not punish reasonable retention schedules; it punishes ad-hoc ones, and it destroys litigants whose stated policies diverge from their actual behavior. A 90-day trace TTL, documented, applied uniformly, suspended properly under holds, is defensible almost everywhere (statutory floors permitting). The same TTL, adopted informally, applied unevenly, and left running during a dispute, is a sanctions motion writing itself. Whatever you choose: write it down, automate it, and make the automation auditable — the scheduled sweep with a log of what it deleted and under which policy version.Tier the record like the deletion article taught, because retention and erasure are one system. The full trace — every token, every screenshot — earns a short clock: it’s operationally precious for debugging and attribution for weeks, radioactive for years. The distilled record — the action layer, the decision, the policy applied, approvals, outcome — earns the long clock the regulation floor and your sector demand: it’s the business record proper, and it’s small, structured, and PII-governed. Aggregates earn forever. This tiering is the honest answer to the squeeze in Part 1: the layers an adversary can most easily weaponize (verbatim reasoning, raw conversations) are also the layers your own operations stop needing soonest — so the clocks can be short for cause, not for concealment. The distinction is everything: a short TTL adopted on a documented operational rationale, before any dispute, is hygiene; the same TTL adopted the week a preservation letter arrives is obstruction.The hold must beat the sweeper, and you must be able to prove it did. Here is the mechanism the deletion article sketched, load-bearing now: a legal hold is a first-class object — matter ID, scope (subjects, topics, date ranges, systems), owner, review date — and every deletion path checks it before deleting. Not “the privacy team emails engineering”; the TTL job queries the hold registry, the erasure sweep defers held subjects, and both log the deferral. Then — the step Google’s lesson makes non-optional — you test it: seed a synthetic trace, place a hold, watch the TTL arrive and bounce, keep the receipt. The canonical failure, per the DOJ’s allegations and Judge Donato’s courtroom in Epic v. Google, wasn’t the auto-delete policy itself — it was representing that a hold suspended auto-deletion when it hadn’t, leaving years of “history off” chats to evaporate mid-litigation. The jury was instructed it could presume the deleted messages were unfavorable; the verdict took under four hours. An adverse-inference instruction converts your missing evidence into your opponent’s best evidence. The hold that actually holds is cheap engineering; the one that only exists in email is how companies lose cases they might have won.Mind the vendor’s clocks, because their retention is your discovery surface. Your traces live in an observability platform with its own deletion mechanics and its own defaults; your model calls transit providers with their retention tiers; your users’ “deleted” data may persist under a provider’s court-ordered hold, as the previous article’s OpenAI saga demonstrated at scale. Map it: for every third party in the trace path — platform, model provider, MCP tool vendors — know what they keep, for how long, under whose control, and what happens when a subpoena reaches them instead of you. Zero-retention tiers and self-hosting are the strong moves where stakes warrant; a written answer to “who else holds our records?” is the minimum.Image 03: The retention system (image by author)Part 4: Advanced — Privilege, the Deposition Test, and Records You Can Stand BehindPrivilege is genuinely unsettled, so architect for the split. Two American decisions a week apart in February 2026 read the question opposite ways: one court protected a litigant’s ChatGPT drafting materials as work product — the AI as an instrument of the person, not a third party whose presence waives protection; another held that conversations with a chatbot were neither attorney-client communications nor confidential at all, given the provider’s data practices. Between those poles sits every enterprise whose agents touch legal-adjacent work. The engineering response isn’t to predict the doctrine; it’s to stop commingling: runs performed at counsel’s direction get segregated projects, access controls, and distinct retention — so that if privilege attaches you haven’t waived it by pooling the traces with everything else, and if it doesn’t you haven’t contaminated the ordinary stores with material you believed was protected. Privilege is partly an architecture question now, and almost nobody’s architecture has an answer.Write for the second reader — without writing less truth. Call it the deposition test: every string your harness composes — judge rubrics, error messages, compaction prompts, flag names — gets one extra question at review time: how does this read aloud, out of context, to a jury? “Bundle: aggressive-collections-v2” fails the test; the identical behavior under “collections-policy-CP-7” passes, because one is a label and the other is an editorial. Reasoning traces deserve prompt-level care: instruct agents to reason about cases against criteria (“does this match the exploit pattern defined in policy?”) rather than about persons and motives (“is this customer a fraudster?”) — which, pleasingly, is also just better tool-shaped thinking. What the deposition test must never become is instruction to obscure: telling agents or humans to avoid creating records, phrase around wrongdoing, or take it off the log is the “communicate with care” culture that courts read as consciousness of guilt — the record of you managing the record is itself discoverable, and it’s the worst exhibit of all. The line is bright: shape records to be precise; never shape them to be absent.Integrity is what makes your traces evidence for you. A trace only helps you if you can authenticate it — show it’s complete, unaltered, and produced by the system it claims. That’s an engineering deliverable: append-only or WORM storage for the distilled record tier (the financial-services pattern, now cheap on any cloud); hash-chained or signed trace batches so tampering is detectable; clock discipline (the temporal article pays off in court, of all places); and documented pipeline provenance — which collector, which redaction pass, which policy version. Courts are simultaneously raising the authentication bar for AI-generated material generally (the deepfake problem is dragging evidence rules toward provenance-consciousness), which cuts in your favor if you’re the party whose logs carry receipts. In disputes between a party with signed, immutable, timestamped records and a party with a mutable database and good intentions, the first party’s story tends to become the story.Production is a capability, and you find out whether you have it under a deadline. Discovery doesn’t ask whether you kept the records; it asks you to produce them — scoped to a subject and a date range, in reviewable form, on a schedule a court set without consulting your infrastructure team. That’s an export path, and it has requirements your trace UI doesn’t: structure preserved (a span tree flattened to CSV loses the who-called-what that makes it evidence), provenance attached (which system, which redaction pass, which policy version), redaction for production (privileged material and third parties’ personal data filtered — the deletion article’s subject keys, reused for extraction instead of erasure), and volume handling (forty million traces don’t attach to an email). Teams that first attempt this during live litigation pay motion-practice prices for engineering work; teams that have run one practice export — pick a synthetic matter, produce it end to end, time it — pay a sprint. The asymmetry from the omission article applies: nothing in your system will tell you the export path is missing until the day it’s demanded.And govern who reads, because access is disclosure. Discovery hands traces to outsiders under protective orders; meanwhile your own trace UI may be handing them to half the company with no order at all. The flight-recorder article’s redact-at-ingest advice was security hygiene; it’s now also evidence hygiene: PII masked before storage, reasoning layers visible by role, exports logged. The trace platform is a records system; give it a records system’s door.Animation: The hold must beat the sweeperPart 5: Case StudiesThe chats that testified by their absence. Google’s “history off” era is the canonical spoliation story of the decade: sensitive discussions steered to auto-deleting chats; litigation holds that — per the DOJ — were represented as suspending deletion while employees’ chats kept vanishing on a 24-hour clock; and in Epic v. Google, a judge who put the question to the jury with an instruction to presume the missing evidence unfavorable. Every element has an agent-stack analog: the auto-deleting channel (your TTLs), the hold that didn’t propagate (your retention config), the steering of sensitive topics off the record (your redaction and logging choices, if made for the wrong reasons at the wrong time). The lesson isn’t “never delete” — it’s that the gap between stated policy and actual behavior is the thing courts punish hardest.The sweep that priced a missing channel. The SEC’s off-channel campaign — $2B+, 100+ firms — established that in regulated sectors, failure to record is a standalone violation needing no underlying misconduct. The agent translation is direct: inventory every channel through which your agents conduct regulable business — every provider, every tool, every sub-agent seam — and confirm each one lands in the record system. “The vendor’s API had logs, but we never ingested them” is the new “it was on the trader’s personal phone.”The twenty million conversations. The previous article told the NYT v. OpenAI story as a deletion problem; told as a records problem, the moral inverts: a third party held the logs, a court reached them, and 20 million de-identified conversations went into a litigation review environment over objections that de-identification can’t survive free text. Your users’ interactions with your agent are, to some future litigant, exactly this corpus. Design the trace path knowing every party that holds it extends the surface a court can reach.The deposition test, failed and passed. The cold open’s team, remediated: judge rubrics rewritten against enumerated policy criteria; reasoning prompts steered from motive-speculation to pattern-matching against defined rules; the hold registry wired into both TTL jobs and the erasure sweep, with a quarterly synthetic-hold drill; trace tiers split — full traces 60 days, distilled decision records seven years, WORM. In the actual litigation, the surviving action-layer records showed the agent had applied the refund policy correctly — and could be authenticated. The case settled on terms the team’s counsel attributed, in part, to the other side reading the timeline and folding. The same flight recorder, run through a records discipline, had switched sides.Part 6: The LandscapeBuild: the retention policy document and its enforcing automation; trace tiering (full/distilled/aggregate) with per-tier clocks; the hold registry gating every deletion path, drill included; the deposition-test review habit for harness-authored strings; WORM + hashing for the record tier; the third-party retention map; role-based trace access with logged exports.Lean on: trace platforms’ retention and deletion APIs (the tools exist — your job is connecting them to policy); cloud object-lock/WORM storage; e-discovery platforms for the production side (they speak legal; your job is an export path that preserves structure and provenance); provider enterprise tiers with contractual retention terms; counsel, early — the retention schedule is a joint deliverable, and the version co-signed by legal is worth double.My advice on choosing: start with the hold registry, because it’s the piece whose absence is catastrophic and whose cost is a table and two if statements. Then the tier split with real clocks — it forces the conversation about what your record is. The deposition-test lint on rubrics and labels is an afternoon of grep and a standing review question. WORM and signing come when stakes or sector demand. The third-party map is a document sprint, and it's the one most teams have literally never done.The whole idea in miniature:def write_trace(run, spans): spans = redact_at_ingest(spans) # PII masked before storage store.append(FULL_TIER, spans, ttl=days(60)) # debugging window, short for cause record = distill(spans) # actions, policy refs, approvals, outcome worm.append(RECORD_TIER, sign(record), ttl=years(7)) # the business record: immutable, provable metrics.update(aggregate(spans)) # forever, and anonymousdef sweep(candidates): # every deletion path, same gate for item in candidates: if holds.covering(item): # the hold beats the sweeper log.defer(item, hold=holds.covering(item)) # ...provably else: delete(item); log.deleted(item, policy=POLICY_VERSION) # quarterly: seed a synthetic trace, hold it, verify the TTL bounces. keep the receipt.Part 7: The Failure Modes Field GuideThe candid chain-of-thought. Speculation about a person’s motives, logged as first-person prose, read as corporate intent. Cure: reason against defined criteria, not characters; deposition-test the prompts.The self-incriminating judge. Your quality system writes “2/5, unfair to customer” into a permanent record. Cure: rubrics scored against enumerated operational criteria; keep judging, change the vocabulary.The policy nobody follows. A written 90-day TTL, actually applied sometimes, to some stores. Cure: automated, logged, uniform enforcement — the gap between stated and actual is the sanctionable part.The hold that didn’t stop the sweeper. Preservation notice sent; TTLs kept running. Cure: holds as registry objects checked by every deletion path; quarterly synthetic-hold drill.The off-channel agent. Business conducted via a tool or provider whose logs never reach your record system. Cure: channel inventory; every seam ingested or contractually covered.The unsearchable archive. You kept everything and can produce nothing by deadline. Cure: the distilled tier is structured and queryable; test an export before a court demands one.The unauthenticatable log. Your exculpatory trace is a mutable database row anyone could have edited. Cure: WORM record tier, hash chains, provenance metadata — evidence needs receipts.The over-hold. One cautious hold, unscoped, freezes all deletion forever and quietly rebuilds the liability pile. Cure: matter-scoped holds with owners and sunset reviews.The record about the record. Instructions to keep things off the log, discovered. Cure: never write them; shape records for precision, never for absence.Part 8: How to Start — A One-Week PlanDay 1. Read ten of your own production traces as opposing counsel. Bring a highlighter for every line you’d hate to hear read aloud. This exercise recruits every stakeholder you’ll need for the rest of the week.Day 2. Draft the retention schedule: what exists, its tier, its clock, its statutory floor. Book the counsel review — the schedule matters less than its existence and its co-signature.Day 3. Build the hold registry — a table, an API, and the if statement in every deletion path, the erasure sweep included. Wire the deferral log.Day 4. Run the first hold drill: synthetic trace, hold, TTL arrival, bounce, receipt. If it fails, you’ve just had your cheapest possible spoliation incident.Day 5. Deposition-test the harness’s authored strings — judge rubrics, flag names, error copy. Rewrite the editorials into policy references.The weekend. Draw the third-party map: every vendor holding trace-path data, their clocks, their hold posture, their subpoena story. Send the three emails the map reveals you need to send.Conclusion: The Transparency Camp and the Minimalist CampOne camp holds that the complete record is the best defense — that agents whose every step is logged, judged, and versioned are the most accountable systems ever built, and the org that can replay any decision with receipts wins disputes, audits, and its own engineering arguments. Log everything; sunlight is the strategy.The other camp has read more depositions. Every byte is a potential exhibit; prose you didn’t need is risk you chose; and the wisest records regime is the one that keeps exactly what the law and the operations require, distilled, and not a token more. Write less down; what doesn’t exist can’t be quoted.Both camps are right about the failure of the other. The synthesis this article has been building: keep complete records of what happened; be deliberate about records of what was felt — and let every clock, every tier, and every exception be something you chose in daylight, before anyone was angry. The action layer, distilled, immutable, long-lived: that’s the record that acquits correct systems. The speculation, the verbatim wandering, the anthropomorphic narration: operationally short-lived, for documented reasons, uniformly enforced. A trace discipline like that serves both readers — the engineer gets the flight recorder, the second reader gets a record you’re not afraid of — and it converts the question every team eventually faces from “what will they find?” to “here is what we keep, here is why, and here is the proof it’s true.”Your agent is already testifying. This week decides whether it’s a good witness.Next in the series: the tools, skills, and servers your agent trusts were written by strangers — The Agent Supply Chain: Provenance for Skills, Tools, and Servers.Your Traces Are Evidence: Retention, Legal Hold, and Discovery for Agent Logs was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.