MCPInstall

ai-model-privacy-audit

Conducts privacy auditing of AI models including training data extraction testing, membership inference attacks, model inversion testing, and attribute inference assessment. Uses ML Privacy Meter and related tools to quantify privacy leakage. Keywords: model audit, membership inference, privacy meter, model inversion, training data extraction.

Installs
46
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-model-privacy-audit
  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-model-privacy-audit 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.

AI Model Privacy Audit

Overview

AI model privacy auditing is the systematic assessment of whether trained ML models leak information about their training data. Models can memorize individual training records, enabling adversaries to extract personal data, determine dataset membership, reconstruct input features, or infer sensitive attributes. This skill implements a comprehensive model privacy audit methodology using established attack techniques and tools (ML Privacy Meter, ART, Foolbox) to quantify privacy leakage before deployment and periodically during operation. The audit results feed directly into the AI DPIA risk assessment and inform mitigation measure selection.

Privacy Attack Taxonomy

1. Training Data Extraction

Objective: Extract verbatim or near-verbatim records from the model's training data.

Attack VectorDescriptionTarget Models
Prompt-based extractionCraft prompts that cause LLMs to regurgitate training dataLanguage models, generative models
Canary extractionInsert known canary strings into training data and test if model reproduces themAny model (testing methodology)
Gradient-based extractionUse model gradients to reconstruct training inputsModels with accessible gradients
Generative reconstructionUse the model as an oracle to iteratively reconstruct training samplesGANs, VAEs, diffusion models

Risk Factors Increasing Extraction Likelihood:

  • Large model capacity relative to training data size (overfitting)
  • Training data containing duplicated or near-duplicated records
  • Longer training duration (more epochs)
  • Lower regularisation
  • Models with high output granularity (logits, probabilities)

Testing Methodology:

  1. Insert canary records with unique identifiers into training data
  2. Train the model
  3. Attempt extraction through various prompting strategies
  4. Measure extraction success rate (percentage of canaries recovered)
  5. Threshold: extraction rate should be below 0.1% for acceptable risk

2. Membership Inference

Objective: Determine whether a specific record was in the model's training set.

Attack TypeMethodComputational Cost
Shadow model attackTrain shadow models on similar data, build a binary classifier on model outputsHigh — requires training multiple shadow models
Metric-based attackUse model confidence, loss, or entropy to distinguish members from non-membersLow — single model query per sample
Label-only attackUse predicted labels (no confidence scores) to infer membershipMedium — requires multiple queries
Likelihood ratio attack (LiRA)Compare per-sample loss to reference distributionsHigh — most accurate, requires multiple models

ML Privacy Meter Implementation:

  • Population metric-based attack: compares target model's loss on a sample against population loss distribution
  • Reference metric-based attack: uses reference models to compute per-sample metrics
  • Shadow model attack: trains shadow models and uses the attack model to classify members

Testing Methodology:

  1. Partition data: training set (members) and held-out set (non-members)
  2. Run membership inference attacks using ML Privacy Meter
  3. Measure attack success: true positive rate at low false positive rate (TPR@FPR=0.1%, 1%)
  4. Generate ROC curves per sample and aggregate
  5. Threshold: TPR@1%FPR should be below 5% for acceptable privacy

3. Model Inversion

Objective: Reconstruct input features from model outputs.

Attack TypeMethodTarget
Confidence-based inversionIteratively optimise input to maximise model confidence for a known labelClassification models
Gradient-based inversionUse model gradients to reconstruct inputs from outputsWhite-box models
GAN-based inversionTrain a GAN to invert model outputs to input spaceFace recognition, image classifiers

Testing Methodology:

  1. Select target classes or individuals
  2. Run inversion attacks with various initializations
  3. Measure reconstruction quality (SSIM, PSNR for images; cosine similarity for embeddings)
  4. Assess re-identification risk: can reconstructed data identify specific individuals?
  5. Threshold: reconstruction similarity should be below 0.3 (SSIM) for acceptable risk

4. Attribute Inference

Objective: Infer sensitive attributes not present in the model's output.

Attack TypeDescription
Correlation exploitationUse correlated features to infer sensitive attributes from model behaviour
Partial knowledge attackAttacker knows some attributes and uses model to infer remaining sensitive ones
Group inferenceDetermine statistical properties of training subgroups

Testing Methodology:

  1. Identify sensitive attributes (Art. 9 categories) that may be correlated with model features
  2. Train attack models to predict sensitive attributes from model outputs
  3. Measure inference accuracy for each sensitive attribute
  4. Compare against random baseline
  5. Threshold: inference accuracy should not exceed random baseline + 10%

