MCPInstall

ai-federated-learning

Implements federated learning architecture patterns for GDPR compliance. Covers secure aggregation protocols, differential privacy integration, communication protocols, and privacy-by-design distributed ML training. Keywords: federated learning, distributed training, secure aggregation, differential privacy, privacy-preserving ML.

Installs
42
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/mukul975/privacy-data-protection-skills --skill ai-federated-learning
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads ai-federated-learning automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Federated Learning for GDPR Compliance

Overview

Federated learning (FL) is a distributed machine learning approach that trains models across multiple data holders without centralising personal data. Instead of collecting training data into a central repository, federated learning sends the model to the data, computes local updates on each participant's device or server, and aggregates only model updates (gradients or weights) at a central coordinator. This architecture directly addresses GDPR data minimisation (Art. 5(1)(c)) and data protection by design (Art. 25) principles by eliminating the need to transfer and centralise personal data for AI training. However, federated learning is not a privacy silver bullet — it introduces its own privacy risks that must be managed through complementary techniques.

Federated Learning Architecture Patterns

Pattern 1: Cross-Device Federated Learning

Use case: Training on data from millions of user devices (smartphones, tablets, IoT).

ComponentDescription
ParticipantsEnd-user devices (smartphones, tablets, wearables)
ScaleThousands to millions of participants
DataSmall per-device, large aggregate (e.g., keyboard predictions, health metrics)
CoordinationCentral server selects participants per round, distributes model, aggregates updates
CommunicationCompressed gradient updates over mobile networks
Privacy riskIndividual gradient updates may leak information about device data

GDPR Analysis:

  • Data minimisation: personal data never leaves the device — strong compliance
  • Controller role: platform operator is controller; device owners are not processors
  • Lawful basis: consent or legitimate interest for on-device processing
  • International transfers: no personal data transfer if aggregation is privacy-preserving
  • Right to erasure: device can be excluded from future rounds; model unlearning may be needed

Pattern 2: Cross-Silo Federated Learning

Use case: Training across organisational boundaries (hospitals, banks, subsidiaries).

ComponentDescription
ParticipantsOrganisational data silos (hospitals, branches, partner companies)
Scale2 to 100 participants
DataLarge per-silo, structured (e.g., medical records, financial transactions)
CoordinationTrusted aggregator or peer-to-peer protocol
CommunicationModel updates over secure channels between organisations
Privacy riskGradient updates may reveal institutional data patterns

GDPR Analysis:

  • Joint controller determination: participants and aggregator may be joint controllers (Art. 26) — requires joint controller agreement
  • Data processing agreements: if aggregator is a processor, Art. 28 DPA required
  • Data minimisation: personal data stays within each silo — strong compliance
  • International transfers: if silos are in different jurisdictions, gradient transfer legality depends on privacy guarantees
  • Lawful basis: each silo needs independent lawful basis for local training; aggregation needs separate basis

Pattern 3: Vertical Federated Learning

Use case: Different organisations hold different features for the same individuals.

ComponentDescription
ParticipantsOrganisations with complementary data (bank + retailer sharing customer features)
Scale2 to 10 participants
DataDifferent features for overlapping individuals
CoordinationSecure multi-party computation for feature combination
CommunicationEncrypted intermediate representations
Privacy riskFeature linkage may reveal individual attributes across parties

GDPR Analysis:

  • Joint controller: participants are likely joint controllers — each processes personal data for a common purpose
  • Purpose limitation: combined training purpose must be compatible with each party's original collection purpose
  • Data subject notification: data subjects must be informed about cross-organisation federated training
  • Consent: may be required for combining data across organisations

Secure Aggregation Protocols

Protocol 1: Masking-Based Secure Aggregation

Participants mask their local updates with pairwise random masks that cancel out upon aggregation. The aggregator receives the sum without seeing individual updates.

PropertyValue
Privacy guaranteeIndividual updates not visible to aggregator or other participants
Computational costO(n^2) pairwise key agreement, O(n) masking per round
Communication cost2x baseline (masks + masked updates)
Dropout toleranceHandles participant dropout if sufficient participants remain
Collusion resistanceSecure against aggregator + up to t-1 participant collusion

Protocol 2: Homomorphic Encryption Aggregation

Participants encrypt their updates with a homomorphic encryption scheme. The aggregator computes the sum on encrypted data without decryption.

PropertyValue
Privacy guaranteeComputationally secure — updates encrypted throughout
Computational cost100-1000x overhead for encryption/decryption operations
Communication cost2-10x baseline (ciphertext expansion)
Dropout toleranceExcellent — encrypted updates can be summed independently
Collusion resistanceSecure against aggregator (does not hold decryption key)

Protocol 3: Trusted Execution Environment (TEE)

Aggregation occurs within a hardware-protected enclave (Intel SGX, ARM TrustZone). Participants send updates to the TEE, which performs aggregation in isolated memory.

