Ai Model Privacy Audit logo

Ai Model Privacy Audit

Community
mukul975
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.

Overview

Publishermukul975
RepositoryPrivacy-Data-Protection-Skills
Skill nameai-model-privacy-audit
Stars
279
Forks
59
Bundled files
4
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by mukul975 on GitHub. Read the source before you install it.

Installation

Install the Ai Model Privacy Audit AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/mukul975/Privacy-Data-Protection-Skills.git /tmp/Privacy-Data-Protection-Skills
mkdir -p .claude/skills
cp -r /tmp/Privacy-Data-Protection-Skills/plugins/ai-privacy-governance-skills/skills/ai-model-privacy-audit .claude/skills/ai-model-privacy-audit
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Ai Model Privacy Audit in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Ai Model Privacy Audit on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Ai Model Privacy Audit is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Ai Model Privacy Audit AI 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.

Why use Ai Model Privacy Audit on TypingMind?

Because you install it once and use it with any model. Ai Model Privacy Audit is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Ai Model Privacy Audit in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/mukul975/Privacy-Data-Protection-Skills/tree/main/plugins/ai-privacy-governance-skills/skills/ai-model-privacy-audit. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Ai Model Privacy Audit?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Ai Model Privacy Audit?

As many as you like. As long as a model supports skills, you can use Ai Model Privacy Audit with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Ai Model Privacy Audit AI skill free?

Yes. It is published on GitHub by mukul975 under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