Skip to content

Conversation retention and deletion (Löschkonzept)

Myra AI Workspace can automatically and permanently delete a tenant's chat content once it exceeds a configurable retention period (a Löschfrist). This is the Lösch- und Archivkonzept for user-generated conversation data: it names what is deleted, when, who is responsible, and how each deletion is recorded.

⚠️ Caution: Retention deletion is irreversible. A purged conversation and everything it contains cannot be recovered. Retention is therefore disabled by default and must be explicitly enabled per tenant.


What the retention job deletes

When a tenant has a retention period configured, a background job periodically and permanently deletes every conversation of that tenant whose last activity is older than the retention period — together with everything the conversation owns:

  • the conversation record and its messages;
  • all attachments and generated images on those messages;
  • conversation summaries and embeddings (the derived search index);
  • conversation feedback (the rating, the comment, the screenshot of the page you were on that the rating dialog attaches by default (you can untick it; saving the rating again replaces it, or removes it when unticked) and the device diagnostic stored with it: browser details the client sends, plus a server-added record of your IP address, user id, role, request id, conversation and project; it is also erased when your account is deleted, and so are the screenshots. The device diagnostic lives only on the chat feedback record: it goes with the conversation on every deletion path, and the operator triage queue holds no copy of it. The operator triage entry created from the rating (it carries your comment and your rating) is erased with the feedback itself, enforced by the database, on the same paths: conversation deletion, retention expiry, and account or tenant deletion), shares, and any conversation-owned knowledge files;
  • pending file-upload claims tied to the conversation.
  • the file-edit record of an assistant message: the name and arguments (up to 4 KB each, at most 4 per message) of the file-writing tool calls of that reply, stored with the message to give the model its earlier edits in later turns (see Earlier file edits). It contains user content, is deleted with the message and the conversation, and is reset when the reply is regenerated.
  • saved tool results of a failed turn (kept so Try again does not run the tools twice): encrypted, resumable for 24 hours, then reduced to a non-content tombstone that is deleted after 30 days; also deleted on user erasure and tenant deletion, and its content is removed as soon as a message of the conversation is deleted. See Saved tool results.
  • the conversation's tool confirmation cards, its "Allow for this conversation" grants and its approval requests (with the people named to decide them); also deleted on user erasure and tenant deletion. See Data handling.

In addition, if a message from a purged conversation had been flagged through the content-report (moderation) flow, the reported message text is erased from the moderation record. The moderation record itself is kept (its status, reason, and timestamps carry no conversation content) so the moderation trail is not lost.

Retention basis: last activity

The deadline is measured from a conversation's last activity, not its creation. The clock is the conversation's last update time: it is reset whenever the conversation changes, for example when a new message is added, so a conversation that is still in use is never purged. Concretely: a 365-day retention period deletes only conversations that have had no activity for 365 days.


Configuring the retention period

Required role: platform admin — in the UI (the Organisations list is admin-only) and on the API: a tenant admin's PATCH /admin/v1/tenants/:id that would change conversation_retention_days (or request_log_retention_max_days) is rejected 403 and writes nothing. The conversation Löschfrist is set by the platform operator on the tenant's behalf. For request logs the operator sets a maximum and the tenant admin may shorten the effective period within it (see below).

In the admin console, open Platform › Organisations → (an organisation) → Overview → Edit (platform admin only) and set Conversation retention (days). Leave the field blank to disable retention; enter a whole number of days between 30 and 3650 to arm it. The tenant detail page shows the current setting (the number of days, or Disabled) at a glance. Every change to the setting is recorded in the audit log.

The same value can be set programmatically, in days, via the tenant update API:

PATCH /admin/v1/tenants/{id}
{ "conversation_retention_days": 365 }
Value Effect
null or 0 Disabled (the default). No conversation is ever deleted by retention.
30 – 3650 Delete conversations with no activity for that many days (30 days to 10 years).
any other value Rejected with 400 (see below).

Read the current value back from GET /admin/v1/tenants/{id} (conversation_retention_days).

Accepted input and what is rejected

The field is validated at the trust boundary and fails closed:

  • The value must be a whole number. A fractional value such as 0.4 or 45.5 is rejected with 400 — it is not rounded.
  • A non-zero value below 30 or above 3650 is rejected with 400. The 30-day floor prevents a mistyped 1 (or an hours/days unit mix-up) from purging a tenant's recent history.
  • A string ("365"), array, boolean, or any non-numeric type is rejected with 400 (… must be a number or null). The other messages are … must be a whole number of days and … must be between 30 and 3650 days (or 0 to disable).
  • 0 and JSON null clear the setting back to disabled.

A rejected request never changes the stored value.


The deletion log (Löschprotokoll)

Every retention sweep that deletes anything writes one entry to the audit log per committed batch (a sweep deletes in bounded batches, so a tenant with a lot to delete produces several entries), so each automated deletion is accountable (Nachvollziehbarkeit). An entry records counts only — for conversations how many conversations, messages, and attachments were deleted and how many moderation records were scrubbed — together with the retention period and the cutoff timestamp that were applied. No conversation content is ever written to the log.

Each entry is attributed to the system actor (the automated job has no human operator), for example with the action conversation.retention_purged, and carries these fields in after:

  • batch: the number of the batch within the sweep, counted from 1.
  • truncated: true only on the last batch a sweep is allowed to run, and only when that batch did not finish the work. It tells a reader that a remainder is left, which the next hourly sweep deletes. It is false on every other entry.
  • the counts and the applied retention period and cutoff.

Add up the entries of one sweep to get its total. The sweep's last entry tells you whether it was complete (truncated: false) or cut short at its batch limit (truncated: true).

The log is written together with the deletion, and fails closed. Every automated retention and purge sweep (conversations, request logs, the 730-day age-bound sweeps, the replay, pre-mask and failed-extraction stores, the anonymisation passes, and the audit-log pruner) writes its entry in the same database transaction as the batch it describes. A deletion whose entry cannot be written is rolled back: the rows stay, the error is logged, and the next hourly sweep retries it. A deletion can therefore never be unlogged.

The status entry. When a sweep stops on a fault, it additionally writes one zero-count status entry on a best-effort basis. It records no deletion. It is the only kind of entry that carries failed: true and a reason:

reason Meaning
batch_fault Starting, deleting in, or committing a batch failed; the batch was rolled back.
audit_row_failed The batch's own entry could not be written, or the commit of the batch together with its entry failed, so the batch was rolled back.
lease_not_obtained Informational: another node holds the lease; the work follows on a later tick.

On ordinary batch entries the failed key is absent (it is not written as false). A SIEM rule that looks for faults must therefore test for failed = true (or for the presence of reason), not for failed = false on the entries it wants to treat as healthy.


Share-link tokens in feedback and error reports

Share links (/shared/<token>, /share/<token>) are bearer credentials, so they are never kept where triage staff can read them. New client errors, application feedback, contact messages and the model-error triage mirror store the token as :token. Rows stored before that fix are cleaned by a boot job on one worker: it runs at every start, re-checks all rows (so it needs no done flag and is safe to repeat), logs counts only, works in a time-boxed pass of at most 60 seconds, and retries a few times if a pass is cut short. A row whose update fails stops the pass at that row (earlier rows are done) and is retried from there at the next attempt, five minutes later, up to 24 attempts; after that the job logs an error and the next boot resumes. A pass with a failure is never reported as done. Covered columns: app_feedback (url, client_context), client_error_log (url, message, stack, client_context), model_error (title, client_context), content_report and chat_feedback (client_context).

Cleaned model_error rows keep their old fingerprint; only the title is rewritten. New reports of the same error therefore start a fresh group once, and the old group stays separate.

Not covered: ClickHouse tables and the audit log are not rewritten.

What this job does NOT delete

The retention job targets conversation content (the conversation, its messages, attachments, and the derived stores listed above). Some related records live in separate operational stores with their own lifecycle and are not removed by this job. They are named here so the concept is complete:

