Data Retention Policy
Status: DRAFT Owner: Engineering / Legal Last Review: 2026-05-03 Applicable Standards: GDPR (Art. 5(1)(e), Art. 17) / SOC 2 (P4.2, CC6.5) / IRS Record Retention / SEC Rule 17a-4
1. Purpose
This document describes Equa’s current data retention practices, identifies gaps, and recommends a formal data lifecycle management framework. An equity management platform must balance GDPR data minimization with regulatory retention obligations for securities and tax records.2. Scope
3. Current Retention Implementation
3.1 Session Retention
Source:equa-server/modules/auth/src/sessions.ts, equa-server/modules/auth/src/lib/session-cleaning.ts
Sessions are one of the few data types with an explicit, automated retention and cleanup policy.
3.2 Magic Link Retention
Source:equa-server/modules/auth/src/magic-link.ts
Magic links are the second data type with automated lifecycle management. The cleanup function is called periodically to remove expired tokens.
3.3 Onboarding Session Retention
Source:equa-server/modules/persistence/lab/sql/migrations/2.33.0-onboarding-tables.sql
The
onboarding_sessions table has an expires_at column with a 24-hour default, and child tables (onboarding_files, onboarding_questions) cascade on delete.
3.4 Email Verification Retention
Source:equa-server/modules/persistence/src/schema.ts (EmailVerifications entity, line 799)
3.5 One-Time Code Retention
Source:equa-server/modules/persistence/src/schema.ts (Onetimecodes entity, line 835)
3.6 Soft Delete Mechanism
Source:equa-server/modules/common/src/lib/utility.ts (line 37)
The platform uses a deleted boolean flag on entities that extend the CreatedModifiedDeleted base class. This is the primary soft-delete mechanism — there is no separate DeletedRecords snapshot table.
Base class definition:
CreatedModifiedDeleted (soft-deletable):
Additionally, some hashed entities use a standalone
deleted: boolean column (not via the base class):
Strengths:
- Preserves data for regulatory retention requirements
- Simple, consistent pattern across entities
- Timestamps available via
createdandmodifiedfrom the base class
- No automatic purge schedule — soft-deleted records accumulate indefinitely
- No distinction between regulatory-hold deletions and routine cleanup
- No
deletedByfield to track who performed the deletion - No
deletedAttimestamp separate frommodified(themodifiedcolumn updates on soft delete, but is ambiguous) - No mechanism to permanently purge records after retention periods expire
4. Regulatory Retention Requirements
4.1 Securities Records
4.2 Tax Records
4.3 General PII
5. Recommended Retention Schedule
Tier 1: Permanent Retention
Records that must be retained as long as the organization exists on the platform:- Stock transfer ledger entries (
Shareholdings,Transactions) - Share class definitions (
SecurityTypes,SecurityTypeShares) - Board resolution records (
Authorizations) - Certificate issuance and cancellation records (
Shareholdings) - Operating agreements (
OperatingAgreements)
Tier 2: Long-Term Retention (7 years)
Records retained for 7 years after the relevant event:- Equity grant agreements (
Options,Plans) — 7 years after termination/expiry/exercise - 409A valuation reports (
Filesin data room) — 7 years after the later of grant exercise or expiry - Tax filing data (
TaxIds, Form 3921/1099 records) - Cap table snapshots (
Holdings) — 7 years from snapshot date - Financial transaction records (
Transactions)
Tier 3: Medium-Term Retention (3 years)
Records retained for 3 years after creation or last activity:- Audit log entries (
EventLogs, non-financial) - User activity logs
- Email delivery records
- Task completion records (
Tasks)
Tier 4: Short-Term Retention (1 year)
Records retained for 1 year:- Authentication logs (login/logout events)
- API access logs
- Session records beyond the 29-day active window
- Failed authentication attempts
Tier 5: Transient (30 days or less)
Records that should be purged regularly:- Expired session data (currently 42 minutes — implemented)
- Magic link tokens (currently 15 minutes — implemented)
- Onboarding sessions (24-hour
expires_at— schema exists, cleanup TBD) - Email verification codes (no expiry — gap)
- One-time codes (no expiry — gap)
- Temporary upload staging files
- Cache entries
6. Implementation Recommendations
Phase 1: Policy Documentation
- Formalize this document as the official data retention policy
- Classify all data tables into the retention tiers above
- Document legal holds — process for suspending retention-based deletion when litigation or regulatory investigation is anticipated
Phase 2: Automated Lifecycle Management
- Retention tags — Add a
retentionTierandretentionExpirymetadata column to key tables or a central retention registry - Purge jobs — Implement scheduled jobs that:
- Identify records past their retention expiry
- Check for legal holds before purging
- Permanently delete (not soft-delete) expired records
- Log all purge actions to the audit trail
- Soft-delete cleanup — Add retention expiry tracking to soft-deleted records so they are eventually purged after regulatory retention periods expire
- Transient data cleanup — Implement cleanup jobs for
EmailVerifications,Onetimecodes, andonboarding_sessions
Phase 3: User-Facing Data Lifecycle
- Data export — Allow users to export their data before account closure (see Data Privacy and GDPR)
- Account deletion — Implement a full account deletion workflow that:
- Exports user data (for portability)
- Soft-deletes user records with appropriate retention tags
- Anonymizes audit trail entries after retention period
- Permanently purges all PII after regulatory retention periods expire
- Retention dashboard — Admin view showing data volumes by retention tier and upcoming purge schedules
Phase 4: Compliance Reporting
- Retention compliance report — Show adherence to retention schedules
- Data inventory — Automated discovery and classification of all stored PII
- Purge audit log — Tamper-evident record of all data purges for regulatory review