PropertyValue
Privacy guaranteeHardware-based isolation — aggregator cannot inspect updates
Computational costNear-native (small overhead for enclave transitions)
Communication costBaseline (no encryption expansion for enclave-to-enclave)
Dropout toleranceExcellent
Collusion resistanceDepends on hardware trust model; vulnerable to side-channel attacks

Differential Privacy Integration

Local Differential Privacy (LDP)

Each participant adds noise to their gradient update before sending to the aggregator:

  • Mechanism: Gaussian noise calibrated to sensitivity and privacy budget (epsilon, delta)
  • Guarantee: Individual update is differentially private — aggregator cannot infer specific data points
  • Trade-off: Higher noise reduces model accuracy; need more participants to compensate
  • Recommended epsilon: 1-10 per round, with privacy accounting across rounds

Central Differential Privacy (CDP)

The aggregator adds noise to the aggregated update before applying to the global model:

  • Mechanism: Gaussian noise added to the sum of clipped gradients
  • Guarantee: Global model is differentially private with respect to any single participant's data
  • Trade-off: Less noise needed than LDP for same accuracy (noise averages out); requires trusted aggregator
  • Recommended epsilon: 1-8 total privacy budget

Privacy Budget Management

ParameterDescriptionGuidance
Epsilon (ε)Privacy loss parameter — lower is more privateε ≤ 1: strong privacy; ε ≤ 8: moderate; ε > 10: weak
Delta (δ)Probability of privacy failureδ < 1/N where N is dataset size
Rounds (T)Number of federated training roundsPrivacy degrades with rounds — use composition theorems
Clip norm (C)Maximum gradient norm per participantBalance between privacy (lower C) and convergence (higher C)
Noise multiplier (σ)Ratio of noise to sensitivityDetermined by ε, δ, C, and composition method

GDPR Compliance Assessment for Federated Learning

Data Protection by Design (Art. 25) Alignment

GDPR PrincipleFL ImplementationCompliance Status
Data minimisation (Art. 5(1)(c))Personal data stays local — only model updates transmittedStrong compliance
Purpose limitation (Art. 5(1)(b))Local processing for specified training purposeRequires per-participant purpose documentation
Storage limitation (Art. 5(1)(e))No central training data repository — data retained locally per participant's policyCompliance depends on participant retention
Integrity and confidentiality (Art. 5(1)(f))Secure aggregation protects update confidentialityStrong with SA + DP
Accuracy (Art. 5(1)(d))Model accuracy may differ from centralised trainingMonitor and document accuracy trade-offs

Remaining GDPR Challenges

  1. Gradient leakage: Model updates can leak training data even without transmitting raw data — secure aggregation and DP mitigate but do not eliminate
  2. Model memorization: The aggregated model may still memorize individual records — privacy auditing required post-training
  3. Right to erasure: Removing a participant's contribution from the trained model is challenging — machine unlearning or retraining required
  4. Controller/processor determination: Complex multi-party FL architectures require clear role delineation
  5. Lawful basis: Each participant needs independent lawful basis; the aggregator needs basis for processing updates
  6. Transparency: Data subjects must be informed about federated learning participation

Implementation Considerations

Communication Efficiency

TechniqueDescriptionPrivacy Impact
Gradient compressionQuantise or sparsify gradients before transmissionMay interact with DP noise — careful calibration needed
Federated averaging (FedAvg)Multiple local SGD steps before communicationReduces communication rounds; may increase per-round privacy cost
Gradient selectionSend only top-k gradient componentsLeaks which components are most significant — privacy concern

Participant Selection

StrategyDescriptionPrivacy Consideration
Random selectionUniformly random participant sampling per roundFair representation; privacy amplification through subsampling
Availability-basedSelect participants with sufficient resourcesMay bias toward certain participant profiles
Contribution-basedSelect participants whose data improves model mostReveals information about data distribution — privacy risk

Enforcement Relevance

While no enforcement action has specifically addressed federated learning, the technology is directly relevant to:

  • CNIL AI recommendations (2024): Identified federated learning as a recommended privacy-enhancing technology for AI training
  • EDPB Guidelines 04/2025: Mentioned distributed training as a data minimisation measure for AI systems
  • Garante v. OpenAI (2023): Centralised data collection was a key compliance issue — federated alternatives could have mitigated
  • AI Act Art. 10: Data governance for training data — FL enables data governance while maintaining data locality

Integration Points

  • ai-dpia: FL architecture reduces data centralisation risk in DPIA assessment
  • ai-training-lawfulness: FL may simplify lawful basis by keeping data local
  • ai-model-privacy-audit: Federated models require distributed privacy auditing
  • ai-privacy-inference: FL complements confidential computing for inference privacy
  • ai-data-retention: Data locality in FL simplifies retention compliance

