From 984002f3afba5e79a33140fadf860739e93242b5 Mon Sep 17 00:00:00 2001 From: Cemil ILIK Date: Sun, 18 Oct 2026 10:15:01 +0300 Subject: [PATCH] docs(usermanuals): rewrite the GDPR / KVKK page to what ForgeLM does The page promised more than the code delivers, in the place a data-protection officer would read first: - "By the time data lands in JSONL, identifiable subjects are removed" and "no specific person's data is recoverable from the model. The audit report confirms this." ForgeLM masks eight identifier formats (email, phone, card, IBAN and the TR/DE/FR/US national IDs); names, addresses and free text are not detected, the patterns are tuned to miss borderline matches, and nothing measures what a trained model remembers. - "Detect memorisation: the audit step flags rows that overlap with known PII patterns" described PII detection as if it were memorisation detection. - The audit report was said to attribute rows to source documents and to carry a SHA-256 manifest. It does neither (it records counts and summaries, the audit's own metadata, and an optional Croissant card) and is not written to the audit log. - `retention` was said to "auto-delete originals" and to "record the intended TTL in the audit log". The horizons are only reported by `forgelm purge --check-policy`, which always exits 0. - An `ingestion: pii_mask:` YAML block and an `international_transfers.enabled` setting were shown; neither exists (the schema-drift guard skips unknown top-level keys, which is how they passed). The access and erasure sections now point at what exists: `forgelm reverse-pii` to find a subject's identifier in the files you give it, `forgelm purge --row-id` to remove rows (both write to the audit log), and the raw sources searched separately. English and Turkish. A reader can no longer cite this page for "personal data is removed before training" or "the model cannot reproduce a person's data". The page now says what the detectors cover and that coverage is partial. Refs #101 Co-Authored-By: Claude Sonnet 5.5 --- CHANGELOG.md | 7 ++++ docs/usermanuals/en/compliance/gdpr.md | 46 +++++++++++--------------- docs/usermanuals/tr/compliance/gdpr.md | 44 +++++++++++------------- 3 files changed, 46 insertions(+), 51 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d44dd02..7e08293a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,6 +68,13 @@ All notable changes to ForgeLM are documented here. ### Fixed +- Rewrite the GDPR / KVKK user-manual page (English and Turkish) to what ForgeLM does. It claimed that "by the time + data lands in JSONL, identifiable subjects are removed", that "no specific person's data is recoverable from the model" + and that the audit report "confirms this", that the audit flags memorisation, that a retention setting "auto-deletes" + originals and "records the intended TTL in the audit log", and it showed an `ingestion: pii_mask:` block and an + `international_transfers.enabled` setting that do not exist. Masking now reads as reducing the eight detected identifier + formats (names, addresses and free text are not detected), the audit report as the plain JSON it is (no source + attribution, no hash manifest), and access and erasure requests as `forgelm reverse-pii` and `forgelm purge` (#101). - Fix the KTO bullet on the Alignment overview user-manual page (English and Turkish): it named the fields `(prompt, response, good?)`, but the KTO loader reads `prompt`, `completion` and a boolean `label` (#965). diff --git a/docs/usermanuals/en/compliance/gdpr.md b/docs/usermanuals/en/compliance/gdpr.md index d8783dbe..fa2f8e6d 100644 --- a/docs/usermanuals/en/compliance/gdpr.md +++ b/docs/usermanuals/en/compliance/gdpr.md @@ -5,7 +5,7 @@ description: Data protection compliance — PII minimisation, data subject right # GDPR / KVKK -GDPR (Europe) and KVKK (Türkiye) impose data protection requirements on personal data used in training. ForgeLM's role: prevent personal data from entering training in the first place, document what gets ingested, and produce evidence for data subject requests. +GDPR (Europe) and KVKK (Türkiye) impose data protection requirements on personal data used in training. ForgeLM's role is narrower than keeping personal data out of training: it masks the identifier formats it can detect, reports what an audit found, and gives you commands for access and erasure requests. It does not decide your lawful basis, it does not find names or other free-text personal data, and it does not make a trained model anonymous. ## What GDPR / KVKK require for training data @@ -25,40 +25,35 @@ KVKK (Türkiye) mirrors these principles closely. ### Data minimisation (Art. 5(1)(c)) -PII masking at ingest replaces personal identifiers with placeholders: +PII masking at ingest replaces the identifier formats ForgeLM detects with a placeholder: -```yaml -ingestion: - pii_mask: - enabled: true - locale: "tr" - categories: ["email", "phone", "iban", "id_tr"] +```shell +$ forgelm ingest ./policies/ --recursive --strategy markdown --pii-mask --output data/policies.jsonl ``` -By the time data lands in JSONL, identifiable subjects are removed. See [PII Masking](#/data/pii-masking). +The detectors cover email, phone, credit card, IBAN, and the Turkish, German, French and US national-ID formats; every match becomes `[REDACTED]`. **Names, addresses, dates of birth, health data and other free text are not detected**, and the patterns are tuned to miss a borderline match rather than redact ordinary prose. Masking reduces the personal data in the JSONL; it does not remove identifiable subjects from it. See [PII Masking](#/data/pii-masking). ### Accountability (Art. 5(2)) -Every audit produces `data_audit_report.json` documenting: +Every `forgelm audit` run writes `data_audit_report.json`. It records: -- Detected PII categories and counts (before masking). -- Source attribution (which document each row came from). -- Quality and language distribution. -- SHA-256 manifest for tamper-evidence. +- Detected PII and secret categories with their counts, for the data you audited. Audit the unmasked source to see what a masker has to catch; audit the masked output to see what got through. +- Near-duplicate, quality and cross-split-overlap summaries, and an optional Croissant card. +- The audit's own metadata: when it ran, and the path and literal input it was given. -These reports flow into the Annex IV bundle. When a regulator asks "what personal data was in your training set?", you have a structured answer. +The report does not attribute rows to source documents, carries no hash manifest, and is a plain JSON file: it is not itself written to the audit log. Erasure and access requests (`forgelm purge`, `forgelm reverse-pii`) are, in the hash-chained log that `forgelm verify-audit` checks. When the report sits in `training.output_dir`, it feeds the Article 10 data-governance section of the Annex IV bundle, so a regulator's "what personal data was in your training set?" has a structured answer: what the detectors found, not a statement that none exists. ### Storage limitation (Art. 5(1)(e)) -ForgeLM doesn't retain raw user data — it produces JSONL artifacts you control. For automated retention enforcement: +ForgeLM doesn't retain raw user data — it produces JSONL artifacts you control. Retention horizons can be declared and are **reported, not enforced**: ```yaml retention: - raw_documents_retention_days: 90 # auto-delete originals after N days + raw_documents_retention_days: 90 ephemeral_artefact_retention_days: 365 ``` -(The actual deletion is your storage layer's responsibility; ForgeLM just records the intended TTL in the audit log.) +`forgelm purge --check-policy --config config.yaml` lists artefacts that are past their horizon and always exits 0. Nothing is deleted automatically and nothing is written to the audit log for it; deleting what is overdue is your storage layer's job. (`retention.enforce` is reserved: no command acts on it yet.) ## Data subject requests @@ -68,30 +63,29 @@ Most-common request types and how ForgeLM helps: "What personal data do you hold about me?" -Run reverse-PII on your training data: +Search your training data for the person's identifier: ```shell $ forgelm reverse-pii --query "ali@example.com" data/*.jsonl -No matches found in masked data. ``` -Because PII was masked at ingest, no specific person's data is recoverable from the model. The audit report confirms this. +The scan reports the lines where the identifier appears; zero matches is a valid answer. It finds what is literally in the files you point it at. Masking only removes the identifier formats it detects, so a name or an undetected variant can remain, and the raw source documents are not covered by a scan of the masked JSONL: search those separately. ForgeLM cannot tell you what a trained model remembers. ### Right to erasure (Art. 17) "Delete my data." If a person's data was in your training set: -1. The masked JSONL doesn't contain their identifying info — already minimised. -2. Source documents may still — drop them from your raw store and re-ingest if necessary. +1. Find the rows with `forgelm reverse-pii`, then remove them with `forgelm purge --row-id --corpus `; every erasure is written to the audit log. +2. Source documents may still hold it — drop them from your raw store and re-ingest if necessary. 3. The model may have memorised some details — see "model-level erasure" below. ### Model-level erasure LLMs can memorise rare strings from training. Even with PII masking, removing all traces from a deployed model is hard. ForgeLM's defences: -- **Prevent memorisation:** PII masking, deduplication (memorised data is usually duplicated data). -- **Detect memorisation:** the audit step flags rows that overlap with known PII patterns. +- **Reduce what goes in:** PII masking and deduplication (memorised data is usually duplicated data). +- **Memorisation is not measured:** ForgeLM does not test whether a trained model reproduces a given string. - **Re-train as last resort:** if a specific subject's data leaked despite masking, re-train without that source. For zero-tolerance scenarios (medical, legal), pair PII masking with manual review before training. @@ -122,7 +116,7 @@ ForgeLM has no YAML surface for GDPR legal metadata (lawful basis, data controll ::: :::warn -**International transfers.** If your training data crosses jurisdiction boundaries (Turkish data trained in EU, EU data trained in US), additional safeguards apply. Set `international_transfers.enabled: true` and document the safeguards. +**International transfers.** If your training data crosses jurisdiction boundaries (Turkish data trained in EU, EU data trained in US), additional safeguards apply. ForgeLM has no setting for transfers; record the safeguards in your DPIA. ::: :::tip diff --git a/docs/usermanuals/tr/compliance/gdpr.md b/docs/usermanuals/tr/compliance/gdpr.md index d8f425a3..21c8f61b 100644 --- a/docs/usermanuals/tr/compliance/gdpr.md +++ b/docs/usermanuals/tr/compliance/gdpr.md @@ -5,7 +5,7 @@ description: Veri koruma uyumluluğu — PII minimizasyonu, veri sahibi hakları # GDPR / KVKK -GDPR (Avrupa) ve KVKK (Türkiye), eğitimde kullanılan kişisel verilere koruma gereklilikleri getirir. ForgeLM'in rolü: kişisel verinin eğitime girmesini en başta engellemek, ne girdiğini belgelemek ve veri sahibi talepleri için kanıt üretmek. +GDPR (Avrupa) ve KVKK (Türkiye), eğitimde kullanılan kişisel verilere koruma gereklilikleri getirir. ForgeLM'in rolü, kişisel veriyi eğitimden uzak tutmaktan daha dardır: tespit edebildiği tanımlayıcı biçimlerini maskeler, bir audit'in bulduğunu raporlar ve erişim ile silme talepleri için size komutlar verir. Hukuki dayanağınızı belirlemez, isimleri ya da diğer serbest-metin kişisel verileri bulmaz ve eğitilmiş bir modeli anonim yapmaz. ## GDPR / KVKK eğitim verisinde ne ister @@ -25,40 +25,35 @@ KVKK (Türkiye) bu ilkeleri yakından yansıtır. ### Veri minimizasyonu (Md. 5(1)(c)) -Ingest'te PII maskeleme kişisel tanımlayıcıları placeholder'larla değiştirir: +Ingest'te PII maskeleme, ForgeLM'in tespit ettiği tanımlayıcı biçimlerini bir placeholder ile değiştirir: -```yaml -ingestion: - pii_mask: - enabled: true - locale: "tr" - categories: ["email", "phone", "iban", "id_tr"] +```shell +$ forgelm ingest ./policies/ --recursive --strategy markdown --pii-mask --output data/policies.jsonl ``` -Veri JSONL'a düştüğünde tanımlanabilir özneler kaldırılmıştır. Bkz. [PII Maskeleme](#/data/pii-masking). +Dedektörler e-posta, telefon, kredi kartı, IBAN ile Türk, Alman, Fransız ve ABD ulusal kimlik biçimlerini kapsar; her eşleşme `[REDACTED]` olur. **İsimler, adresler, doğum tarihleri, sağlık verisi ve diğer serbest metin tespit edilmez**; desenler sıradan düzyazıyı maskelemek yerine sınırda bir eşleşmeyi kaçırmaya ayarlıdır. Maskeleme JSONL'daki kişisel veriyi azaltır; tanımlanabilir özneleri ondan kaldırmaz. Bkz. [PII Maskeleme](#/data/pii-masking). ### Hesap verebilirlik (Md. 5(2)) -Her audit aşağıdakileri belgeleyen `data_audit_report.json` üretir: +Her `forgelm audit` çalıştırması `data_audit_report.json` yazar. İçeriği: -- Tespit edilen PII kategorileri ve sayıları (maskelemeden önce). -- Kaynak atfı (her satırın hangi dokümandan geldiği). -- Kalite ve dil dağılımı. -- Tamper-evidence için SHA-256 manifest. +- Denetlediğiniz veri için tespit edilen PII ve gizli bilgi kategorileri ve sayıları. Bir maskelemenin neyi yakalaması gerektiğini görmek için maskelenmemiş kaynağı, neyin sızdığını görmek için maskelenmiş çıktıyı denetleyin. +- Near-duplicate, kalite ve split-arası örtüşme özetleri ile isteğe bağlı bir Croissant kartı. +- Audit'in kendi üst verisi: ne zaman çalıştığı, ona verilen yol ve girdi. -Bu raporlar Annex IV paketine akar. Regülatör "eğitim setinizde hangi kişisel veriler vardı?" diye sorduğunda yapılandırılmış cevabınız olur. +Rapor satırları kaynak dokümanlara atfetmez, hash manifest taşımaz ve düz bir JSON dosyasıdır: kendisi audit log'a yazılmaz. Silme ve erişim talepleri (`forgelm purge`, `forgelm reverse-pii`) ise `forgelm verify-audit`'in denetlediği hash-zincirli log'a yazılır. Rapor `training.output_dir` içindeyse Annex IV paketinin Madde 10 veri yönetişimi bölümünü besler; böylece regülatörün "eğitim setinizde hangi kişisel veriler vardı?" sorusunun yapılandırılmış bir cevabı olur: dedektörlerin bulduğu, hiç olmadığına dair bir beyan değil. ### Saklama sınırlaması (Md. 5(1)(e)) -ForgeLM ham kullanıcı verisini saklamaz — sizin kontrol ettiğiniz JSONL artifact'lar üretir. Otomatik saklama uygulanması için: +ForgeLM ham kullanıcı verisini saklamaz — sizin kontrol ettiğiniz JSONL artifact'lar üretir. Saklama ufukları tanımlanabilir ve **raporlanır, zorlanmaz**: ```yaml retention: - raw_documents_retention_days: 90 # N gün sonra orijinalleri otomatik sil + raw_documents_retention_days: 90 ephemeral_artefact_retention_days: 365 ``` -(Asıl silme depolama katmanınızın sorumluluğu; ForgeLM sadece amaçlanan TTL'yi audit log'a kaydeder.) +`forgelm purge --check-policy --config config.yaml` ufku aşmış artefaktları listeler ve her zaman 0 ile çıkar. Hiçbir şey otomatik silinmez ve bunun için audit log'a bir şey yazılmaz; süresi geçeni silmek depolama katmanınızın işidir. (`retention.enforce` ayrılmıştır: henüz hiçbir komut onu kullanmaz.) ## Veri sahibi talepleri @@ -68,21 +63,20 @@ En sık talep tipleri ve ForgeLM nasıl yardım eder: "Hakkımda hangi kişisel verileri tutuyorsunuz?" -Eğitim verinizde reverse-PII koşturun: +Kişinin tanımlayıcısını eğitim verinizde arayın: ```shell $ forgelm reverse-pii --query "ali@example.com" data/*.jsonl -Maskelenmiş veride eşleşme bulunamadı. ``` -PII ingest'te maskelendiği için modelden belirli birinin verisi geri çıkarılamaz. Audit raporu bunu teyit eder. +Tarama, tanımlayıcının geçtiği satırları raporlar; sıfır eşleşme geçerli bir cevaptır. Yalnızca işaret ettiğiniz dosyalarda gerçekten bulunanı bulur. Maskeleme yalnızca tespit ettiği tanımlayıcı biçimlerini kaldırır; bir isim ya da tespit edilemeyen bir varyant kalabilir ve maskelenmiş JSONL taraması ham kaynak dokümanları kapsamaz: onları ayrıca arayın. ForgeLM eğitilmiş bir modelin neyi hatırladığını söyleyemez. ### Silme hakkı (Md. 17) "Verilerimi silin." Bir kişinin verisi eğitim setinizdeydi: -1. Maskelenmiş JSONL kimlik bilgilerini içermiyor — zaten minimize edilmiş. +1. Satırları `forgelm reverse-pii` ile bulun, sonra `forgelm purge --row-id --corpus ` ile kaldırın; her silme audit log'a yazılır. 2. Ham kaynak dokümanlar hâlâ içerebilir — ham deponuzdan düşürün ve gerekirse yeniden ingest edin. 3. Model bazı detayları ezberlemiş olabilir — aşağıdaki "model-seviyesi silme"ye bakın. @@ -90,8 +84,8 @@ Bir kişinin verisi eğitim setinizdeydi: LLM'ler eğitimden nadir string'leri ezberleyebilir. PII maskelemeyle bile deploy edilmiş bir modelden tüm izleri kaldırmak zordur. ForgeLM'in savunmaları: -- **Ezberi önle:** PII maskeleme, deduplikasyon (ezberlenen veri genelde tekrarlanan veridir). -- **Ezberi tespit et:** Audit aşaması bilinen PII pattern'leriyle örtüşen satırları flagler. +- **Girenleri azalt:** PII maskeleme ve deduplikasyon (ezberlenen veri genelde tekrarlanan veridir). +- **Ezber ölçülmez:** ForgeLM, eğitilmiş bir modelin belirli bir string'i üretip üretmediğini test etmez. - **Son çare yeniden eğitim:** Maskelemeye rağmen belirli bir öznenin verisi sızdıysa, o kaynak olmadan yeniden eğitin. Sıfır-tolerans senaryolarda (sağlık, hukuk) PII maskelemeyi eğitimden önce manuel inceleme ile birleştirin. @@ -122,7 +116,7 @@ ForgeLM'in GDPR hukuki meta verisi (hukuki dayanak, veri sorumlusu vb.) için YA ::: :::warn -**Uluslararası transferler.** Eğitim veriniz yargı sınırlarını aşıyorsa (Türk verisi AB'de eğitiliyor, AB verisi ABD'de eğitiliyor), ek koruma önlemleri uygulanır. `international_transfers.enabled: true` ayarlayın ve koruma önlemlerini belgeleyin. +**Uluslararası transferler.** Eğitim veriniz yargı sınırlarını aşıyorsa (Türk verisi AB'de eğitiliyor, AB verisi ABD'de eğitiliyor), ek koruma önlemleri uygulanır. ForgeLM'in transferler için bir ayarı yoktur; koruma önlemlerini DPIA'nıza kaydedin. ::: :::tip