| Great question. voxic11 is right that the AI Act creates a legal obligation that provides a lawful basis for processing under GDPR Article 6(1)(c). To add to that, Article 17(3)(b) specifically carves out an exemption to the right to erasure where retention is necessary to comply with a legal obligation. (So the defence works at both levels; you have a lawful basis to retain, and erasure requests don’t override it during the mandatory retention period). That said, GDPR data minimisation (Article 5(1)(c)) still constrains what you log. The library addresses this at write-time today, in that the pii config lets you SHA-256 hash inputs/outputs before they hit the log and apply regex redaction patterns, so personal data need never enter the chain in the first place. This enables the pattern of “Hash by default, only log raw where necessary for Article 12”. For cases where raw content must be logged (eg, full decision reconstruction for a regulator), we’re planning a dual-layer storage approach. The hash chain would cover a structural envelope (timestamps, decision ID, model ID, parameters, latency, hash pointers) while the actual PII-bearing content (input prompts, output text) would live in a separate referenced object. Erasure would then mean deleting the content object, and the chain would stay intact because it never hashed the raw content directly. The regulator would also therefore see a complete, tamper-evident chain of system activity. |