Audit Methodology

Phase 1: Audit Scoping (Days 1-3)

  1. Define audit scope: which models, what deployment context, what threat model
  2. Identify assets: training data, model artefacts, deployment infrastructure
  3. Define threat model: who are the adversaries, what access do they have?
    • Black-box: API access only (queries and responses)
    • Grey-box: API access plus model architecture knowledge
    • White-box: Full access to model weights and architecture
  4. Select attacks based on threat model and model type
  5. Define success criteria (acceptable leakage thresholds)
  6. Obtain audit authorisation from model owner and legal

Phase 2: Environment Setup (Days 4-7)

  1. Set up isolated audit environment (no production data leakage)
  2. Install audit tools: ML Privacy Meter, ART (Adversarial Robustness Toolbox), custom scripts
  3. Obtain model access (API endpoint or model weights depending on threat model)
  4. Prepare member/non-member datasets for membership inference
  5. Prepare canary data for extraction testing
  6. Configure monitoring to log all audit queries

Phase 3: Attack Execution (Days 8-18)

For each selected attack:

  1. Configure attack parameters
  2. Execute attack against the target model
  3. Collect results (success rates, confidence intervals)
  4. Vary attack parameters to find worst-case leakage
  5. Document: attack configuration, results, computational cost

Phase 4: Analysis and Reporting (Days 19-25)

  1. Aggregate results across all attacks
  2. Calculate privacy risk scores per attack type
  3. Identify high-risk data subsets (records most vulnerable to extraction)
  4. Cross-reference with DPIA risk register
  5. Generate audit report with:
    • Executive summary
    • Attack results per category
    • Risk assessment with GDPR alignment
    • Recommended mitigations
    • Residual risk after proposed mitigations

Phase 5: Remediation Validation (Days 26-30)

  1. If mitigations are applied (differential privacy, output perturbation, etc.)
  2. Re-run key attacks to validate mitigation effectiveness
  3. Document residual leakage post-mitigation
  4. Compare against acceptable thresholds
  5. Issue final audit certificate or remediation requirements

Privacy Leakage Thresholds

MetricAcceptableElevatedUnacceptable
Membership inference TPR@1%FPR< 5%5-15%> 15%
Training data extraction rate< 0.1%0.1-1%> 1%
Model inversion SSIM< 0.30.3-0.6> 0.6
Attribute inference accuracy above baseline< 10%10-25%> 25%

Mitigation Measures

MitigationAttacks MitigatedTrade-off
Differential privacy (DP-SGD)All — provides mathematical guaranteeModel accuracy reduction (calibrate epsilon)
Training data deduplicationExtraction, membership inferenceOne-time preprocessing cost
Regularisation (dropout, weight decay)Membership inference, overfitting-related leakageMay affect model performance
Output perturbationModel inversion, attribute inferenceReduces output precision
Confidence score roundingMetric-based membership inferenceMinor output precision loss
Model distillationExtraction, membership inferenceRequires additional training
Rate limitingAll query-based attacksAffects legitimate use
Input/output PII filteringExtraction of PII from generative modelsMay affect model utility

Tools and Frameworks

ToolPurposeSource
ML Privacy MeterMembership inference auditinggithub.com/privacytrustlab/ml_privacy_meter
IBM ARTAdversarial robustness and privacy testinggithub.com/Trusted-AI/adversarial-robustness-toolbox
TensorFlow PrivacyDifferential privacy traininggithub.com/tensorflow/privacy
OpacusPyTorch differential privacygithub.com/pytorch/opacus
Google DP LibraryDifferential privacy algorithmsgithub.com/google/differential-privacy
FoolboxAdversarial attack librarygithub.com/bethgelab/foolbox

Enforcement Relevance

Model privacy auditing is not explicitly required by the GDPR or AI Act, but is effectively mandated through:

  • Art. 35 DPIA: Risk assessment for AI systems must evaluate privacy leakage risks — auditing is the standard methodology
  • Art. 32 Security: Appropriate technical measures to ensure security of processing — privacy auditing validates these measures
  • AI Act Art. 9: Risk management for high-risk AI requires identification and mitigation of privacy risks
  • AI Act Art. 15: Accuracy, robustness, and cybersecurity requirements — privacy attacks are a cybersecurity concern
  • EDPB Guidelines 04/2025: Controllers must assess whether AI models have effectively anonymised training data — auditing tests this claim

Integration Points

  • ai-dpia: Audit results feed into DPIA Phase 3 risk assessment
  • ai-data-retention: Audit validates whether deletion from training data is effective
  • ai-deployment-checklist: Pre-deployment privacy audit is a checklist requirement
  • ai-federated-learning: Federated learning models require distributed privacy auditing