FAQ

What does the ai-federated-learning skill do?

Implements federated learning architecture patterns for GDPR compliance. Covers secure aggregation protocols, differential privacy integration, communication protocols, and privacy-by-design distributed ML training. Keywords: federated learning, distributed training, secure aggregation, differential privacy, privacy-preserving ML.

How do I install ai-federated-learning?

Run npx skills add https://github.com/mukul975/privacy-data-protection-skills --skill ai-federated-learning in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/ai-federated-learning/ (personal) or .claude/skills/ai-federated-learning/ (project).

Which AI agents can use ai-federated-learning?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is ai-federated-learning safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains ai-federated-learning?

It is published by mukul975 in mukul975/privacy-data-protection-skills. It has 42 recorded installs.

More from mukul975/privacy-data-protection-skills

View all →

brazil-lgpd

mukul975/privacy-data-protection-skills

Open the skill to read its SKILL.md instructions.

61 installs

analytics-cookie-consent

mukul975/privacy-data-protection-skills

Managing consent for analytics cookies and implementing privacy-preserving measurement. Covers GA4 privacy configuration, consent mode fallback behavior, aggregate reporting alternatives, and cookieless measurement approaches.

Data & Databases56 installs

audit-report-writing

mukul975/privacy-data-protection-skills

Guides privacy audit report writing including executive summary drafting, findings classification (critical, high, medium, low), evidence referencing, root cause analysis documentation, recommendation formulation, management response tracking, and report distribution protocols. Covers report structure from scope definition through appendices and sign-off. Keywords: audit report, findings documentation, executive summary, recommendations, report structure, privacy audit deliverables.

Docs & Writing50 installs

conducting-gdpr-dpia

mukul975/privacy-data-protection-skills

Guides the end-to-end GDPR Data Protection Impact Assessment process under Article 35, including mandatory trigger identification per Art. 35(3), DPIA content requirements per Art. 35(7), and EDPB WP248rev.01 methodology. Activate for systematic profiling, large-scale special category processing, or large-scale public monitoring. Keywords: DPIA, Article 35, impact assessment, WP248, data protection, risk assessment.

Docs & Writing48 installs

gdpr-compliance-audit

mukul975/privacy-data-protection-skills

Guides a comprehensive organisational data protection audit against key GDPR requirements including Articles 5, 24, 25, 28, 30, 32, 35, and 37. Includes 50+ control points covering principles, accountability, security, and governance. Activate when performing compliance audits, preparing for supervisory authority inspections, or assessing organisational GDPR maturity. Keywords: data protection audit, compliance audit, GDPR audit, control points, accountability.

Security48 installs

backup-retention-erasure

mukul975/privacy-data-protection-skills

Manages backup and archive data under retention schedules and erasure obligations. Covers the technical infeasibility exception for backup deletion, backup cycle alignment with retention periods, restore-and-delete procedures, and interim protective measures during backup retention. Activate for backup deletion, archive erasure, backup retention, restore and delete, technical infeasibility queries.

47 installs

Popular education & science skills

View category →

teach

mattpocock/skills

Teach the user a new skill or concept, within this workspace.

Education & Science874K installs

scaffold-exercises

mattpocock/skills

Create exercise directory structures with sections, problems, solutions, and explainers that pass linting. Use when user wants to scaffold exercises, create exercise stubs, or set up a new course section.

Education & Science488.2K installs

paper-context-resolver

lllllllama/rigorpilot-skills

Rigor Paper Context helper for README-first deep learning repo reproduction. Use only when the README and repository files leave a narrow reproduction-critical gap and the task is to resolve a specific paper detail such as dataset split, preprocessing, evaluation protocol, checkpoint mapping, or runtime assumption from primary paper sources while recording conflicts. Do not use for general paper summary, repo scanning, environment setup, command execution, title-only paper lookup, or replacing README guidance by default.

Education & Science478.3K installs

caveman-learn

juliusbrussee/caveman

Act on a Caveman learn report - review the ranked token sinks, apply cost-lowering fixes with per-edit consent, and report what those fixes returned. Use when asked to lower an agent's token cost, what caveman has saved, to trim a heavy CLAUDE.md, or to offload re-pasted context into cavemem.

Education & Science107.9K installs

gsap-plugins

greensock/gsap-skills

Official GSAP skill for GSAP plugins — registration, ScrollToPlugin, ScrollSmoother, Flip, Draggable, Inertia, Observer, SplitText, ScrambleText, SVG and physics plugins, CustomEase, EasePack, CustomWiggle, CustomBounce, GSDevTools. Use when the user asks about a GSAP plugin, scroll-to, flip animations, draggable, SVG drawing, or plugin registration.

Education & Science67.9K installs

teach-impeccable

pbakaus/impeccable

DEPRECATED: Use /impeccable teach instead. This command has been folded into the impeccable skill.