本文へ移動
cccskills
無料GitHub で公開

designing-privacy-preserving-analytics

Design privacy-preserving analytics systems using differential privacy, k-anonymity, l-diversity, and t-closeness. Covers privacy budget allocation with epsilon tracking, references Google DP library, OpenDP, and Apple PPML. Includes Python differential privacy implementation for GDPR-compliant statistical analysis.

インストール方法を見る

含まれるファイル(5)

  • SKILL.md12.0 KB
  • assets/template.md3.3 KB
  • references/standards.md3.8 KB
  • references/workflows.md5.9 KB
  • scripts/process.py15.6 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Designing Privacy-Preserving Analytics

Overview

Privacy-preserving analytics enables organizations to extract statistical insights from personal data without exposing individual-level information. This directly supports GDPR Article 5(1)(c) (data minimization) and Recital 26 (which exempts truly anonymous data from the regulation). The Article 29 Working Party Opinion 05/2014 on Anonymisation Techniques (WP216) established that effective anonymization must resist singling out, linkability, and inference attacks.

Four primary statistical disclosure control techniques form the foundation of privacy-preserving analytics: differential privacy, k-anonymity, l-diversity, and t-closeness. Each offers different trade-offs between privacy guarantees and data utility.

Statistical Disclosure Control Techniques

Differential Privacy

Differential privacy (Dwork et al., 2006) provides a mathematical guarantee that the output of an analysis is approximately the same whether or not any single individual's data is included. Formally, a randomized mechanism M satisfies (epsilon, delta)-differential privacy if for all datasets D1 and D2 differing in at most one record, and for all sets of outputs S:

P[M(D1) ∈ S] ≤ e^ε × P[M(D2) ∈ S] + δ

Where epsilon (ε) is the privacy loss parameter and delta (δ) bounds the probability of privacy breach.

Privacy Budget Allocation:

Epsilon RangePrivacy LevelTypical Use Cases
0.01 — 0.1Very strongMedical research, genetic data, highly sensitive analytics
0.1 — 1.0StrongGeneral-purpose analytics, demographic analysis
1.0 — 5.0ModerateAggregate business metrics, trend analysis
5.0 — 10.0WeakLow-sensitivity counts, already-public statistics

Key Libraries:

LibraryMaintainerLanguageMechanism Types
Google DP LibraryGoogleC++/Java/GoLaplace, Gaussian, partition selection
OpenDPHarvard IQSS & MicrosoftRust/PythonComposable framework, Laplace, Gaussian, exponential
Apple PPMLAppleSwiftLocal DP, count-mean-sketch, Hadamard response
IBM diffprivlibIBM ResearchPythonScikit-learn compatible, ML with DP
PyDPOpenMinedPython (C++ backend)Python wrapper around Google DP library

k-Anonymity

A dataset satisfies k-anonymity (Sweeney, 2002) if every record is indistinguishable from at least k-1 other records with respect to quasi-identifier attributes. Quasi-identifiers are attributes that could be combined with external data to re-identify individuals (e.g., age, postal code, gender).

Implementation approach:

  1. Identify quasi-identifiers in the dataset
  2. Apply generalization hierarchies (e.g., age 27 → age range 25-30, postal code 8001 → 80**)
  3. Apply suppression for records that cannot achieve k-anonymity through generalization alone
  4. Verify k-value across all equivalence classes

Limitations: k-anonymity does not protect against attribute disclosure when sensitive values within an equivalence class are homogeneous.

l-Diversity

l-Diversity (Machanavajjhala et al., 2007) extends k-anonymity by requiring that each equivalence class contains at least l "well-represented" values of the sensitive attribute. This prevents attribute disclosure attacks.

Variants:

  • Distinct l-diversity: Each equivalence class has at least l distinct sensitive values
  • Entropy l-diversity: Entropy of sensitive values in each class ≥ log(l)
  • Recursive (c,l)-diversity: The most frequent sensitive value appears less than c times the frequency of the least frequent value

t-Closeness

