# 150 — Data Retention Schedule

> Status: Active · Owner: DPO + Head of Internal Audit · Last updated: 2026-11-28
> Authority: GDPR Art. 5(1)(e) (storage limitation) + Art. 30 (ROPA), UAE PDPL,
> KSA PDPL, SOX (financial-record retention), ISO 27001 A.5.33 / A.8.10.
> Source decision: security-hardening epic panel, 2026-06-17 (gap #5 vs competitor benchmark).

## 1. Purpose

This schedule is the single authoritative statement of **how long each class of
record is retained** in Osolix and **what happens at the end of that period**.
It satisfies the storage-limitation principle (keep personal data no longer than
necessary) while honouring the longer statutory windows that bind financial and
audit records.

It is published in summary form on the public Trust Center; this document is the
controlled internal master.

## 2. Retention principles

1. **Minimise by default.** A record class with no statutory or contractual
   driver gets the shortest operationally useful window.
2. **Financial and audit records win on conflict.** Where erasure of personal
   data would break an immutable financial or audit trail, the personal *fields*
   are redacted/pseudonymised but the row is retained for its statutory window
   (see §4 — the live `DataRetentionService` already implements this for users).
3. **Soft-delete is not retention.** `IsDeleted = true` (DG-2) hides a row from
   the application; the retention clock and the eventual hard-purge are separate
   and defined here.
4. **Tenant offboarding.** On contract termination, customer data enters a
   90-day recovery window, then is purged per the classes below, and a deletion
   certificate is issued to the tenant.

## 3. Retention schedule by record class

| Record class | Retention period | Trigger | Disposition at end | Basis |
|---|---|---|---|---|
| **Financial records** (GL journals, depreciation runs, revaluations, impairment, lease postings) | **7 years** | End of fiscal year | Archive then purge | SOX / IFRS / tax statute |
| **Audit trail** (`AuditLog`, approval/SoD events) | **7 years** | Record creation | Purge | SOX 404 / ISO 27001 A.8.15 |
| **Active customer business data** (assets, work orders, contracts, etc.) | Life of subscription + **90 days** | Subscription end | Purge + deletion certificate | Contract / DG-2 |
| **User account PII** (email, name, phone, MFA secret) after erasure request | **30 days** cooling-off, then permanent scrub | `IsDeleted` + `DeletedAt` | Irreversible field scrub (live: `DataRetentionService.RunDailyPurgeAsync`) | GDPR Art. 17 |
| **Consent / lawful-basis evidence** (`NotificationChannelConsent`) | Duration of relationship + **6 years** | Consent withdrawn | Retain row, redact raw destination (phone/email) | GDPR Art. 7(1) / Art. 30 |
| **Authentication & security events** (failed sign-ins, lockouts, step-up checks - written to `AuditLog` by `AuthController`) | **7 years** (same as the audit trail) | Event | Purge with the audit trail | ISO 27001 A.8.15; kept inside the hash-chained audit trail - deleting rows early would break its integrity (Decision 0339 correction: the earlier 12-month figure was never implemented) |
| **Application / request telemetry** (server and tunnel log files on the host: the host's `logs` folder: `api-*`, `tunnel-*`, `outage-*`; OpenTelemetry traces only if an exporter is configured) | **90 days** | File last write | Delete (live: `Remove-ExpiredHostLogs` in `deployment/home-host/host-ops.psm1`, run by the watchdog; Decision 0339) | Operational; minimisation |
| **AI invocation logs** (`AiInvocation` — PII-safe SHA-256 hashes only) | **24 months** | Invocation | Purge | AGC-6 governance evidence |
| **AI chat interaction events** (closed navigation/clarification codes; no user attribution) | **24 months** | Event capture | Purge | Aggregate usefulness measurement; minimisation |
| **Backups / PITR snapshots** | **35 days** rolling (Azure SQL PITR) + monthly archival **12 months** | Snapshot | Automatic rotation | DR (see [doc 64 restore-drill runbook]) |
| **Email-verification / password-reset tokens** | **24 hours** (single-use) | Issuance | Expire + purge | Security hygiene |
| **Marketing / prospect contact** (no subscription) | **24 months** from last engagement | Last contact | Purge unless re-engaged | Legitimate interest / consent |
| **Vehicle tracking** (`VehicleTelemetryEvent` position, driver link, provider payload; `VehicleTrip` driver link) | **90 days** (the driver-scoring window) | Event time | Columns cleared; trip summary and non-personal readings kept (`FleetPositionPrivacy`) | GDPR Art.5(1)(e); Decision 0337 |
| **Inspection and work-order photo positions** (`Dvir`, `WorkOrderAttachment`, `CpmAttachment` coordinates) | **12 months** (also cleared at account purge) | Inspection date / upload time | Coordinates cleared; the record stays | GDPR Art.5(1)(c)(e); Decision 0337 |
| **Accident-report positions** (`AccidentReport` coordinates) | **7 years** default (customer's limitation period may replace it); not removed by account erasure | Accident date | Coordinates cleared | GDPR Art.17(3)(e); Decision 0337 |
| **Field-app position stamps** (`AssetLocationPing` sources mobile-gps / mobile-pin; stamp columns on additions and transfers) | **12 months** (also erased at account purge) | Capture time | Hard delete / null-out (live: `DataRetentionService`); old audit snapshots redacted in place | GDPR Art. 5(1)(e), Art. 17; Decisions 0333, 0336 |
| **E1 keyed relationship-risk attributes** (`GraphRiskAttribute` — party ref + tenant-keyed HMAC + mask, no raw identifier) | **90 days** (`RelationshipRisk:RetentionDays`, default; configurable 1–3650) | Row creation | Soft-delete in the nightly purge (live: `RelationshipRiskService.PurgeExpiredRowsAsync`); counts-only audit | GDPR Art. 5(1)(e); Decision 0408 C2/C3 |
| **E1 open / confirmed relationship-risk alerts** (`GraphRiskAlert` in `Open` or `Confirmed` status; HMAC + mask evidence only) | **365 days** (`RelationshipRisk:AlertRetentionDays`, default; configurable, clamped 30–3650) | Alert creation | Soft-delete in the nightly purge; counts-only audit. Kept reviewable until then | GDPR Art. 5(1)(e); Decision 0408 C2 |
| **E1 dismissed relationship-risk alerts** | **90 days after review** (`RelationshipRisk:RetentionDays`) | `ReviewedAt` | Soft-delete (live: `RelationshipRiskService.PurgeDismissedAsync`); counts-only audit | GDPR Art. 5(1)(e); Decision 0408 C2 |

## 4. Implementation mapping

- **User PII 30-day scrub** — `Osolix.Infrastructure.Services.Privacy.DataRetentionService`
  (daily, via `DataRetentionHostedService`). Already live.
- **Financial / audit 7-year hold** — enforced by *not* exposing a hard-delete
  path on those entities; archival/purge job is a go-live ops task (tracked).
- **Token expiry** — handled in `IEmailVerificationService` / refresh-token TTL.
- **Telemetry 90-day** — collector retention config (set when `OtelExporter:Endpoint`
  is stood up per environment).
- **E1 keyed attributes / open and confirmed alerts** — `RelationshipRiskService`
  (`PurgeExpiredRowsAsync`) runs on the nightly shared GraphRuns scan, alongside
  the existing dismissed-alert purge. Both settings live under the `RelationshipRisk`
  configuration section; both purges are tenant-pinned, soft-delete only and log
  counts. A verified erasure dispatches `IPersonalDataErasureContributor` from the
  DSR evidence endpoint and soft-deletes the party's attributes plus matching alerts.

## 5. Review cadence

Reviewed annually by the DPO and Head of Internal Audit, or on any material
change to statutory retention requirements in an operating jurisdiction.
Changes are recorded in the decision log.