Store Contains Handling
Request / inference log The prompt and model response of each API call (including the raw and scrubbed text), plus client IP, user agent, token label, referer, client request id, metadata and detector results Kept for cost attribution, analytics, and SIEM export; not conversation-scoped. When a user exercises the right to erasure the row is kept as billing evidence and its personal columns (user and invoker ids, token label, client IP, user agent, referer, client request id, prompt and response including raw and scrubbed text, detectors, block reason, metadata) are reset — see Erasing a user. A dedicated per-tenant request-log retention Löschfrist is a separate control from conversation retention: it anonymises these personal columns after the Löschfrist and deletes the remaining billing row after 730 days (or the Löschfrist if longer). Where the optional ClickHouse analytics copy is enabled, erasure and the Löschfrist do not reach it (nothing in it is deleted or anonymised): its text expires after 14 days and its other personal fields after 730 days — see ClickHouse analytics sink.
Partner / affiliate account An affiliate partner's name and login email (partner), plus their partner_login one-time-passcode rows Not tenant- or user-scoped (a top-level entity). Suspending a partner preserves history; erasure (DELETE /admin/v1/partners/{id}/erase, Art. 17) removes the partner row and its OTP rows, nulls every attribution that referenced it (tenant.referred_by_partner_id/referred_at, signup_intent.referred_by_partner_id), and records a counts-only partner.erased audit tombstone (no name/email). Referred-tenant visibility: a partner can see its own referred tenants' identity (company, admin name/email), status, seats and usage to coordinate — this is read-through (no copy is stored on the partner), so a referred customer's own erasure removes it from the partner view automatically, and a partner sees only its own referred tenants. Legal footing (affiliate agreement + T&C/DPA) tracked internally. See the Partner dashboard API.
Model-error / triage queue Diagnostic detail of a failed turn (may include a derived snippet) and a conversation reference Kept for operator triage; the conversation reference is left dangling after a purge. Erased on user erasure. Exception: a triage entry created from a chat rating is deleted together with the rating on every deletion path (conversation deletion, retention expiry, gateway, account and tenant deletion), enforced by the database.
Distributed traces Step-level trace of a gateway request Governed by Trace retention (default 48 hours — far shorter than any conversation Löschfrist).
Cost ledger rows Per-leg token/cost accounting No content; the conversation reference is left dangling after a purge.
Client error reports Browser-reported errors from the app (message, stack, URL, user agent — may contain user-visible text) Kept 30 days (fixed), then removed by an hourly, batched sweep; the timestamp is the server's receive time. On user erasure the report's user_id, tenant_id, IP, URL and client_context are nulled (only the bounded message/stack remain until the sweep). The stored URL and referrer are scrubbed on intake (query, fragment, userinfo and share-link tokens removed). The optional recent_errors / recent_failed_requests diagnostic rings inside client_context hold at most 20 typed items each (timestamps, error source and class, HTTP status, method, host, route template, request id); they never contain error messages, stack text, bodies, headers, cookies, tokens or query strings, and follow the client_context retention and erasure above. See the client-errors API.
Model deprecation probe log Outcome of the hourly model-availability probe per provider/model (no personal data) Kept 30 days (fixed), then removed by the same hourly sweep.
Health probe log Outcome of the synthetic health probes (table names, counts, pass/fail — no personal data) Kept 30 days (fixed), then removed by the same hourly sweep.
Docs assistant feedback Anonymous thumbs ratings on the public docs assistant (docs_feedback: rating, optional question and answer text up to 2 000 / 8 000 characters, a coarse IP bucket (IPv4 /24, IPv6 /48), request id) — no account, no tenant Kept 30 days (fixed), then removed by the same hourly, batched sweep. Not tenant- or user-scoped, so not part of an erasure request or a tenant purge; used only in aggregate to improve the docs assistant.
Workflow run outputs Per-step work-product output of a workflow run (run_state) and the submitter's trigger payload (trigger_input) Retained as tenant operational work-product under a distinct legal basis (GDPR Art. 6(1)(f)); not conversation-scoped. On user erasure the run row is kept and the erased user's identifiers (uuid and email) are scrubbed in place from run_state, while the submitter's own trigger_input is nulled on their own runs — see the erasure section below. The retention criterion is the operational life of the workflow/tenant, bounded by the workflow-run retention ceiling (storage limitation, Art. 5(1)(e)).
Workflow artifacts Binary files a workflow node produces or fetches (e.g. a document, a filled PDF), stored against the run that made them (workflow_artifact) Retained as tenant operational work-product on the same legal basis as run outputs. Because the bytes are binary, they cannot be identifier-scrubbed in place like run_state JSON: on the owner's erasure the artifacts of that user's own runs are deleted outright, and on tenant deletion all of the tenant's artifacts are deleted. They also cascade automatically when their run is removed by the workflow-run retention ceiling. Residual: an artifact attached to another tenant member's run that happens to embed the erased user's personal data is not auto-deleted (a binary cannot be selectively scrubbed and deleting a colleague's work-product would be destructive) — the same bound the run-output free-text scrub already carries.
Reactivation-mail send log One row per member-reactivation e-mail step claimed for a member (user_reactivation_event: sequence, step, when, outcome, whether activity followed) — no message content Kept for the life of the member's seat: it is the record of what was mailed to whom (and the basis of the reactivation metrics). Erased on the right to erasure (Art. 17, FK cascade from the user row; the erased member's id is also cleared from any seat they invited) and on tenant purge; exported in the tenant exit export (reactivation_events) and the member's own Art. 15 export. The member's opt-out stamp (reactivation_opted_out_at) lives on the user row and follows it.
Signup-reminder send log One email-keyed row per signup-abandonment reminder attempted (signup_reminder: the address, when claimed/sent, outcome) — no message content. Pre-payment state, no account Reaped at 90 days (the "already contacted" dedup window; after it a genuinely new abandonment can be re-reminded). Also erased by e-mail on a member's Art. 17 hard-delete and on tenant purge. For a non-account abandoner (the common case, no user row), a pre-90-day erasure request is served by the 90-day reaper or a manual DPO one-row delete.
Sign-up funnel counter One anonymous daily count per step and entry (signup_funnel_day: Berlin calendar day, step submitted or verified, door email or oauth, the number of sign-ups) — recorded when a sign-up form is accepted and when the mailbox is verified. No e-mail address, name, IP address, identifier or per-sign-up row is stored, and it carries no tenant reference Aggregate statistics, not personal data: not erased by a purge or an erasure request (there is nothing to attribute to a person) and not exported. It is the only record of how many sign-ups were started or abandoned, because the abandoned sign-up requests themselves (which do hold the address) are deleted after 14 days.
Invite events One tenant-only row per member an administrator creates (tenant_invite_event: the tenant and when) — no user id and no e-mail address Used for adoption statistics. Erased on tenant purge (FK cascade) and counted in the deletion protocol; it holds nothing about the invited person, so a user erasure leaves nothing to remove. Not part of the tenant exit export (derived bookkeeping).
Lifecycle milestones and account-group history Per tenant: when it was created, when its trial started, when it first paid (tenant_milestone), and the append-only history of its analytics group — paying / trial / Myra / test (tenant_group_event) — no user id and no e-mail address Used for conversion and adoption statistics (a trial chat stays a trial chat after the tenant pays). Erased on tenant purge (FK cascade) and counted in the deletion protocol; not part of the tenant exit export (derived bookkeeping). A platform administrator can re-classify a tenant (account group); each change is audited.
Product-insights facts Per conversation and day: how many answers succeeded / failed (insights_conv_day), per conversation the first-answer time, the number of user messages and whether a file was attached (insights_conv), the model and file types used (insights_conv_day_dim), and per trial seat the first-answer time, the active trial days, the credit used and the first credit-limit block (insights_user) — keyed by tenant and user id, no message text, no prompt, no file content, no e-mail address Derived hourly from chat data for the product-insights statistics; history is never rewritten (a later deletion of chat data does not lower past days). Erased on tenant purge and on user erasure (FK cascade) and counted in the deletion protocol. Not part of the tenant exit export (derived, rebuildable bookkeeping).
Partner-portal tenancy records For a tenant provisioned through the partner portal: the tenant record (tenancy_tenant: the requested desired state, the slug and Microsoft Entra directory id, and the initial settings stored sealed (encrypted)), the job and idempotency record of each tenancy operation (tenancy_job: client, route, request hash, step progress, and the stored answer result_body / result_etag), the first-admin invitation (tenancy_invitation: the invitee's e-mail address and display name), the delegated portal context sessions (context_session: portal actor, identity-session and delegation ids), and the outbox of partner audit events not yet delivered or kept for the partner (audit_outbox) The tenancy_tenant record (desired state, slug, Entra directory id and sealed initial settings) is kept until the tenant is purged and is erased on tenant purge. Create-job answers are kept at least 37 days (30 days plus 7 days of grace). Tenant action answers (reset spend, restore, purge) are kept for AIG_TENANCY_ACTION_IDEM_S (default 7 days) and then deleted by the hourly purge sweep, for live tenants too; the answer of a purge is written in the purge's own transaction and kept for that period after the purge. The invitation is erased on tenant purge (FK cascade) and also on user erasure. The context sessions are kept on tenant purge for 730 days from when they were opened as audit evidence (no personal data beyond the portal actor, identity-session and delegation ids) and deleted by the hourly sweep after that; the purge counts them as retained. The job records and the outbox events are audit-relevant and are retained for audit for 2 years with personal data removed. On tenant purge, an unfinished job (pending, running, awaiting customer approval or failed recoverably) is marked failed so it cannot run again (with one provisioning.status audit event per job, written in the purge; it carries ids and statuses only), and each job record loses its step progress, its retry instruction and its stored answer (result_body, result_etag) and keeps its idempotency key, request hash and status: a repeated portal request finds the same status and does not run the operation again, but no longer gets the step detail; a repeated tenant create whose stored answer was scrubbed is answered 409 conflict, not replayed. Its expiry is extended to at least 2 years after creation, so the job's own expiry cannot end the retention early. Each outbox event loses every value the partner portal can link to a person — the acting user's id, the target's id, the before/after values, the delegation, the context session id, the request id — and the provisioning step list (the same step detail the job record loses), as well as the last delivery error. It keeps the event type, tenant, action, outcome, the actor's type, organization and role, its delivery sequence and its delivery state. A scrubbed event is kept as an audit record; an event that was not yet delivered at the purge is not guaranteed to be delivered afterwards. Kept values with a low residual link: the request route (for an invitation resend it contains the invitation id, whose invitation is erased) and the request hash (a one-way hash of the request). A reservation whose create never produced a tenant (a failed create) is currently not deleted automatically; it keeps its desired state and sealed initial settings until it is removed. A job record created before its tenant existed (tenant_id=NULL) is not part of a tenant purge and remains retained by the existing reaper policy, including terminal failed CREATE records; its expiry alone does not remove it. The deployment-local tenancy_portal_job_owner relation contains the reusable portal correlation, its immutable org owner and a certification counter, not desired state or results. Tenant purge does not delete that ownership early: a bounded, separate cleanup removes an owner only after its final referencing operation is removed. A failed owner cleanup is reported and retried on a later sweep; retained pre-tenant CREATE records therefore also retain their owner indefinitely. The purge counts tenant-linked job records and outbox events as scrubbed in the deletion protocol; the hourly purge sweep deletes those retained purged-tenant records after their retention window. None of them is part of the tenant exit export (operational and session state).
Sign-in credentials Per user, for the password-plus-second-factor sign-in policy: a salted Argon2id password hash and its parameters (user_password), the last password hashes (user_password_history), second factors (user_mfa_factor: the TOTP secret stored encrypted, or a passkey's credential id, public key, signature counter and backup-eligibility flag), hashed one-time recovery codes (user_recovery_code), failed-attempt counters (auth_attempt) and half-finished sign-ins keyed by a hash of an opaque token (auth_pending). No plaintext password, TOTP secret or recovery code is ever stored Erased on the right to erasure (Art. 17, FK cascade from the user row) and on tenant purge, and counted per table in the deletion protocol. Never exported: neither the tenant exit export nor the member's own Art. 15 export contains a hash, secret, key or code.
Signup-reminder suppression One email-keyed row per unsubscribe from signup reminders (signup_reminder_suppression: the address, when, source) Retained as an Art. 21 objection (do-not-contact) record — deleting it would re-enable mailing the person, so it outlives the signup intent and is NOT reaped and NOT removed on account erasure/tenant purge; a removal-on-request is a deliberate manual DPO action.
Web-server access logs One line per HTTP request to the web servers: time, method, request path (no query string, no referer), status, size, user agent, the connecting address and the client IP address as forwarded by the CDN — no request or response content Operational log for tracing failed requests and abuse. Rotated by size by the hosting platform (oldest lines are overwritten as new ones arrive), not time-based; not erased per user (a log line cannot be attributed to an account without the operator's lookup).
Replay-record store The raw (unmasked) per-turn replay record — the exact requests the gateway sent to the model, the client messages as sent, the intra-turn tool calls/results as the model consumed them, the available tool names, the routing, the answer, and references to attachments and created files — for offline model evaluation and fault diagnosis, not for training (see Turn replay records). Captured by default for every tenant (replay_capture_enabled, default on); not captured for incognito turns, turns that never reached a model (refused or failed before sending), guardrail-blocked answers, turns whose payload logging is off, or tenants whose request logging is disabled. 30 days (replay_capture_ttl_hours, default 720 h, reaped hourly) and at most 200 records per tenant and gateway (replay_capture_cap); erased on the right to erasure (Art. 17 — by both the turn owner and the run-as driver), on gateway deletion and on tenant purge; not removed when a conversation is deleted or by the conversation Löschfrist. Opt-out per tenant on request. See Turn replay records.
Pre-mask prompt store The raw, unmasked prompt text of recent requests on a gateway with PII masking (at most 8192 bytes per prompt), used for the guardrail dry-run on real traffic (pre_mask_prompt) Off by default — captured only for a tenant the operator opts in (pre_mask_capture_enabled) and only while PII is actually masked. At most the newest 50 per tenant and gateway (pre_mask_capture_cap, ceiling 5000); deleted after 48 hours (pre_mask_capture_ttl_hours) by the hourly sweep, and all rows of a tenant are deleted once capture is off. Each committed batch of a sweep writes a counts-only pre_mask_prompt.retention_purged audit row in the same transaction.
Failed-extraction store The raw bytes of an uploaded document whose text extraction failed, with its file name and error detail (extract_failure_capture), so the failure can be reproduced Off by default — captured only for a tenant the operator opts in (extract_capture_enabled) and only when request logging is not disabled. Bytes, file name and error detail are stored encrypted. At most the newest 200 per tenant (extract_capture_cap, ceiling 5000); deleted after 168 hours (7 days) (extract_capture_ttl_hours) by the hourly sweep, and all rows of a tenant are deleted once capture is off. Erased on the right to erasure (by user id). Each committed batch of a sweep writes a counts-only extract_failure_capture.retention_purged audit row in the same transaction.
Author and editor references on platform records The id of the user who created or last edited a voucher, voucher series, managed-model grant, gateway-local model block, sub-processor event, provider or objection, plan configuration, setting, product-catalog entry, or who granted a tenant entitlement The record itself is kept (it is platform configuration, not personal data). Erased on the right to erasure and on tenant purge: the user's id is removed (set to no value) in all of these places, so the record no longer points to a person. The deletion protocol counts them per record kind.
User references on other users' records The id of a user who triaged a content report, started or drove a live chat session, deleted another user, or is another user's manager Kept records lose the reference (set to no value); a live chat session the user started is deleted. Erased on the right to erasure and on tenant purge (for every purged user), and counted in the deletion protocol; the tenant purge's platform_ref_* / survivor_ref_* counts and the erasure's counts for these columns come from the same shared step. A one-time cleanup also removed such references left behind by earlier purges, and any SCIM manager id that named no existing user at that time (a SCIM GET returns no manager for such a user until the identity provider pushes it again).
Authorship references on other tenants' agents The id of a user who created or saved an agent version, handed an agent or a webhook trigger over, reviewed an agent, decided an agent review (with the note and reason the user wrote), or created a webhook trigger on an agent of another tenant The reference is set to no value and the record stays; for a review decision the note and reason are erased as well; a webhook trigger the user created is deleted and its pending runs are cancelled with the payload cleared. Erased on the right to erasure and on tenant purge (for every purged user) and counted in the deletion protocol as survivor_ref_agent_* / survivor_ref_webhook_trigger_*. A one-time cleanup also removed such references left behind by earlier purges. The purged tenant's own review decisions keep their pseudonymous actor for 730 days (note and reason erased). Known gap: a review decision of an already purged tenant may still name a purged user of another tenant until the 730-day sweep deletes it.
Authorship references on other tenants' workflows The id of a user who owns a workflow, published a workflow version, created a workflow form, an email trigger or a governance template, created a workflow run, decided a workflow approval (with the approver's display name), or is named as the user approver of a suspended run, on a workflow of another tenant The reference is set to no value and the record stays; the run's trigger payload is cleared. The user's pending runs are cancelled (owner_unavailable) and the artifacts of the user's runs are deleted. A workflow without an owner does not run automatically (fail closed). Erased on the right to erasure and on tenant purge (for every purged user) and counted in the deletion protocol as survivor_ref_workflow_* / survivor_ref_governance_template_creator_cleared. A one-time cleanup (migration 0925) also removed such references left behind by earlier purges. Precedence: a purged user's pending runs on a workflow the user owns are counted as survivor_ref_workflow_run_creator_cancelled; survivor_ref_workflow_run_trigger_cancelled counts only the remaining pending webhook runs of workflows whose webhook trigger the user created. A run enqueued at the very moment of the purge or erasure is either committed before it (and cancelled with the rest) or refused: the webhook, form, email and scheduler enqueues wait on the workflow, a manual run-now waits on the user's account. Known gap: the approver stored inside a workflow's graph definition is not erased here (tracked separately). Under concurrent run settlement the purge may be retried after a database deadlock (rare).
Salesforce delivery ledger One row per lead and Salesforce org (production / sandbox) in sf_lead_ledger: the lead key (the registrant's e-mail), the user id, whether the last confirmed send was a deletion, the processing_restricted value last sent, and the time of that send. No other personal data Not deleted outright by an Art. 17 erasure or a tenant purge (including the abandoned-trial reaper): they stamp the rows of both orgs (user id cleared), matching it by e-mail only (as does the abandoned-signup cleanup; the user id is informational and is cleared) and the row is purged 30 days later, unless a live user carries that e-mail (then it is kept; the abandoned-signup cleanup never stamps or flags a live user's e-mail). A row never stamped is purged 30 days after its last change once no live user has that e-mail. A row with an unsent owed deletion is kept until 180 days after the deletion decision, then purged. See Delivery ledger.

If your compliance requirement is that no trace of a conversation's content survives past the Löschfrist anywhere, address the request/inference log with its own request-log retention Löschfrist, and raise the remaining operational stores with your operator. Where the optional ClickHouse analytics copy is enabled, that Löschfrist does not reach it (nothing in it is deleted or anonymised): its text expires after 14 days and its other personal fields after 730 days — see ClickHouse analytics sink.


Agents shared by an erased user

A user's right to erasure (Art. 17) deletes their private agents and everything the user personally owns. An agent they shared (organisation-wide, with named users, or with a group) is tenant work-product and survives: it is handed over to a successor — an explicitly chosen user, otherwise the oldest active KI manager, the administrator who ran the erasure, or the oldest tenant administrator — and stays paused (no invocation, no schedule fire, no webhook run) until the successor confirms it. The leaver is anonymised and the retained audit trail carries no name; with no eligible successor the agent is deleted. See Erasing a user. The four-eyes configuration approval requests the user filed (or filed while impersonating, or decided) are governance evidence and are not deleted: those younger than 730 days are kept with the proposed payload and summary erased, open ones are closed as failed, and older ones are deleted or unlinked from the erased user.

Turn replay records

The gateway keeps a short-lived replay record of each chat or API turn: everything needed to send the same turn again through the gateway with a different model, so Myra can evaluate models on real traffic and diagnose faulty turns. Recording is on by default for every tenant.

What a record holds

  • exactly what the model saw: for every call to the turn's model (the first answer, each step of a tool loop, a fallback to another model, a retry, and the gateway's own summaries and web-search and page-reading steps; separate helper models such as image description or the PII detector are not recorded — their results reach the model inside these requests), the request the gateway sent to the AI provider, byte for byte, with its SHA-256 — that request contains the composed system prompt, the tool definitions and the attachment text and image parts as they went to the model. On a gateway with a PII Protector these are the masked requests the provider received;
  • the messages the client sent for the turn, as sent — not masked;
  • each tool call the model made during the turn and the tool's result as the model received it (including error texts), in order, with the model call that issued it;
  • the names of the tools that were available and which tool categories the gateway switched off (never credentials or connector configuration);
  • the model and provider, the sampling parameters, the model the client asked for, and the routing decisions (fallback, degraded model, a pinned provider);
  • the answer as the client received it and, where the gateway has it, the model's own text before PII restoration, each with its SHA-256;
  • the files attached to the conversation (reference and SHA-256) and the files and images the turn created (reference and SHA-256). The text the model saw is inside the recorded requests; the attachment list does not prove which file the client extracted it from.

Nothing is cut. When a turn is larger than the record limits — 32 MiB of model requests per turn, 8 MiB for the rest of the record (the largest parts give way first) — or the store limits below are reached, the parts that do not fit are kept as their SHA-256 and size only, and the record says so. Under heavy load a record can also not be written at all (the gateway logs it); it is never written partially.

What it is used for

Customer data is not captured for training. Myra does not train AI models on replay records or on other customer data, and no training data is built from them.

Replay records are used to evaluate models (a recorded turn is sent again to another model and the answers are compared) and to diagnose a faulty turn (a record shows what the model received and answered, so a fault can be reproduced).

What is never recorded

  • incognito (ghost) turns;
  • turns that never reached a model: refused or failed before anything was sent to it (for example by a guardrail on the request, quota, budget, model-tier or model-allowlist rule, rate limit or IP allowlist, or an early fault). Logged at NOTICE [replay_capture_drop] reason=no_model_request. A side call such as a classifier verdict does not count as the turn's model request. A turn that did reach a model and then failed (for example a provider error or a timeout after sending) is recorded;
  • turns whose answer a guardrail blocked after the model had answered;
  • turns sent with x-aig-collect-log: false or x-aig-collect-log-payload: false;
  • every turn on a gateway whose Log request/response payloads setting (log_payloads) is off;
  • every turn of a tenant whose request logging a platform admin has disabled (request_logging_disabled, see Tenants);
  • requests that are not a chat turn — no messages (for example embeddings) — and token-count calls;
  • a turn whose owner or run-as (invoker) user id is not 1-36 printable non-space ASCII bytes (for example empty, too long, containing a space, a control or a non-ASCII byte, or not a string) — rejected and logged [replay_capture_drop] reason=store_failed. A user id need not be a UUID: any id of that shape that names an existing user is stored;
  • a turn whose owner or run-as user is unknown, erased or disabled — not stored, logged at NOTICE [replay_capture_drop] reason=gate_closed_at_write.
  • a turn that names a conversation (the chat UI, or the x-aig-conv-id header) which is no longer a live conversation when the record is written (deleted, or deleted while the turn was still being answered) — the turn is served as usual, but no record is stored; logged at NOTICE [replay_capture_drop] reason=conversation_gone_at_write. Records already stored for a conversation are not removed when it is deleted (see the retention below).

How long it is kept

Bound Value
Retention 30 days after the turn (replay_capture_ttl_hours, default 720); an hourly job deletes older records
Volume the newest 200 records per tenant and gateway (replay_capture_cap); each new record pushes out the oldest. Title generation, follow-up suggestions and delegated sub-agent calls are kept separately, the newest 50 per tenant and gateway (platform setting replay_side_ring_cap), so they never push out a user's turns
Store limits 64 MiB per tenant and 4 GiB for the whole platform (platform settings replay_tenant_byte_budget_mib, replay_platform_byte_budget_mib); beyond them a new record is kept as metadata only — its model requests, messages, tool rounds and attachment list as SHA-256 and size, its answer as SHA-256
Right to erasure (Art. 17) all records the erased user owns or drove (run-as) are deleted immediately
Gateway deletion deleting a gateway deletes that gateway's replay records right away. A very large store is cleared in bounded steps: the delete can return before every record is gone, and the hourly job removes the rest at its next run (also any record of a deleted gateway that was written while the delete ran)
Tenant deletion purging a tenant deletes all of its records; a deactivated (soft-deleted) tenant's records are deleted by the next hourly run

Deleting a conversation, the conversation Löschfrist and the request-log Löschfrist do not delete replay records (deleting the gateway does, see above); they expire after the tenant's replay retention above. Replay records are not part of the tenant exit export, nor of a user's own data export (Art. 15).

Opting out

A tenant can be opted out on request: the platform operator sets replay_capture_enabled to 0 for that tenant. There is no self-service switch. From that moment no new record is stored, and the hourly job deletes all of the tenant's existing records at its next run. Turning off Log request/response payloads on a gateway also stops recording for that gateway's turns (existing records then expire after the tenant's replay retention, 30 days by default).


Responsibilities and defaults

Responsibility Owner
Deciding the retention period for a tenant Platform admin (on the tenant's instruction; tenant admins cannot set it themselves)
Enabling the retention capability for the deployment Platform operator
Running the automated deletion job Myra AI Workspace (background job)
Recording each deletion Myra AI Workspace (audit log)

Two independent switches must both be on before any conversation is deleted:

  1. The platform operator must enable the capability for the deployment (it ships disabled — see the operator note below).
  2. A platform admin must set a non-zero retention period for the tenant.

If either switch is off, nothing is deleted.


Retention scope: org, workspace, and user (ceiling precedence)

Conversation retention can be set at three scopes, from widest to narrowest:

Scope Where it is set Field
Organisation (tenant) Platform › Organisations → (an organisation) → Overview → Edit (admin only) conversation_retention_days on PATCH /admin/v1/tenants/:id
Workspace (project) project settings (owner / admin only) conversation_retention_days on PATCH /admin/v1/projects/:id
User Organisation → People → Members → (a member) → Edit conversation_retention_days on PATCH /admin/v1/users/:id

Each is an independent whole number 30–3650 (or null/0 = not set at that scope); out-of-range values are rejected with 400.

Ceiling precedence — a narrower scope may only SHORTEN retention, never lengthen it. A conversation is deleted once it is older than the shortest frist that applies to it (its user's, its workspace's, or the org's — whichever are set). So a user- or workspace-level frist can delete a conversation sooner than the org policy, but can never keep it longer than the org maximum. Example: org = 30 days, a user = 90 days → that user's conversations are still deleted at 30 days (the org ceiling wins). If no scope sets a frist, the conversation is never deleted (opt-in).

Setting a workspace frist is restricted to the project owner (or a platform admin), since it arms irreversible deletion over other members' conversations. Every change is audited; each committed batch of an automated sweep writes a per-scope Löschprotokoll audit row (conversation.retention_purged, tagged with the scope and the owning tenant).


Request-log retention

Chat conversations and request logs are retained independently. The request log (request_log) stores the prompt and response of each inference request; a per-tenant Löschfrist anonymises rows older than a configured number of days and deletes the remaining billing record later.

Two values apply. The maximum (request_log_retention_max_days) is the platform operator's ceiling; the effective period (request_log_retention_days) is what the sweeper actually uses.

Required role for the maximum: platform admin (the Organisations list is admin-only). In Platform › Organisations → (an organisation) → Overview → Edit, set Request-log retention maximum (days) — blank for no ceiling, or a whole number 30–3650. The tenant detail page shows the effective period and the maximum. Lowering the maximum also shortens a longer effective period to it; raising it never lengthens a shorter one. Via the API:

PATCH /admin/v1/tenants/{id}
{ "request_log_retention_max_days": 365 }

A tenant admin sets the effective period on Governance → Privacy → Request-log retention (30 up to the maximum; the field shows "Up to N days, set by your provider"). A longer value is refused inline and nothing is saved; via the API it is 400 with code: "retention_above_max". With no maximum set, the whole range 30–3650 is open, and an unset period means logs are kept until one is chosen. Via the API:

PATCH /admin/v1/tenants/{id}
{ "request_log_retention_days": 180 }

A governance template can also require a minimum effective period (request_log_retention_days, "at least N days"): applying it goes through the same validation, maximum, four-eyes approval and audit rows, and never shortens a longer period or replaces keep forever (see the Governance templates API).

Value Effect
null or 0 Disabled (the default). No request log is ever deleted by retention.
30 – 3650 Permanently anonymise request_log rows older than that many days (personal columns are reset, billing facts kept) and delete them at the later of that many days and 730 days (MySQL; for the ClickHouse copy see ClickHouse analytics sink).
any other value Rejected with 400.

The same trust-boundary validation as conversation retention applies (whole number, 30–3650, else 400; the client is never the authority). Two independent switches gate deletion: a deployment-wide switch controlled by your operator and a non-zero per-tenant frist. The switch (AIG_REQUEST_LOG_RETENTION_ENABLED) is on by default in the production and beta deployments (unset or empty resolves to on; false / 0 turns it off); dev and integration instances keep it off. Being on deletes nothing by itself: a tenant without a request_log_retention_days is never touched. Each change to the setting is audited; each committed batch of a sweep writes a counts-only Löschprotokoll audit row (request_log.retention_purged) with its batch number and truncated flag (see The deletion log). The same hourly sweep deletes impersonation records 730 days after they started, for any organisation or none, independent of any request-log retention period; each committed batch writes a counts-only audit row (impersonation_session.retention_purged) with its 1-based batch number and truncated (set only on the last batch when the sweep stopped at its batch limit; the rest follows next hour). If a batch fails or its row cannot be written, that batch is rolled back, nothing further is removed in that sweep, and it is retried next hour; a zero-count status row with failed: true and a reason records the stop. This age-bound delete does not take the sweeper lease: if two gateway nodes sweep at the same moment both may run it. That is harmless (each record is deleted once) but each such sweep writes its own audit rows, so add up the rows to get the total. The same hourly sweep deletes closed support access grants (denied, revoked, lapsed or expired) 730 days after they were requested, in any organisation or none; a grant that is still open (pending, or approved and not yet expired) is never deleted by it. Each committed batch writes a counts-only audit row (support_access_grant.retention_purged) with the same batch and truncated fields, and a fault the same zero-count status row (failed, reason), as for the impersonation records above. The same hourly sweep deletes configuration approval requests 730 days after they were requested, in any organisation or none; a request that is still open (pending and not yet expired, or being applied) is never deleted by it. Each committed batch writes a counts-only audit row (config_approval.retention_purged) with the same batch and truncated fields, and a fault the same zero-count status row (failed, reason), as for the impersonation records above.

Anonymise first, delete later (billing evidence). At the Löschfrist the sweep erases the personal data of a request_log row (user and invoker ids, token label, client IP, user agent, referer, client request id, prompt and response including raw and scrubbed text, detectors, block reason, metadata) exactly as a user erasure does, and keeps the billing facts (provider, model, tokens, cost, status, timing) as billing evidence under Art. 17(3)(b) DSGVO. The row is deleted at the later of the Löschfrist and 730 days, so a Löschfrist shorter than 730 days never removes the billing record early; a Löschfrist longer than 730 days anonymises nothing early and deletes at the Löschfrist.

Tool-access decision records follow the same frist. The access-layer decision records (access_decision, one row per tool-call decision (MCP connector calls, agent built-in calls, and a chat user's web calls)) have their arguments erased at the Löschfrist (the owner and acting user are kept for accountability) and are deleted at the 730-day bound with the request log. Each committed batch of the sweep writes a counts-only Löschprotokoll row (request_log.retention_purged) for the tenant. Its anonymised_counts carry requests, access_decisions, legs and usage_daily_rows; its deleted_counts carry only requests and access_decisions (legs and usage rows are never deleted). Each row also holds its 1-based batch number, truncated (set only on the last batch, when it did not drain the work) and the legal basis. retained_until and note are per batch, derived from the anonymised request and decision rows of that batch only (omitted when the batch had none); the evidence horizon of a whole sweep is the latest retained_until across its rows. A fault adds one zero-count status row with failed: true and a reason. The tamper-evident audit-log mirror of each decision (see Audit-log retention) is not deleted by this sweep. It follows the global audit-log horizon.

The cost ledger is preserved. Deletion removes only the request_log row. The append-only request_log_legs accounting ledger — token counts, cost, model, region — is never deleted; at the Löschfrist only its user_id is reset (it carries no prompt/response content and has its own, longer, accounting-retention basis).

Daily usage rollup (usage_daily) outlives request-log retention by design. A derived per-day rollup of request_log — grouped by day, tenant, user, model, provider, API variant, gateway and channel, with request/token/cost/latency aggregates and no prompt/response content — is maintained for the analytics data warehouse. It deliberately survives the request_log retention sweep (that is the whole reason it is persisted), so usage history remains after the raw rows are gone. At the Löschfrist its per-user rows are merged into the unattributed total (tenant totals are unchanged); the merge only covers whole UTC days at least two days old and waits for the hourly rollup to finish. It is not exempt from erasure: a user right-to-erasure anonymises that user's rollup rows (their per-user figures are re-bucketed into an unattributed total, mirroring how request_log is anonymised, so tenant-level totals are preserved but the person is no longer identifiable), and a tenant deletion removes the tenant's rollup rows entirely. An erasure or tenant deletion is never refused because the rollup is running, and waits for it at most briefly (the rollup's write step, which gives up after at most one second of waiting and retries on its next hourly run). The rollup re-checks, at the moment it writes, that each user and tenant still exists, attributes nothing to an erased user (their usage joins the unattributed total) and writes nothing for a deleted tenant — so a rollup that runs concurrently with an erasure cannot bring the erased data back.

The same rollup serves the cost analytics breakdowns for whole days that are at least two days old, so those breakdowns keep showing usage after the raw rows are purged. A rollup row that is outside the tenant's retention window is not rewritten by a later run; rows from before gateway and channel were recorded show both as "unknown".

Effect on analytics: requests older than the retention period can no longer be attributed to a person, so they are not counted as active users and do not appear in the per-user cost table. The cost analytics page shows from which date the per-person figures cover requests; what the totals of an older window contain depends on what the retention job keeps (the daily rollup keeps per-day totals).


Scope and fail-safe behaviour

By design, the retention job never deletes more than intended:

  • A conversation whose last activity is exactly at the cutoff is kept (the boundary is strict).
  • A tenant with no retention period, or 0, is skipped entirely.
  • A tenant that has itself been deleted is skipped; its conversations are handled by tenant deletion, not by retention.
  • The job runs in bounded batches, so a first sweep over a large backlog cannot lock the database; it resumes on the next run until the backlog is cleared.

Retention deletion is distinct from, and complementary to, the retention of observability data (see Trace retention) and a user's right-to-erasure request, which deletes a single user's data on demand.

Google / Microsoft sign-up round trip

The oauth_state correlation of a Google / Microsoft sign-up (consent snapshot, campaign source incl. a click ID, the campaign voucher code typed at the start) is consumed at the callback; an abandoned one is valid for 10 minutes and removed by the hourly clean-up (so at most about 70 minutes). Native app sign-in additionally writes a single-use handoff row holding the verified identity (provider, e-mail address, provider subject, display name), the consent snapshot, the campaign source incl. a click ID and the campaign voucher code typed at the start: consumed when the app redeems it, otherwise valid for 2 minutes and removed by the same hourly clean-up (so at most about 62 minutes).

Workflow-run retention

Workflow-run outputs (workflow_run.run_state, the submitter's trigger_input, and the per-step workflow_step_run outputs) are retained tenant operational work-product (GDPR Art. 6(1)(f)) — they survive a single user's right-to-erasure (identity-scrubbed, not content-deleted). To satisfy storage limitation (GDPR Art. 5(1)(e)), that retention is bounded by an age-based ceiling: a background job deletes any terminal workflow run (succeeded, failed, cancelled) whose created_at is older than the window, cascading its workflow_step_run children. A run that is still in flight (pending, running) or awaiting approval (suspended) is never purged regardless of age.

  • Window: global, deployment-level, configured by your operator (default 365 days; every degenerate value clamps to ≥ 1 day, so the cutoff can never reach recent runs). Like Trace retention it is a single global window — a per-tenant clock cannot drive one global delete.
  • Cadence & safety: it rides the same hourly maintenance job as trace retention, in bounded batches (a first sweep over a backlog cannot long-lock the table; it resumes next tick), and is best-effort (a DB fault logs a warning and is retried, never crashing the timer).
  • Distinct from erasure and tenant deletion: erasure keeps the row and scrubs identifiers; whole-tenant deletion removes all of a tenant's runs on decommission; this ceiling removes old terminal runs of every tenant once retention lapses.
  • Workflow artifacts (workflow_artifact, the binary files a run produces) are stored in-row against their run with a foreign key that cascades on run delete, so all three paths reap the bytes: the retention ceiling (run purged → artifacts cascade), tenant deletion (explicit tenant-scoped delete), and user erasure. Unlike run_state, a binary artifact cannot be identifier-scrubbed, so on erasure the erased user's own runs' artifacts are deleted, not scrubbed (the foreign-run residual noted in the table above).

Erasing a single user treats impersonation sessions and support access grants as audit evidence, in whichever organisation (or none) the user appears. The user id is kept; with the account erased it no longer resolves to a person. A free-text support reason is erased, a still-open impersonation session is ended, and a support access request of the erased user that is still open (pending, or approved and not yet expired) is closed as revoked, so it can no longer be approved. Grants older than 730 days that the person requested are deleted; grants older than 730 days that the person only decided keep the row with the person's field cleared. Younger grants are kept unchanged (requester's reason erased) as the organisation's audit record for as long as the organisation's other grants are kept; the hourly sweep deletes them once they are closed and 730 days old, also after a tenant purge. Impersonation records are deleted by the hourly sweep 730 days after they started. The erasure's deletion record lists these as impersonation_session_retained, support_access_grant_retained, support_access_grant_anonymized and support_access_grant_closed; unlike the tenant purge's per-organisation counts, they cover the user's rows in every organisation and in none.

Right-to-erasure is completeness-guarded. Most tables reference a user through a foreign key, so the user-row delete cascades. Columns that reference a user without a foreign key (an editorship/actor id such as shared_by, started_by, triaged_by_id) are anonymized, deleted, or re-assigned explicitly — a nullable reference is set to null, an ephemeral row (e.g. a live-session) is deleted, and a not-null infrastructure owner (the chat-bridge connection) is re-assigned to a surviving tenant admin so one erasure never tears down a whole tenant's integration. A user id embedded inside a JSON value (a comment's @mention list, a workflow's approver snapshot) is scrubbed in place. A schedule that fires a workflow is tenant work-product and survives its creator's erasure: the schedule stays (with its enabled setting unchanged) and only its creator reference is cleared. A workflow schedule fires as the workflow's owner, not as the creator, so clearing the creator changes nothing about who a run belongs to; if the erased user also owned the workflow, the workflow has no owner any more and fails closed (owner_unavailable, see the workflow error codes): its schedules no longer start runs, because the scheduler skips the fire. To keep the automation, recreate or copy the workflow under a live owner. Schedules of the user's own agents are deleted with the agent. The deletion record counts the agent and prompt-task schedules the person created, on any agent; schedules other people created on the person's own agents are removed with the agent and are not counted. The hand-over reference (the person a schedule was handed over from) is cleared as well, by both erasure paths. The same holds when a whole organisation is purged: schedules that people of the purged organisation created on other organisations' workflows survive with the creator cleared and the enabled setting unchanged (foreign_schedule_creator_cleared, foreign_schedule_handover_cleared), and the agent and prompt-task schedules (every schedule without a workflow) that they created in another organisation are deleted (foreign_agent_schedule_deleted). Personal data held in a record keyed by email rather than by user id — the pre-payment signup record (signup_intent: email, name, company, phone, job title, capture IP, consent snapshot) and the email one-time-code challenge — is deleted by that email on erasure (both rows also hold link_nonce_hash, the SHA-256 of the short-lived browser-binding cookie of the magic link — a random value tied to no person, deleted with the row and not part of the Art. 15 export, like the link's own token hash; the cookie itself lives in the browser for at most one link lifetime); because these tables carry no foreign key to user, they are reached by an explicit email-keyed delete (the same delete the tenant purge applies), not by the cascade, and the drift-sweep below does not see them, so their coverage is held by an integration test instead. This registration data is also returned to the person in their Art. 15 self-service export. The checkout records of a sign-up (checkout_session) are not deleted with the sign-up record when the sign-up was paid: once the signup record is gone (abandoned or erased), a completed or duplicate checkout record is kept for 730 days from its creation as billing evidence (Art. 17(3)(b) DSGVO), with the hashed e-mail address in its scope replaced by a placeholder. Open and expired checkout records of such a sign-up are deleted at once. (The former 90-day rule for duplicate records no longer applies.) The signup campaign source (what is captured: UTM values, the type of an ad click ID and the click ID itself (Google, Microsoft, ChatGPT / OpenAI, LinkedIn or Reddit), the referring host) is part of that registration record and erased with it; its durable copy on the tenant (tenant.signup_*, the input of the per-channel signup KPI) is organisation-level attribution that lives as long as the tenant, survives the erasure of one member of a team, and is cleared when the erased person is the tenant's last remaining user (a one-person tenant is the person). The click ID itself (tenant.signup_click_id) identifies one person's ad click, so it is cleared on the erasure of any member of the tenant and when a member is moved to another tenant. At provisioning the tenant copy equals the provisioned registration record, so the person sees the same values in their Art. 15 export; it is deliberately not part of the tenant exit export (internal marketing attribution, not customer content). An objection (Art. 21) to this processing is honoured by an operator clearing the campaign-source values (UTM values, click ID type and click ID, referring host, country) from both copies: the registration record for the person's email address, and the organisation's attribution fields. The signup country (the two-letter code the CDN derives from the registration request's address, what is captured) follows exactly the campaign-source rules: signup_intent.country is part of the registration record (erased whole by email, shown in the Art. 15 export); tenant.signup_country is organisation-level attribution used only for the region breakdown of the growth statistics, kept for a team and cleared with the tenant's last remaining user — also when the tenant carries a country but no campaign source. tenant.self_signup (whether the tenant came from a self-serve sign-up) is not personal data. Because the link is the address itself, an email-keyed record captured under an address that was later administratively rectified (Art. 16) is reconciled by the email-change operational procedure rather than by these automatic email deletes — a single, deliberate caveat of the email-keyed class (it applies equally to the tenant purge and the email one-time-code challenge). A workflow run's output (workflow_run.run_state) is a special case of scrub-in-place: it is a tenant operational work-product record retained under a distinct legal basis, so it is not content-deleted like an inference log — instead the erased user's uuid and email are scrubbed to a tombstone while the work-product itself is retained; the run's own submitter input (trigger_input) is nulled on the subject's runs and identity-scrubbed on runs owned by others. Because the retained work-product is free-form, free-text personal data the user may have typed or that a model may have produced can persist inside a retained run_state — the scrub removes the structured identifiers (uuid, email), not every mention of a person; this is the deliberate consequence of retaining the output as tenant work-product under Art. 6(1)(f). The retained work-product's storage-limitation ceiling is enforced by the workflow-run retention ceiling above. The erased user's webhook triggers are removed with them, and their already-queued runs are cancelled in the same transaction with the untrusted payload each was fired with cleared (a queued agent run's input, a queued webhook-fired workflow run's trigger_input; for triggers on the user's own agents the queued runs are deleted with the agent) — a queued payload is neither executed nor kept afterwards (a run that had already started finishes); the deletion record counts these cancellations. A schema drift-sweep runs at build time and fails the build when a new no-foreign-key user-reference column — one named with a recognized actor shape (*_by, *_by_id, *_user_id, or a curated set of actor-id nouns) — is added without erasure handling, so this completeness class does not silently regress. The sweep also fails the build when it recognizes a statement that handles a column only for a subset of its rows (a statement with an extra condition), unless that column is reviewed and given a written reason for the remaining rows: for the audit tables they are kept for the 730-day evidence period; for the department budget signal, the database constraint allows the reference only on rows the statement covers. The check reads source text and has known gaps; a runtime residual check is tracked separately.

Messages and files in other people's conversations are the same survive-the-author case. When a member co-drove a conversation shared with them (or wrote in a Teams/Slack channel thread), their messages and the files they attached there are part of the owner's conversation and are kept on that member's erasure; only the author link (created_by on the message and the attachment) is set to NULL — the content then reads as the conversation owner's. The member's own conversations are deleted with them, as before. A tenant purge does the same for the purged tenant's members' messages and files in other tenants' conversations (counted as message_author_scrubbed in the deletion record, an anonymisation, not a deletion).

Organisation-library knowledge (the tenant-published knowledge documents an admin shares read-only to every member of the tenant) is another survive-the-author case. It is shared organisational knowledge owned at the tenant level, retained as tenant operational reference material under a distinct legal basis (GDPR Art. 6(1)(f) — the same basis as a retained workflow work-product), so a single member leaving the company does not delete it. On that member's erasure the document is kept and only the personal author link is scrubbed: created_by is set to the anonymised tombstone (NULL), so no personal data of the erased user dangles while the shared content stays readable by the org. A member's own project- and conversation-owned knowledge is still deleted on erasure, as before — only the tenant-owned library survives. The storage-limitation control (Art. 5(1)(e)) for this retained content is the admin content lifecycle — an admin unpublishes or deletes a document, and whole-tenant deletion removes the entire library — there is deliberately no automated content age-ceiling, because org-library knowledge is curated reference material the organisation actively maintains (unlike time-bounded run outputs). As with other retained-across-erasure content, the scrub removes the structured author identifier, not the document body: free-text personal data the author may have typed into the content or filename can persist — the same best-effort bound the workflow-run and request-log retention carry.

One deliberate residual, stated because it is a consequence of a safety control rather than an oversight: when an erasure hard-deletes a knowledge area (a project with no other member), an agent of a different user that was bound to it keeps the area's opaque id as an asserted binding, so the agent can go on failing closed instead of silently losing the residency restriction that area carried — see Knowledge areas. What is retained is the project's identifier, never its name, its content or its members; the project row and everything it owned are deleted. The owner clears the leftover id by saving the agent's knowledge areas, which is also what the product prompts them to do.

Cancelled-tenant purge and consent-evidence windows

Two windows for ended self-serve accounts are platform settings, edited with PUT /admin/v1/settings/<key> (platform admin). They replace the retired AIG_SELF_SERVE_PURGE_DAYS and AIG_CONSENT_RETENTION_DAYS environment variables, which the gateway no longer reads.

Setting Controls Range Default (no row)
self_serve_purge_days Days after the subscription ends before the tenant is hard-purged (warnings go out 14 days and 1 day before) 15–3650 90
consent_retention_days Days an erased tenant's AVV consent evidence is kept before deletion (0 = next sweep) 0–4018 1095

The hourly sweep reads both values each run, so a change applies on the next tick. There is no DELETE route: to return to the default, PUT 90 or 1095. Values below the floor or garbage are no longer clamped. If a stored value is invalid, or the settings database cannot be read, the sweep logs an error or warning and skips the dependent step for that tick (the purge ladder, or the consent-evidence deletion) rather than deleting on a guessed window; the other cleanup steps still run. A malformed stored value additionally raises the operator alert retention_setting_malformed (at most about twice a week while it persists).

What the purge keeps: billing evidence for 730 days. The tenant purge deletes the organisation and its data, but not the records that prove the service was rendered and paid for. Request-log rows (personal data reset, billing facts kept), cost legs (user reference removed), daily usage (per-user rows folded into anonymous daily totals), the organisation-level spend ledger, the wallet transactions and wallet ledger, the tool-access decisions (with their arguments erased), the voucher redemptions and claims (account e-mail address and owner reference removed), the checkout sessions (sign-up scope replaced by a placeholder; for the checkout records of an abandoned or erased sign-up only the completed and duplicate ones are kept, open and expired ones are deleted), and the Anthropic usage snapshots younger than 730 days stay under the old organisation id, regardless of the per-tenant request_log_retention_days. They appear in no platform-wide list or report. Rows already older than 730 days are deleted by the purge. The impersonation sessions, the support access grants (free-text reason erased), the compliance report snapshots, and the sub-processor objections and sub-processor notices (no personal data) younger than 730 days are kept the same way, but as audit evidence rather than billing evidence, and the hourly sweep deletes them at 730 days (the support access grants once they are closed and 730 days old; an open grant is never deleted). The same holds for the configuration approval requests (requested less than 730 days ago; the held payload and summary are erased and a free-text failure reason is replaced by erased) and the portal context sessions (opened less than 730 days ago). Impersonation records of another organisation, or of the platform, that name a purged user are not part of this purge and are not counted in its retained counts. The hourly sweep deletes every impersonation record 730 days after it started, whichever organisation (or none) it belongs to. The hourly sweep deletes each remaining row once it is older than 730 days and, per purged organisation and committed batch, writes a counts-only Löschprotokoll audit row tenant.billing_evidence_deleted (batch, truncated, deleted and anonymised counts, legal_basis: "Art. 17(3)(b) DSGVO"). Where the optional ClickHouse analytics copy is enabled, the purge does not reach it (nothing in it is deleted or anonymised): its text expires after 14 days and its other personal fields after 730 days — see ClickHouse analytics sink. The organisation's entry in the purge registry is removed only when the work is done: nothing failed, nothing was truncated, the purge is at least 730 days old and no rows are left. That removal is its own transaction and writes its own row (registry_cleared: true, batch: 1, all counts 0). If a sweep faulted, the registry entry is kept so the next hourly sweep retries; the fault is recorded as a zero-count status row (batch: 0, failed: true, reason). The review history of agents (decisions, actors and times) is kept 730 days as well, also after the agent itself is deleted; for a purged organisation its free-text notes and reasons are erased, and for a user erasure those of the agents the erasure deletes, plus every note and reason the erased user wrote as a reviewer (also on agents that remain); the actor pointer is removed as well, the decision and its time stay. The sweep writes tenant.review_history_deleted for rows whose agent no longer exists (counts only), one row per committed batch with its batch number and truncated (set only on the last batch when the sweep stopped at its batch limit; the rest follows next hour). A failed delete or a row that cannot be written rolls that batch back and the next sweep retries; a zero-count status row (failed: true, reason) records the stop.

The delivery approvals of scheduled agent results (who decided, the kind of output and its machine-built size note such as email / 1234 chars, and the times; never the recipient or the answer) are decision evidence and are kept 730 days as well, both when an organisation is purged and when a single schedule, run, gateway or agent is deleted: an approval is no longer removed early. For a purged organisation, rows younger than 730 days stay unchanged and rows already older are deleted by the purge. The hourly sweep deletes the rows of a schedule, run, gateway or agent that no longer exists, or of an organisation that no longer exists, once they are 730 days old, and writes tenant.approval_history_deleted (counts only, one row per committed batch) with batch, truncated and the fault status row as for the review history. Such a row is no longer shown, can no longer be decided and is never delivered. The former early removal of decided approvals after 90 days no longer applies. When a single user is erased, the pointer to them as the deciding person is removed from the approvals they decided; the approvals themselves stay and age out after 730 days.

The human-review records (tool-call holds, flagged prompts and outputs, guardrail blocks, workflow holds: who requested, who decided, the kind, the status and the times) are decision evidence and are kept 730 days as well, whatever removed their gateway or organisation: deleting a gateway or an agent no longer removes them, and the former removal of decided reviews after 90 days no longer applies. A review whose gateway or organisation is gone is no longer shown and can no longer be decided; the held tool call (its exact arguments) is erased when the gateway is deleted. For a purged organisation, rows younger than 730 days stay with the reviewers' free-text decision notes, the guardrail summary and the held call erased, and rows already older are deleted by the purge. The hourly sweep deletes, once they are 730 days old, the reviews of a gateway or organisation that no longer exists and the reviews of a live gateway that are decided (a review still pending or awaiting a second reviewer, and a decided one a suspended workflow run still waits on, is never deleted), and writes tenant.review_item_history_deleted (counts only, one row per committed batch) with batch, truncated and the fault status row as for the review history. When a single user is erased, the free-text notes they wrote as a reviewer are erased and the pointer to them as the deciding person is removed, and the guardrail summary and subject of a review about them are erased; the review rows themselves stay and age out after 730 days. The deletion protocol of the purge itself lists the kept categories and the date they are kept until (deletion protocol).


Audit-log retention

To read the audit log itself, filter or export it, and verify its integrity, see Audit log. A governance template can check this window (audit_log_retention_days, check only) — it never changes it.

The audit log (audit_log) — the durable record of every mutating admin action and every security event — has its own global retention horizon, floored at six months. This is a single deployment-level window (a per-tenant clock cannot drive one global, chain-aware delete), configured by your operator:

Value Effect
unset Default 365 days.
< 180 (a numeric 0 or negative) Clamped up to the 180-day floor — the six-month minimum can never be undercut.
Non-numeric or non-finite (e.g. "abc", 1e999, NaN) Treated as unset → 365 days (still never below the 180-day floor).
180–3650 Retain audit events for that many days.
> 3650 Clamped down to the 3650-day (10-year) ceiling.

Tool-access decisions and erasure

Every tool-access decision is mirrored into the audit log in the same transaction as the decision row (entity_type = access_decision, action access_decision.recorded). The mirror carries every column of the decision except the masked arguments, so it holds the argument hash but no argument text. If the mirror cannot be written, the decision is not written either and the access layer's write-failure policy applies. Mirror rows are sealed into the hash chain like any other audit row and are hidden from the audit-event list and export, which show administrative events only.

  • User erasure (hard_delete_user) nulls args_masked and sets args_masking = erased on every decision where the user is the owner or the acting user. The decision row and its hash survive as audit evidence. The sealed mirror is untouched, so chain verification still passes after erasure.
  • Tenant purge keeps the tenant's decision rows younger than 730 days as audit evidence, with the arguments erased, and deletes the older ones. The kept rows are hidden from the list, single-record view, facets and export, and the hourly retention sweep deletes them at 730 days. The sealed mirrors stay and age out with the global audit-log horizon.
  • Sealer capacity. The hourly sealer processes up to 200,000 rows per run (400 batches of 500). A sustained decision rate above about 55 per second leaves a backlog, which raises the alert aig_audit_chain_unsealed_over_1h.

Retention is chain-aware (never breaks tamper-evidence)

Audit-log retention is coupled to the tamper-evidence hash-chain (see Tamper-evidence) by design: the pruner deletes only whole checkpointed ranges, oldest first, and never the most recent range. A retained event therefore always still chains from a trusted checkpoint anchor, so integrity verification keeps working across the pruning boundary. Each pruned checkpoint range is its own delete transaction and writes its own counts-only Löschprotokoll audit row (audit_log.retention_purged, with from_seal_seq, up_to_seal_seq and pruned) in that same transaction — never content. The row is itself sealed into the chain, so the deletion is accountable and tamper-evident. A range whose row cannot be written is rolled back and retried by the next sweep; a fault adds a zero-count status row (pruned: 0, failed: true, reason is batch_fault or audit_row_failed).

Coupling. Because pruning is chain-aware, it runs only when the hash-chain is enabled. The chain is enabled per deployment by provisioning the encrypted audit_chain_key setting; there is no separate switch. Without a usable key the chain is off and that is reported (health summary flag, metric and an error log), the audit log is not sealed, and it is not pruned. When the key is first provisioned on a previously-keyless deployment, sealing catches up on the historical backlog and pruning then begins draining rows older than the horizon incrementally (at least two checkpoints are required before any range is deleted) — so confirm the horizon is intended before provisioning the key.