Skip to content
Lucerna Law

Confidentiality and ethics

AI Audit Trail: What a Firm Should Be Able to Show

By Published 10 min readUpdated

An AI audit trail is the record a firm can produce of how an AI tool was used on a matter: who asked what and when, which files went in and who sent them, who else looked, and what was deleted. A firm needs it for supervision, for a client's question, and for a court's.

What is an AI audit trail?

An AI audit trail is a list of events, each with a person, a time and a subject, that the people being recorded cannot rewrite. For an AI tool the events are questions asked, files uploaded, records viewed and things deleted. Its purpose is to let someone who was not there reconstruct what happened.

That is different from a chat history. A history exists so the person who asked can scroll back. Where a tool lets that same person rename, clear or delete it, it proves little to anyone else. A trail exists for a second reader, later, who may be sceptical.

Three properties separate the two.

  • Attribution. Each entry names an account that belongs to one person. A shared login produces a trail that names nobody.
  • Resistance to editing. The person recorded cannot change or remove the entry, or cannot do so without leaving another entry behind.
  • Completeness you can test. A reader can tell whether the copy in hand is the whole record or a part of it.

Whether a record of this kind belongs in the client file, and how long to keep it, are separate questions, answered in are AI chat records part of the client file.

Who asks to see a firm's AI audit trail, and why?

Three readers ask to see a firm's AI audit trail: a supervising lawyer, a client and a court. Each wants a different slice. The supervisor wants patterns of use, the client wants to know what happened to their information, and the court wants to know how a particular paper was made.

The supervising lawyer

The comment to Model Rule 5.1 says that in a small firm of experienced lawyers, "informal supervision and periodic review of compliance with the required systems ordinarily will suffice." A periodic review needs something to review. The comment to Rule 5.1 does not mention AI, but a record of who asked a tool what is the kind of thing such a review can read. The routine is set out in the duty to supervise AI.

The client

A client's question may come after something has gone wrong. ABA Formal Opinion 483 on obligations after a data breach says lawyers "must make reasonable attempts to determine whether electronic files were accessed, and if so, which ones," and must tell a client the known or reasonably ascertainable extent of the access. A list of what was uploaded to a tool, and when, is where that work starts for the tool. The opinion is read in full in ABA Formal Opinion 483.

The court

A court's question is about one filing. Who prepared this, from what, and who checked it? Courts have begun to write verification duties for themselves as well as for lawyers, which is covered in what court policies say about judges using AI. What they require of lawyers is in AI in court.

The five entries an AI audit trail needs

An AI audit trail needs five kinds of entry: questions, uploads, views, deletions and access changes. A tool that records only the first is keeping a chat log. The table sets out what each entry should hold and the question it lets a firm answer.

EntryWhat it should holdThe question it answers
QuestionWho asked, when, the full question, the full answer, the sources citedWhat was the tool asked about this matter, and what did it say?
UploadWho sent the file, when, its name, size and a fingerprint of its contentsWhich exact documents did the tool hold, and from when?
ViewWho opened a matter or a file, and when, including the vendor's staffWho has seen this client's information?
DeletionWho deleted what, when, and how much wentWas anything removed, and by whose decision?
Access changeWho joined, left or changed role, and who restricted a matterWho could have seen this matter on a given date?

A fingerprint here means a hash such as SHA-256. It is a short value computed from the file's bytes. If one character of the file changes, the value changes, so a fingerprint lets a firm show that the document it holds today is the one that was uploaded.

Two entries are harder than they look. A tool may not record views by a firm's own members at all. Deletion is awkward because a record of a deletion has to survive the deletion.

What does Lucerna Law's matter record hold, column by column?

Lucerna Law's matter record is one CSV file with a row for every answered question and every file sent, oldest first. Any member of the firm can download it from the matter's page. It has nineteen columns, listed in the product's source, and each row fills the columns for its kind of event.

ColumnsFilled forWhat they hold
occurred_at, eventEvery rowThe time in UTC, and whether the row is a question or an upload
actor_name, actor_emailEvery eventWho asked the question or sent the file
chat, question, answerQuestionsThe chat's name and the full text of both sides
cited_refsQuestionsThe references in the answer that name a passage the model was shown, separated by semicolons
unverified_refsQuestionsThe references in the answer that name no passage the model was shown
assistantQuestionsThe assistant's name as the page shows it
filename, content_type, bytes, sha256UploadsThe file's name, type, size and SHA-256 fingerprint
status, error, completed_atUploadsThe upload's status (pending, ready, failed or removed), any error, and when it finished
record_id, partEvery rowThe event's id, and a counter for a long cell split over rows

The two reference columns hold references and not the passages' text. The code that fills them reads every reference out of the finished answer and sorts each one by a single test: was a passage with that reference among those sent to the model for this question? Those that pass go in cited_refs. Those that fail go in unverified_refs, and the page strikes them through.

A question is recorded once its answer is complete. The code's own comment says an answer the reader abandoned or the model refused is not recorded, so neither has a row.

Three things the export adds