t-Closeness (Li et al., 2007) requires that the distribution of a sensitive attribute in any equivalence class is within distance t of the distribution of the attribute in the entire dataset, measured using Earth Mover's Distance (EMD).

This prevents skewness attacks where an adversary can infer sensitive attributes from the distribution within an equivalence class, even when l-diversity is satisfied.

Privacy Budget Management

Privacy budgets track cumulative privacy loss across multiple queries. Under sequential composition, the total privacy loss is the sum of individual epsilons. Under parallel composition (disjoint subsets), the total privacy loss is the maximum individual epsilon.

Budget Allocation Framework for Prism Data Systems AG:

Analytics FunctionEpsilon AllocationRefresh CadenceJustification
Daily active user counts0.1 per dayDailyLow sensitivity, high frequency
Revenue by region0.5 per quarterQuarterlyMedium sensitivity, aggregate metric
Feature usage patterns0.3 per monthMonthlyUsed for product development under Art. 6(1)(f)
Customer churn analysis0.2 per quarterQuarterlyInvolves behavioral profiling
A/B test results0.1 per experimentPer experimentBinary outcome, low disclosure risk
Total annual budget≤ 8.0Sum across all functions with composition

Budget Exhaustion Protocol:

  1. When 80% of annual budget is consumed, alert the Data Protection Officer
  2. When 95% is consumed, require DPO approval for each additional query
  3. When 100% is consumed, block all further differentially private queries until the next budget period
  4. Emergency queries require joint approval from DPO and Chief Information Security Officer

Architecture Design

┌──────────────────────────────────────────────────────────┐
│                    Analyst Interface                      │
│              (SQL-like query submission)                  │
└──────────────────────┬───────────────────────────────────┘
                       │
┌──────────────────────▼───────────────────────────────────┐
│                 Privacy Gateway                           │
│  ┌─────────────┐  ┌──────────────┐  ┌────────────────┐  │
│  │ Query Parser │  │ Budget Check │  │ Sensitivity    │  │
│  │ & Validator  │  │ (ε tracker)  │  │ Calibration    │  │
│  └──────┬──────┘  └──────┬───────┘  └───────┬────────┘  │
│         └────────────────┼──────────────────┘            │
└──────────────────────────┼───────────────────────────────┘
                           │
┌──────────────────────────▼───────────────────────────────┐
│              Noise Injection Layer                        │
│  ┌──────────────┐  ┌──────────────┐  ┌───────────────┐  │
│  │ Laplace      │  │ Gaussian     │  │ Exponential   │  │
│  │ Mechanism    │  │ Mechanism    │  │ Mechanism     │  │
│  └──────────────┘  └──────────────┘  └───────────────┘  │
└──────────────────────────┬───────────────────────────────┘
                           │
┌──────────────────────────▼───────────────────────────────┐
│              Data Processing Layer                        │
│  ┌─────────────────┐  ┌──────────────────────────────┐   │
│  │ k-Anonymization │  │ Aggregation Engine           │   │
│  │ Pre-processing  │  │ (min group size: 11)         │   │
│  └─────────────────┘  └──────────────────────────────┘   │
└──────────────────────────┬───────────────────────────────┘
                           │
┌──────────────────────────▼───────────────────────────────┐
│              Encrypted Data Store                         │
│         (Field-level AES-256-GCM encrypted)              │
└──────────────────────────────────────────────────────────┘

Implementation Workflow

  1. Classify Analytics Queries — Categorize each analytics use case by sensitivity (direct identifiers accessed, quasi-identifiers combined, sensitive attributes involved) and assign an epsilon budget allocation.

  2. Select Mechanism — Choose the appropriate noise mechanism based on query type: Laplace for counting queries, Gaussian for mean/variance queries requiring (ε,δ)-DP, exponential mechanism for selection queries.

  3. Calibrate Sensitivity — Determine the global sensitivity of each query function (maximum change in output when one record is added or removed). Use bounded sensitivity where possible by clipping input values.

  4. Implement Budget Tracking — Deploy a centralized privacy budget ledger that records every query's epsilon consumption, enforces composition bounds, and blocks queries when the budget is exhausted.

  5. Apply Pre-processing — Where differential privacy alone provides insufficient utility, apply k-anonymity as a pre-processing step to reduce the sensitivity of downstream DP queries.

  6. Validate Output — Verify that released statistics do not violate minimum group sizes (11 records per Prism Data Systems AG policy) and that confidence intervals are reported alongside noised results.

  7. Audit Trail — Log every privacy-preserving query with: timestamp, analyst identity, query hash, epsilon consumed, mechanism used, and cumulative budget remaining.