FAQ

What does the ai-model-privacy-audit skill do?

Conducts privacy auditing of AI models including training data extraction testing, membership inference attacks, model inversion testing, and attribute inference assessment. Uses ML Privacy Meter and related tools to quantify privacy leakage. Keywords: model audit, membership inference, privacy meter, model inversion, training data extraction.

How do I install ai-model-privacy-audit?

Run npx skills add https://github.com/mukul975/privacy-data-protection-skills --skill ai-model-privacy-audit 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-model-privacy-audit/ (personal) or .claude/skills/ai-model-privacy-audit/ (project).

Which AI agents can use ai-model-privacy-audit?

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-model-privacy-audit 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-model-privacy-audit?

It is published by mukul975 in mukul975/privacy-data-protection-skills. It has 46 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

gdpr-compliance-audit

mukul975/privacy-data-protection-skills

Open the skill to read its SKILL.md instructions.

Security48 installs

conducting-gdpr-dpia

mukul975/privacy-data-protection-skills

Open the skill to read its SKILL.md instructions.

48 installs

backup-retention-erasure

mukul975/privacy-data-protection-skills

Open the skill to read its SKILL.md instructions.

47 installs

Popular security skills

View category →

azure-compliance

microsoft/azure-skills

Run Azure compliance and security audits with azqr plus Key Vault expiration checks. Covers best-practice assessment, resource review, policy/compliance validation, and security posture checks. WHEN: compliance scan, security audit, BEFORE running azqr (compliance cli tool), Azure best practices, Key Vault expiration check, expired certificates, expiring secrets, orphaned resources, compliance assessment.

OfficialSecurity567K installs

minimal-run-and-audit

lllllllama/rigorpilot-skills

Rigor Run skill for README-first deep learning repo reproduction. Use when the task is specifically to capture or normalize evidence from the selected smoke test or documented inference or evaluation command and write standardized reprooutputs/ files, including patch notes when repository files changed. Do not use for training execution, initial repo intake, generic environment setup, paper lookup, target selection, hidden scientific-meaning changes, or end-to-end orchestration by itself.

Security477.4K installs

seo-audit

coreyhaines31/marketingskills

When the user wants to audit, review, or diagnose SEO issues on their site. Also use when the user mentions "SEO audit," "technical SEO," "why am I not ranking," "SEO issues," "on-page SEO," "meta tags review," "SEO health check," "my traffic dropped," "lost rankings," "not showing up in Google," "site isn't ranking," "Google update hit me," "page speed," "core web vitals," "crawl errors," "indexing issues," "stuck on page 2," "striking distance keywords," "title tag rewrite," "low CTR," "local SEO," "Google Business Profile," or "map pack." Use this even if the user just says something vague like "my SEO is bad" or "help with SEO" — start with an audit. For building pages at scale to target keywords, see programmatic-seo. For adding structured data, see schema. For AI search optimization, see ai-seo.

Security238.7K installs

firebase-security-rules-auditor

firebase/agent-skills

Audits Firebase (Firestore, Cloud Storage) security rules for vulnerabilities, privilege escalation, role bypasses, create vs update inconsistencies, resource exhaustion, type safety, size limits, and hasOnly ownership checks. Use when auditing/reviewing rules, running red-team rule assessments, or scoring against auditor checklists. Don't use for Firebase CLI (login, deploy), Auth, Crashlytics, Remote Config, or database queries.

OfficialSecurity139.1K installs

audit

pbakaus/impeccable

Run technical quality checks across accessibility, performance, theming, responsive design, and anti-patterns. Generates a scored report with P0-P3 severity ratings and actionable plan. Use when the user wants an accessibility check, performance audit, or technical quality review.

Security81.9K installs

competitors

coreyhaines31/marketingskills

When the user wants to create competitor comparison or alternative pages for SEO and buyer-facing use. Also use when the user mentions 'alternative page,' 'vs page,' 'competitor comparison,' 'comparison page,' '[Product] vs [Product],' '[Product] alternative,' 'competitive landing pages,' 'how do we compare to X,' 'competitor teardown,' 'audit our competitor pages,' 'are our comparison pages out of date,' or 'competitive asset audit.' Use this for any content that positions your product against competitors. Covers four formats: singular alternative, plural alternatives, you vs competitor, and competitor vs competitor. For auditing existing claims (not researching competitors from scratch, which is competitor-profiling; not technical SEO on these pages, which is seo-audit), use the asset audit here. For internal battle cards and sales-specific competitor docs, see sales-enablement.

Security79.3K installs