The README describes three marks a reader of the file will meet that are the export's own and not the record's.

  1. A leading apostrophe. A cell that a spreadsheet would run as a formula, one starting with =, +, - or @, is written with an apostrophe in front. An answer that begins -1 reads '-1.
  2. Continuation rows. A cell longer than 32,767 characters, the most Excel can hold, continues in the same column of the rows below. Those rows count up in part from 2, and joining the column in that order gives the whole text.
  3. An end row. The last row has end in the event column and says how many rows came before it. A file without that row was cut off and is not the whole record.

A record of more than 20,000 events is refused whole. The source gives the reason: a file that stopped part way would pass for the complete record.

Two details affect how names read. Someone who has left the firm appears as "former member", because the database no longer shows their name to the firm. And the assistant column names the assistant, not the underlying model. The README says the model id stored with each answer is not in the file, whoever exports it.

A quick way to see all this is to ask one question of a test matter and then export.

Ask the file

Which documents in this matter mention a deadline, and what date does each give?

The row for that question will carry your name, the time, the full answer and the references it cited.

Beyond the matter export: activity record, fingerprints and staff views

Beyond the matter export, Lucerna Law keeps three further records a firm can read: the firm's activity record, the upload record behind each fingerprint, and a list of each time Lucerna Law staff viewed the application as one of the firm's people. They cover membership, deletion and outside access.

The firm's activity record

The README says the activity record holds one row for each change to the firm: a firm created or renamed, an invitation made or cancelled, a person joining, a role changed, a member removed or leaving. Closing, reopening, holding, releasing and deleting a matter are each written to it with the matter's name. Deleting a chat for good leaves a line with who did it, the matter, and how many questions went.

The rows are written by database triggers in the same transaction as the change, so no page has to remember to write one. The application can read the table and nothing else, and a trigger refuses every update and delete. The README names two cases that get through: deleting a person's account clears their id from their events, which keep the name and address, and deleting a firm deletes its record. Owners and admins read it on the Firm page under Activity.

The upload record

Each file sent has a row, failed uploads included, with who sent it, its size and, once the file has been read, its SHA-256 fingerprint. The Security page says the application can record only how an upload ended. It cannot delete the record or change who sent the file, its name or its size.

Views by Lucerna Law staff

The security section of the homepage says an administrator can open the application as one of a firm's members only after an owner or admin of the firm approves the request. The privacy policy says an approval lasts 24 hours and can be withdrawn, and that each request, answer and view is recorded with the administrator's name. The firm's owners and admins read that record on the Firm page.

What Lucerna Law's audit trail leaves out

Lucerna Law's audit trail leaves out several things, and its own pages and README say which. The export covers answered questions and uploads only. Set against the five entries above, views by a firm's own members are the main gap, and access through the infrastructure is outside the record a firm can read.

Entry by entry, the sections above come to this.

EntryWhere Lucerna Law records it, as described above
QuestionThe matter export, with a row for every answered question. An answer the reader abandoned or the model refused has no row
UploadThe matter export, and the upload record, failed uploads included
ViewViews by Lucerna Law staff acting as one of the firm's people are recorded. Its pages describe no record of views by the firm's own members
DeletionThe firm's activity record: deleting a matter, and deleting a chat for good
Access changeThe firm's activity record: a person joining, a role changed, a member removed or leaving

The gaps, one at a time:

  • Views by members. Its pages describe no record of which member of a firm opened which file or read which answer.
  • Downloads, exports and sign-ins. The README lists these as not recorded in the firm's activity record.
  • Infrastructure access. The privacy policy says staff who hold the database's owner role and the storage keys could read a firm's data, that this access is not through the application, and that the record a firm can read does not cover it.
  • The owner of the database. The README says the database owner could drop the trigger that makes the activity record append-only: "the database cannot guard against its own owner."
  • Deleted matters. Deleting a matter removes its questions, answers and upload records. The activity record keeps who deleted it, when, and its name, so an export taken beforehand is the firm's copy of the rest. Retention periods and legal holds are covered under what Lucerna Law keeps, exports and lets a firm delete.
  • What a citation check means. An empty unverified_refs column means every reference named a passage the model was shown. The homepage says the check does not test whether a passage supports the statement it follows.
  • Independent review. The Security page says no auditor has certified the service and that a SOC 2 Type I audit is planned.

Testing an AI audit trail before the firm relies on it

Testing an AI audit trail takes five small experiments on a matter that holds nothing confidential. Each one makes a known event and then looks for it in the record. The method works on any tool. It finds the gaps before a supervisor, a client or a court does.

  1. Make a known event. Upload one file and ask one question, and note the time.
  2. Export and find both. Check that each row has your name, the right time and the full text.
  3. Compare the fingerprint. Compute the file's SHA-256 on your own computer and compare it with the record's.
  4. Try to remove something. Delete the chat as an ordinary member, export again, and see whether the question is still there.
  5. Check the ending. Confirm how the file shows that it is complete, and what happens when it is not.

Then write down what the record does not hold, and decide who in the firm keeps that information some other way. The review side of the same habit is described under keeping a record of the review.

This post describes one product's records as its repository and pages state them, and quotes one comment and one ABA opinion. It is not legal advice.