Key Regulatory References

  • GDPR Article 5(1)(c) — Data minimization principle
  • GDPR Article 5(1)(e) — Storage limitation
  • GDPR Article 25 — Data protection by design and by default
  • GDPR Article 89 — Safeguards for processing for scientific/historical research or statistical purposes
  • GDPR Recital 26 — Scope of anonymous information
  • GDPR Recital 162 — Statistical purposes
  • Article 29 Working Party Opinion 05/2014 on Anonymisation Techniques (WP216)
  • ENISA Report: Pseudonymisation techniques and best practices (November 2019)

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Implements 42 CFR Part 2 protections for substance use disorder patient records. Covers written consent requirements stricter than HIPAA, re-disclosure prohibition, court order procedures, qualified service organization agreements, and 2024 amendments aligning Part 2 with HIPAA. Keywords: 42 CFR Part 2, substance use disorder, SUD records, re-disclosure, consent, Part 2 amendments.

日本語の概要は準備中です。原文の説明を表示しています。

mukul975/Privacy-Data-Protection-Skills3032026年3月17日 更新

Guides assessment of third-country adequacy decisions under GDPR Article 45 for international data transfers. Covers the current EC adequacy decisions list, adequacy assessment criteria, partial adequacy handling, and monitoring of adequacy decision reviews. Keywords: adequacy decision, Article 45, third country, adequate protection, EC adequacy list.

日本語の概要は準備中です。原文の説明を表示しています。

mukul975/Privacy-Data-Protection-Skills3032026年3月17日 更新

Implements age-gating mechanisms for online services to restrict access based on user age. Covers hard gates versus soft gates, neutral age prompts, re-verification triggers, circumvention prevention, and regulatory requirements under GDPR, COPPA, UK Online Safety Act, and DSA. Keywords: age gate, age restriction, neutral prompt, children, online services, access control.

日本語の概要は準備中です。原文の説明を表示しています。

mukul975/Privacy-Data-Protection-Skills3032026年3月17日 更新

Evaluates and implements age estimation and verification technologies for online services. Covers facial age estimation, digital ID verification, self-declaration with risk assessment, AI-based age estimation, and the accuracy versus privacy tradeoff. Includes ICO guidance and euCONSENT framework. Keywords: age verification, age estimation, facial analysis, digital ID, children, online safety.

日本語の概要は準備中です。原文の説明を表示しています。

mukul975/Privacy-Data-Protection-Skills3032026年3月17日 更新

Preparing EU AI Act compliance documentation for high-risk AI systems. Covers Annex III classification, technical documentation under Art. 11, conformity assessment, risk management systems, and CE marking requirements. Keywords: EU AI Act, high-risk AI, Annex III, conformity assessment, CE marking.

日本語の概要は準備中です。原文の説明を表示しています。

mukul975/Privacy-Data-Protection-Skills3032026年3月17日 更新

Implements GDPR Art. 22 automated decision-making and AI Act Art. 14 human oversight requirements for AI systems. Covers identification of solely automated decisions, meaningful human intervention design, logic explanation mechanisms, and contestation procedures. Keywords: Art. 22, automated decision, human oversight, AI Act, profiling, contestation.

日本語の概要は準備中です。原文の説明を表示しています。

mukul975/Privacy-Data-Protection-Skills3032026年3月17日 更新

mukul975 のスキルをすべて見る

このスキルの問題を報告する