Loading

The AI Run Log and Retention

Every call the platform makes to an AI provider writes one row to the AI run log: which feature asked, which model answered, how many tokens it used, what it cost at list price, how long it took and whether it worked. The log is what AI Usage reads and what AI credit is charged from, and three settings decide how much of each call's content it keeps.

Where to find it

Architect Panel → Activity:

  • AI Run Log — the raw rows, newest first, read-only
  • AI Usage — the same log summarised, with a readable view of each run

Architect Panel → Configuration:

  • AI Settings — the section The run log

Architect Panel → Automation:

  • Tasks — the AI Run Log Housekeeping task, which applies the retention settings

One row per call

Retries, repairs and a fallback to a second model are added into the same row, so the count of rows is the count of calls. Status is ok, error, invalid (the answer failed its checks) or refused (the model declined). Each row also records the Requester the call was made for, and, where a feature says so, the Subject datastore and Subject row it was about. The log is written by the platform; nobody edits it, and Super Administrators get read access only.

What is kept

  • Always: feature, role, service, model, status, error, token counts, estimated cost, duration, the provider's request id, and a fingerprint of the request that lets identical calls be matched without keeping either.
  • Output: what the feature was handed back. Kept unless the feature opts out.
  • Responses: the provider's raw answers, kept while Keep the response is on (the default). They are the only record of what a model actually said.
  • Request: the prompt, including any document text, kept only while Keep the request is on. It is off by default, because prompts are personal data held outside the access rules of the records they came from.

Keys never reach the log. A body larger than about 2 MB is replaced by a note of its size. Scans read by AI keep no text in the log at all, only their cost.

The run log settings

  • Log every call: on by default. Off means no row per call, no figures on AI Usage, and background AI calls with no way to hand their answer back. While AI billing is on it is forced on.
  • Keep the request: off by default.
  • Keep the response: on by default.
  • Blank the bodies after (days): default 90. After this, a run's request, response and output are blanked and the usage row is kept, so cost history survives. 0 keeps the bodies.
  • Delete runs after (days): default 0, which keeps runs for ever. Otherwise rows are deleted outright after this many days.

An answer a background job has not yet collected is never blanked or deleted until that job expires.

Switching retention on

The two retention figures do nothing until the AI Run Log Housekeeping task runs, and it ships disabled and in preview mode. In preview it only reports what it would blank and delete, even when scheduled.

  1. Set the two figures on AI Settings and Save.
  2. In Tasks, find AI Run Log Housekeeping and switch it on. It runs daily.
  3. Use the row's Preview action and read what it would blank, delete and spare.
  4. When the numbers are what you expect, take the task out of preview mode on its row.
  5. Check What the log keeps on AI Usage: the warning that "these numbers currently mean nothing" should be gone.

The same task also clears the stored request of finished background AI jobs that no worker tidied up.

What goes wrong, and how to tell

  • AI Usage says the housekeeping task is disabled, in preview mode, or not installed: nothing is being removed yet, whatever the settings say.
  • A run on AI Usage says "The answer was removed by the retention sweep": its bodies were blanked by retention. The usage and status remain.
  • The log grows faster than expected: Keep the request is on and features are sending documents. Turn it off unless you are diagnosing a problem.
  • A background AI feature finishes but shows nothing: Log every call is off. Turn it back on.

Worked example

A data protection review asks how long AI prompts and answers are kept. The architect confirms Keep the request is off, sets Blank the bodies after (days) to 30 and leaves Delete runs after (days) at 0, so cost history stays. They enable the housekeeping task, preview it, see it would blank several thousand older runs and delete none, and take it out of preview. The review is answered: prompts are not stored, answers are kept for 30 days, and usage figures are kept indefinitely.

Recommendations

  • Leave Keep the request off except while diagnosing a fault, then switch it off again.
  • Blank bodies, keep rows: cost and failure history are worth keeping; content rarely is.
  • Preview the housekeeping task before trusting it, then take it out of preview.
  • Never switch run logging off on an installation that uses background AI work or AI billing.