One night my assistant threw out 41,212 emails. Vendor newsletters, flash sales, shipping notices, and a gravel-supply digest that had shown up every Tuesday since 2019 and that nobody in this office has ever opened. Not once. By morning the inbox was down to 2,906 messages and I could breathe again.
It didn’t permanently delete a thing. It couldn’t. The key it held could move messages to Trash and couldn’t permanently delete a single one.
That mattered by lunch, because 63 of those 41,212 weren’t junk. They were from a title company, and every one had the word “sale” in the subject line, because that’s what title companies talk about all day. The cleanup rule said anything with “sale” in the subject from a sender I’d never replied to was a promotion. Dumb rule. Zero damage. I put all 63 back in about four minutes, from a log the assistant wrote before it moved the first message.
Here’s the rule I took from that night. Every action an agent takes should be undoable by default. Trash, never delete. A new versioned file, never an overwrite. An undo log written before the action, saying what moved and how to put it back. The handful of actions you can’t undo (send, file, pay, permanently delete) are exactly the ones that need a person to say yes.
Every incident in this essay is an invented composite. The rules, the quotations and the code output are real.
Trash and delete are two different powers, and the vendors know it
Most people think of “delete” as one button. It’s two. One moves a thing somewhere you can get it back. The other makes it gone. The better vendors split them so cleanly you can hand somebody the first button and keep the second in your pocket.
Google’s Gmail help page describes the first button in one line:
When you delete a message in Gmail, it’s moved to Trash.
Up to 30 days after deletion, the same page says, “You can recover the message from your trash and move it back to your inbox.” After 30 days: “The message is permanently deleted.” and “You can’t recover the message.”
Now go down a floor, to the developer docs your agent’s code actually calls. Gmail’s API has a method called users.messages.trash. Its description is one line: “Moves the specified message to the trash.” Right next to it sits users.messages.delete, and Google wrote its description like a warning label:
Immediately and permanently deletes the specified message. This operation cannot be undone. Prefer messages.trash instead.
Prefer trash. That’s the vendor talking, about its own product. When the people who built the button tell you to use a different one, take the hint.
And here’s the part that makes the whole thing work. The two methods want different keys. The trash method accepts either the full mail scope or gmail.modify. The delete method requires the full scope, https://mail.google.com/, and nothing else will do. And Google’s scope table describes gmail.modify in exactly the terms you’d want:
Read, compose, and send emails from your Gmail account. This scope does not allow immediate, permanent deletion of threads and messages, bypassing the trash.
So my overnight cleaner ran on a key that Google’s own servers won’t let skip the trash for a message. No rule I wrote. No promise from the model. The server says no. That’s why 41,212 messages could move in one night and the worst case was a four-minute restore.
Now read that scope description again. There’s a catch in the first sentence. Read, compose, and send. The key that can’t permanently delete a message can still send. A trash-only key is a delete gate, and that’s all it is. The send gate has to live somewhere else, and in this office it does: the agent drafts and the human sends. Which keys an automation should hold at all is its own audit. The question here is smaller: what does the agent do with the keys it’s supposed to have?
And that help page holds a trap I’d never have guessed. Right at the top, flagged “Important”:
Important: When you delete a draft, you can’t recover it from Trash.
So in Gmail, “trash” isn’t a promise for everything. A draft goes straight to gone. The API matches: users.drafts.delete “Immediately and permanently deletes the specified draft. Does not simply trash it.” and it accepts gmail.modify, the same key that can’t skip the trash for a message. If your assistant stages letters as drafts (mine does), a cleanup pass that sweeps drafts isn’t doing anything undoable at all. That’s a permanent delete in a trash can’s clothes. My cleaner doesn’t touch the Drafts folder. Period.
Every trash can is a countdown
Trash is a timer with a lid on it.
Gmail’s timer, per that help page, is 30 days. Microsoft’s comes in layers, because of course it does. Its Exchange Online documentation says items deleted from Deleted Items land in a hidden Recoverable Items folder, and then:
The default deleted item retention period for Exchange Online is 14 days. You can modify this period for mailboxes up to a maximum of 30 days.
And: “When the deleted item retention period expires, the item is removed from Exchange Online.” Same page, on what changes that: “Putting a mailbox on In-Place Hold or Litigation Hold stops the Managed Folder Assistant from automatically purging messages from the DiscoveryHolds, Deletions, and Purges subfolders.”
So an undo has an expiration date, and the date depends on which vendor’s can you threw it in. I learned that one the slow way. One spring an agent tidied a shared scans folder. The instruction was “move PDFs nobody’s opened in two years to the trash”. Sounds reasonable. I’d have said it myself. It moved 1,906 files. Most were junk: duplicate scans, a cat named Biscotti photographed on the copier glass more times than I’d like to admit, cover sheets. Forty-one of them were monthly trust account reconciliations and check registers, saved as PDFs, years old, untouched since the day they were made. Untouched is exactly what a retention record is supposed to be. Nobody had opened them in two years because nobody’s supposed to.
We found them on day 26 of that folder’s 30-day trash window. Four days to spare. The fix took ten minutes. The finding took 26 days, because nothing about a quiet trash can tells you it’s holding something you need.
So now every cleanup’s undo log carries the date the trash will empty itself, and that date goes on my calendar the hour the cleanup runs. A restore you can do on day 31 isn’t a restore. It’s a wish.
The law already has an opinion about your trash can
I’d care about all this if I ran a bakery. A lawyer gets three more reasons, free of charge.
Preservation. Fed. R. Civ. P. 37(e) is the federal rule on lost electronically stored information, and the trigger deserves a slow read:
If electronically stored information that should have been preserved in the anticipation or conduct of litigation is lost because a party failed to take reasonable steps to preserve it, and it cannot be restored or replaced through additional discovery, the court:
Then it lists what the court can do. On a finding of prejudice, it “may order measures no greater than necessary to cure the prejudice”. The heavy stuff (presuming the lost information was unfavorable, an adverse-inference instruction, dismissal or default) comes “only upon finding that the party acted with the intent to deprive another party of the information’s use in the litigation”. Minnesota’s Rule 37.05 tracks it nearly word for word.
Look at the phrase “cannot be restored or replaced”. A message sitting in Trash on day 12 hasn’t been lost in any sense I’d want to stand up and argue about. It can be restored. By anybody. In four minutes. The Minnesota committee comment to the 2018 amendment describes what restoring or replacing might look like: “This might be accomplished by locating alternate copies of the information, or reconstructing backed up copies.” An undo log is a map to exactly that.
The 2015 federal advisory committee note is the one I’d tape to the monitor of anybody building a cleanup agent. On what “reasonable steps” means:
As under the current rule, the routine, good-faith operation of an electronic information system would be a relevant factor for the court to consider in evaluating whether a party failed to take reasonable steps to preserve lost information, although the prospect of litigation may call for reasonable steps to preserve information by intervening in that routine operation.
Intervening in that routine operation. A nightly cleanup agent is a routine operation. So is Gmail’s 30-day purge, and Exchange’s 14-day default one. When a duty to preserve kicks in, the note’s point is that somebody may have to reach in and stop the routine. Microsoft’s litigation hold, by its own description, does exactly that for the purge. You can’t reach in and stop a permanent delete. It’s over before you hear about it. You can reach into a trash can that has a log, a date and a hold rule.
And the note doesn’t ask for perfection. It says flat out that the rule “does not call for perfection.” It also says a party “may act reasonably by choosing a less costly form of information preservation, if it is substantially as effective as more costly forms.” A trash-only key costs nothing. I can’t think of a cheaper form of preservation than not destroying things in the first place.
That’s my reading of how these pieces fit. The note doesn’t mention AI agents. I’d still rather my cleanup agent never be the routine operation somebody forgot to stop.
Destroying evidence. Minn. R. Prof. Conduct 3.4(a) says a lawyer shall not:
(a) unlawfully obstruct another party’s access to evidence or unlawfully alter, destroy, or conceal a document or other material having potential evidentiary value. A lawyer shall not counsel or assist another person to do any such act;
Notice the word “unlawfully”. It’s in there twice. The rule doesn’t make every deleted newsletter a disciplinary matter. What it does is name a category, “a document or other material having potential evidentiary value”, and as I read it, protecting that category on purpose means your cleanup tools need a way to leave it alone. Comment [2] puts the stakes in one sentence: “The exercise of that right can be frustrated if relevant material is altered, concealed or destroyed.”
So every cleanup in this office respects a hold marker. A folder or a mail label carrying the hold flag is skipped. Not trashed, not moved, not touched. The script below does it with a file named .hold. Crude. It works.
Trust records. This is the one that scared me in the scans-folder story. Minn. R. Prof. Conduct 1.15(h) requires a lawyer in private practice to keep “books and records sufficient to demonstrate income derived from, and expenses related to, the lawyer’s private practice of law,” and to establish compliance with paragraphs (a) through (f), the rule’s trust-account and client-property provisions, and it sets a clock:
The books and records shall be preserved for at least six years following the end of the taxable year to which they relate or, as to books and records relating to funds or property of clients or third persons, for at least six years after completion of the employment to which they relate.
Six years. Appendix 1, the Lawyers Board’s list of what those books and records are, has a paragraph titled “Electronic Record Retention”. It says a lawyer who keeps trust records by computer “must print and retain, on a monthly basis, the check register, the trial balance of the subsidiary ledgers, and the reconciliation report”, or keep them “in a PDF form on an electronic device separate from the one on which these materials were created.” And then:
Electronic records, both those maintained contemporaneously and those retained in a PDF form, should be regularly backed up by an appropriate storage device.
Those are exactly the PDFs my scans-folder agent swept up. Old, unopened, boring, and required. An agent holding a permanent-delete key on that folder is one bad pattern away from a six-year retention problem that no restore can fix.
The client’s file isn’t yours to overwrite
The other half of “undoable by default” is the file you didn’t delete. You wrote over it.
This one still makes me wince. A drafting agent was told to “clean up the formatting” on a settlement agreement. It did. It opened the Word file, fixed the styles, normalized the numbering and saved, right on top of the version the lawyer had redlined by hand at 11 p.m. the night before. Same file name. Same folder. The formatting was beautiful. The lawyer’s 14 edits were gone.
We got them back from the cloud service’s version history, eventually, by opening three prior versions and comparing them by eye. That took two hours, on a document that should have taken zero, because the rule should have been the one we use now: an agent never writes over a file a person has edited. It writes a new file with a new version number, next to the old one. Version 3 doesn’t replace version 2. It sits beside it. If version 3 is wrong, you delete version 3, and version 2 is right where you left it.
The ethics rules give a lawyer one more reason. Rule 1.16(d) says that on termination a lawyer “shall take steps to the extent reasonably practicable to protect a client’s interests,” including “surrendering papers and property to which the client is entitled”. Rule 1.16(e) says what those papers include, “whether stored electronically or otherwise”. In a litigation matter, that list includes:
(i) all pleadings, motions, discovery, memoranda, correspondence and other litigation materials which have been drafted and served or filed, regardless of whether the client has paid the lawyer for drafting and serving the document(s), …
Drafted and served or filed. Picture the served version of a document sitting in a folder, and an agent “improving” it in place a month later. As I read (e)(2)(i), the file the client’s entitled to is the one that went out. The file you have now is something else wearing its name. A new versioned file keeps the served one intact. An overwrite turns your client’s file into a document that never existed on the day it mattered.
Write the undo log before you touch anything
A cleanup is undoable when you do it in this order, and the order is the whole trick:
- Write down what you’re about to move, where it’s going, and a fingerprint of its contents. Flush that to disk.
- Move it.
- Write down that it moved.
Everybody gets this backward. They move the files, then write a nice summary of what they moved. If the power blinks between those two steps, you’ve got files in the trash and no record of where they came from. Write the log first and a crash leaves a line that says “about to move this, from here, to there”. That line is enough to put it back.
Here’s the script. Python 3, standard library only, about 120 lines. It never deletes anything. It moves matching files into a dated trash folder, refuses to touch any folder holding a .hold file, writes the undo log before each move, and restores from the log, checking each file’s fingerprint before it moves anything back.
#!/usr/bin/env python3
"""trashcan.py - clean a folder by moving files into a trash folder. Never deletes.
trashcan.py clean FOLDER TRASH PATTERN [PATTERN ...]
trashcan.py restore UNDO_LOG
Each file's line goes into the undo log, flushed to disk, BEFORE the file moves.
A folder holding a file named .hold is never touched, nor is anything under it.
Exit 0: done. Exit 1: finished, but refused or failed on something. Exit 2: could not run.
"""
import fnmatch, hashlib, json, os, sys, time
from pathlib import Path
def sha256(p):
h = hashlib.sha256()
with open(p, "rb") as f:
for block in iter(lambda: f.read(1 << 16), b""):
h.update(block)
return h.hexdigest()
def save(log, entries):
tmp = log.with_suffix(".tmp")
with open(tmp, "w") as f:
json.dump(entries, f, indent=1)
f.flush()
os.fsync(f.fileno())
os.replace(tmp, log) # the log on disk is always a whole file, never half of one
def on_hold(path, top):
d = path.parent
while True:
if (d / ".hold").exists():
return True
if d == top:
return False
d = d.parent
def clean(folder, trash, patterns):
folder, trash = Path(folder).resolve(), Path(trash).resolve()
if not folder.is_dir():
print(f"FATAL: {folder} is not a folder"); return 2
if trash == folder or folder in trash.parents:
print("FATAL: the trash can't live inside the folder being cleaned"); return 2
run = time.strftime("%Y%m%d-%H%M%S")
can = trash / run
can.mkdir(parents=True)
log = trash / f"undo-{run}.json"
entries, held, failed = [], 0, 0
save(log, entries)
for p in sorted(folder.rglob("*")):
rel = p.relative_to(folder).as_posix()
if not p.is_file() or p.name == ".hold":
continue
if not any(fnmatch.fnmatch(rel, pat) for pat in patterns):
continue
if on_hold(p, folder):
print(f"HOLD {rel}"); held += 1; continue
dest = can / rel
e = {"rel": rel, "from": str(p), "to": str(dest), "sha256": sha256(p),
"bytes": p.stat().st_size, "state": "planned"}
entries.append(e)
save(log, entries) # 1. write down what's about to happen
dest.parent.mkdir(parents=True, exist_ok=True)
try:
os.rename(p, dest) # 2. do it: one rename, same disk, nothing copied
e["state"] = "moved"
print(f"TRASHED {rel}")
except OSError as err:
e["state"] = f"failed: {err.strerror}"; failed += 1
print(f"FAILED {rel}: {err.strerror}")
save(log, entries) # 3. write down what actually happened
moved = sum(e["state"] == "moved" for e in entries)
print(f"moved {moved}, held {held}, failed {failed}; undo log {log.name}")
return 1 if failed else 0
def restore(logfile):
log = Path(logfile)
try:
entries = json.loads(log.read_text())
except (OSError, ValueError) as err:
print(f"FATAL: can't read the undo log ({err})"); return 2
back = refused = 0
for e in entries:
src, dst, rel = Path(e["to"]), Path(e["from"]), e["rel"]
if e["state"] == "restored":
print(f"DONE {rel}: restored on an earlier run"); continue
if not src.exists():
if e["state"] == "moved":
print(f"MISSING {rel}: gone from the trash"); refused += 1
else:
print(f"SKIP {rel}: never moved ({e['state']})")
continue
if sha256(src) != e["sha256"]:
print(f"CHANGED {rel}: the trash copy doesn't match the log"); refused += 1; continue
if dst.exists():
print(f"CONFLICT {rel}: a new file sits at the old path; left both alone"); refused += 1; continue
try:
dst.parent.mkdir(parents=True, exist_ok=True)
os.rename(src, dst)
except OSError as err:
print(f"FAILED {rel}: {err.strerror}"); refused += 1; continue
e["state"] = "restored"; back += 1
print(f"RESTORED {rel}")
save(log, entries)
print(f"restored {back}, refused {refused}")
return 1 if refused else 0
if __name__ == "__main__":
a = sys.argv[1:]
if len(a) >= 4 and a[0] == "clean":
sys.exit(clean(a[1], a[2], a[3:]))
if len(a) == 2 and a[0] == "restore":
sys.exit(restore(a[1]))
print(__doc__); sys.exit(2)
I ran it under Python 3.9.6 on macOS against an invented mailbox export: three pickle-fork promotions, one issue of the gravel digest, and one message in a disputes folder about a fence line, with a .hold file sitting next to it. I made the newsletters folder read-only, so the cleaner wouldn’t be allowed to change it. The cleanup rule is deliberately as dumb as the one from my overnight run: anything in promos, anything in newsletters, and anything with “sale” in the name. True output:
$ python3 -I trashcan.py clean inbox trash promos/\* newsletters/\* \*sale\*
HOLD disputes/re-fence-line-sale.eml
FAILED newsletters/gravel-digest-088.eml: Permission denied
TRASHED promos/picklefork-sale-0001.eml
TRASHED promos/picklefork-sale-0002.eml
TRASHED promos/picklefork-sale-0003.eml
moved 3, held 1, failed 1; undo log undo-20261122-081820.json
exit 1
Look at the first line. The fence-line message matched *sale* (the file name says “sale”, because the client won’t sell), and it’s exactly the kind of message my overnight rule swept up 63 times. The hold marker said no, and the file stayed put. Then the failure: the cleaner couldn’t move a file out of a folder it wasn’t allowed to change, so it said so, by name, and exited 1. A cleanup that fails on one file and reports “done” is the failure that says nothing. This one doesn’t get to.
Here’s the first entry in the undo log as it reads after the run. It went to disk marked “planned” before the cleaner tried to move anything, and was rewritten to say what actually happened. (I’ve shortened the scratch folder’s path to /demo. Nothing else is changed.)
{
"rel": "newsletters/gravel-digest-088.eml",
"from": "/demo/inbox/newsletters/gravel-digest-088.eml",
"to": "/demo/trash/20261122-081820/newsletters/gravel-digest-088.eml",
"sha256": "affa98f8891c14c202b00d34bd9f324b32e3e532b6dbe4e22a2947d5e5c3c008",
"bytes": 35,
"state": "failed: Permission denied"
},
Then I broke two things on purpose, the two that actually happen between a cleanup and a restore. Somebody saved a brand-new file under the same name as one in the trash. And somebody edited a file while it sat in the trash. Then I ran the restore. True output:
$ python3 -I trashcan.py restore trash/undo-20261122-081820.json
SKIP newsletters/gravel-digest-088.eml: never moved (failed: Permission denied)
RESTORED promos/picklefork-sale-0001.eml
CHANGED promos/picklefork-sale-0002.eml: the trash copy doesn't match the log
CONFLICT promos/picklefork-sale-0003.eml: a new file sits at the old path; left both alone
restored 1, refused 2
exit 1
It put back the one file it could prove was the file it took. It refused the one whose contents had changed, because “restore” means putting back what you took, not whatever’s sitting in the trash under that name. And it refused to overwrite the new file at the old path. A restore that overwrites is just another overwrite. Then it exited 1, so nobody reads “restored” and walks away. Nothing got lost. The listing afterward shows the two refused files still sitting in the trash, waiting for a person:
$ find inbox trash -type f -name \*.eml
inbox/newsletters/gravel-digest-088.eml
inbox/disputes/re-fence-line-sale.eml
inbox/promos/picklefork-sale-0003.eml
inbox/promos/picklefork-sale-0001.eml
trash/20261122-081820/promos/picklefork-sale-0002.eml
trash/20261122-081820/promos/picklefork-sale-0003.eml
exit 0
I ran four more cases against it in a separate test file. A trash folder inside the folder being cleaned gets refused with exit 2. A crash right after the first move, before the log could say “moved”, still leaves a “planned” line, and the restore uses it to put the file back. A second restore on the same log reports the file as done and touches nothing. A corrupt log gets exit 2, never a clean-looking zero.
Now, what a clean run of this thing does not prove. It does nothing about a cloud trash can’s 30-day clock or anybody else’s; this script’s trash never empties, and a real one does. It moves files with a plain rename and never copies, so the trash has to sit on the same disk as the folder. The .hold check is one file name; misspell it and the folder’s fair game. It doesn’t protect against a person or another program deleting the trash folder itself, or the log, and if the log goes the map goes with it. It doesn’t read file contents, so a pattern like *sale* is as dumb here as it was in my mailbox. It doesn’t know what a duty to preserve is. And it doesn’t stop an agent that holds a delete key from using it. This script is the trash can. Taking the delete key away is a different job, done somewhere else.
Where the human yes goes
So who gets asked, and about what?
I’ve argued before that asking permission for a cheap, internal, undoable write is the bug. Undoable-by-default is the same idea from the other end. Once moving a thing to the trash is cheap and logged and reversible for 30 days, there’s no reason to ask about it. The agent does it and tells me after.
The yes belongs on the actions you can’t take back:
| Action | Can you undo it? | Who decides |
|---|---|---|
| Move to Trash, with an undo log | Yes, until the trash empties | The agent, then a report |
| Write a new versioned file | Yes, delete the new version | The agent |
| Overwrite a file a person edited | Only from version history, if it exists | Nobody. The agent writes a new version instead. |
| Send an email | No | A person |
| File with a court | No | A person |
| Move money | Not cheaply | A person |
| Permanently delete, including emptying the trash | No | A person, after the hold check |
The last row is the one people miss. Emptying the trash is a permanent delete. An agent that can’t call the delete method but drives a browser that can click “Empty Trash now” has the delete key with extra steps. In this office the trash empties two ways: on the vendor’s own clock, or when I say so, after a check that nothing in it carries a hold. My cleaner moved 41,212 messages without asking me a thing. Emptying that trash early would’ve taken my yes. I never gave it. Thirty days costs nothing.
The best case against all this
Here’s the argument against me, at full strength.
Trash is just deferred deletion. Undoable-by-default means nothing ever really goes away, and a law office that keeps everything has its own problem. Every message you keep is a message you might have to search, review and produce. The 2015 note says it itself: “aggressive preservation efforts can be extremely costly”. Every stale copy of client information sitting in a trash folder, a versions folder, or an undo log’s trail is one more copy to protect. And versioned files pile up. Version 14 of a lease nobody signed is clutter, and clutter is how people grab the wrong file.
I’ll concede most of that. Undoable-by-default isn’t keep-forever. A trash can that never empties is a hoarder’s attic, and I don’t want one. The trash still empties, on the vendor’s clock or on my yes. Old versions still get cleared. The undo log is a record of where things went, not a second copy of the things.
What I won’t concede is which mistake you build for. Junk that sits in the trash for 30 days costs you a little storage and a little risk. A trust reconciliation, a served pleading or a message with “potential evidentiary value” that’s gone in one keystroke can’t be gotten back at any price. When one mistake costs storage and the other costs the record, you build for the storage.
One disclosure before you weigh any of this: the firm publishes software for lawyers who run their own AI tools, so I’ve got a stake in you building this stuff instead of avoiding it.
Here’s how I’d know I blew this one
If restores never happen. Keep a count. If a year of undo logs goes by and nobody ever restores a single file, the trash step is ceremony, and maybe a simpler rule (a tighter cleanup pattern, say) would do the same work. I don’t expect that. My first restore came about nine hours into the first big run. But that’s the number to watch.
If the trash clock beats the log. If I find a file I needed after its trash window closed, even once, then logging the purge date and putting it on a calendar wasn’t enough, and the right answer is a longer local hold before anything reaches a vendor’s trash at all.
If versioning makes people grab the wrong file. If somebody files or sends version 3 when version 4 was the one that counted, the versioned-file rule is producing the confusion it was supposed to prevent, and the fix is a clearer naming rule or a pointer to the current version, not a return to overwriting.
If the vendors close the gap themselves. If the mail and file services start keeping every deletion recoverable for months by default, with holds a small firm can set in one click, then most of this essay is a vendor setting.
What won’t change my mind is a smarter model. My overnight cleaner was plenty smart. Its rule was dumb, and it followed the dumb rule perfectly. Some rule will always be wrong. The trash can is how you make sure being wrong costs you four minutes instead of the record.
Sources
- Fed. R. Civ. P. 37(e) and the Advisory Committee note to the 2015 amendment — the trigger for measures on lost electronically stored information, including “cannot be restored or replaced through additional discovery”; measures “no greater than necessary to cure the prejudice”; severe measures only on a finding of “intent to deprive”; the note on “the routine, good-faith operation of an electronic information system”, “intervening in that routine operation”, “does not call for perfection”, the less costly but “substantially as effective” form of preservation, and the cost of “aggressive preservation efforts” (Legal Information Institute)
- Minn. R. Civ. P. 37.05 and the 2018 Advisory Committee comment — Minnesota’s parallel rule on failure to preserve electronically stored information; restoring or replacing by “locating alternate copies of the information, or reconstructing backed up copies”
- Minn. R. Prof. Conduct 3.4(a) and cmt. [2] — a lawyer shall not “unlawfully alter, destroy, or conceal a document or other material having potential evidentiary value”; comment [2] on the opposing party’s right being frustrated “if relevant material is altered, concealed or destroyed”
- Minn. R. Prof. Conduct 1.15(h) — books and records of the practice and of client funds and property “preserved for at least six years”
- Appendix 1 to the Minnesota Rules of Professional Conduct, as published by the Lawyers Professional Responsibility Board — the “Electronic Record Retention” paragraph: monthly retention of the check register, trial balance and reconciliation report, the PDF alternative on a separate device, and regular back-up
- Minn. R. Prof. Conduct 1.16(d)–(e) — surrendering papers and property on termination; papers the client is entitled to “whether stored electronically or otherwise”, including litigation materials “drafted and served or filed”
- Gmail Help, “Delete messages in Gmail” — deleted messages move to Trash; recoverable “Up to 30 days after deletion”; after 30 days “The message is permanently deleted.”; a deleted draft can’t be recovered from Trash
- Gmail API reference:
users.messages.trash(“Moves the specified message to the trash.”; acceptsgmail.modify),users.messages.delete(“This operation cannot be undone. Prefer messages.trash instead.”; requires the full mail scope), users.drafts.delete (“Immediately and permanently deletes the specified draft. Does not simply trash it.”; accepts gmail.modify), and Choose Gmail API scopes (gmail.modify“does not allow immediate, permanent deletion of threads and messages, bypassing the trash”) - Microsoft Learn, “Recoverable Items folder in Exchange Online” — the 14-day default deleted item retention period, adjustable to a maximum of 30 days; removal when it expires; holds stop automatic purging
trashcan.py, its demonstration run and its edge-case test file were written for this article and run on macOS under Python 3.9.6 against an invented folder. Every output shown above is actual output from those runs, with only the scratch folder’s path shortened to/demoin the undo-log excerpt.- Companion essays in this section: The Agent Drafts. The Human Sends., My Software Asked ‘Calendar This?’ Four Times, I Audited What My Own AI Could Reach, The Failure That Says Nothing, Never Email the Word File
General commentary on practice management and legal technology. The opinions, and the conditions under which the author would concede he’s wrong, are the author’s. Not legal advice and not ethics advice; what a duty to preserve requires, and how the Rules of Professional Conduct apply to a particular firm’s records and files, is a question for that lawyer’s own analysis of the jurisdiction and the matter. Vendor retention periods and API behavior change, and every vendor statement above is as the page read on November 22, 2026. Every incident in this essay is an invented composite. No client information appears in this article. Everything in this section is free, and the only ask is that you use it to serve people who could not otherwise afford a lawyer. Questions about anything here: Send us a message.