/privacy-skills-complete:designing-privacy-preserving-analyticsfrom privacy-skills-complete
Designs privacy-preserving analytics using differential privacy, k-anonymity, and related techniques. Covers privacy budget allocation, epsilon tracking, and Python implementations for GDPR-compliant analysis.
Ships in privacy-skills-complete. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
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.
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 Range | Privacy Level | Typical Use Cases |
|---|---|---|
| 0.01 — 0.1 | Very strong | Medical research, genetic data, highly sensitive analytics |
| 0.1 — 1.0 | Strong | General-purpose analytics, demographic analysis |
| 1.0 — 5.0 | Moderate | Aggregate business metrics, trend analysis |
| 5.0 — 10.0 | Weak | Low-sensitivity counts, already-public statistics |
Key Libraries:
| Library | Maintainer | Language | Mechanism Types |
|---|---|---|---|
| Google DP Library | C++/Java/Go | Laplace, Gaussian, partition selection | |
| OpenDP | Harvard IQSS & Microsoft | Rust/Python | Composable framework, Laplace, Gaussian, exponential |
| Apple PPML | Apple | Swift | Local DP, count-mean-sketch, Hadamard response |
| IBM diffprivlib | IBM Research | Python | Scikit-learn compatible, ML with DP |
| PyDP | OpenMined | Python (C++ backend) | Python wrapper around Google DP library |
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:
Limitations: k-anonymity does not protect against attribute disclosure when sensitive values within an equivalence class are homogeneous.
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:
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 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 Function | Epsilon Allocation | Refresh Cadence | Justification |
|---|---|---|---|
| Daily active user counts | 0.1 per day | Daily | Low sensitivity, high frequency |
| Revenue by region | 0.5 per quarter | Quarterly | Medium sensitivity, aggregate metric |
| Feature usage patterns | 0.3 per month | Monthly | Used for product development under Art. 6(1)(f) |
| Customer churn analysis | 0.2 per quarter | Quarterly | Involves behavioral profiling |
| A/B test results | 0.1 per experiment | Per experiment | Binary outcome, low disclosure risk |
| Total annual budget | ≤ 8.0 | Sum across all functions with composition |
Budget Exhaustion Protocol:
┌──────────────────────────────────────────────────────────┐
│ 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) │
└──────────────────────────────────────────────────────────┘
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.
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.
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.
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.
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.
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.
Audit Trail — Log every privacy-preserving query with: timestamp, analyst identity, query hash, epsilon consumed, mechanism used, and cumulative budget remaining.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub mukul975/privacy-data-protection-skills --plugin privacy-skills-complete282 skills in this plugin
/42-cfr-part-2Implements 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./adequacy-assessmentGuides 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./age-gating-services2 plugins in one repository ship this exact skill · first indexed Jul 7, 2026
Other plugins' skills for the same job