Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

ai-model-privacy-audit

БесплатноЗапускает вложенные скриптыНе проверен

Conducts privacy auditing of AI models including training data extraction testing, membership inference attacks, model inversion testing, and attribute…

onfire7777от onfire7777★ 17 звёзд на GitHub

Об этом скилле

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 Vector Description Target Models
Prompt-based extraction Craft prompts that cause LLMs to regurgitate training data Language models, generative models
Canary extraction Insert known canary strings into training data and test if model reproduces them Any model (testing methodology)
Gradient-based extraction Use model gradients to reconstruct training inputs Models with accessible gradients
Generative reconstruction Use the model as an oracle to iteratively reconstruct training samples GANs, 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 Type Method Computational Cost
Shadow model attack Train shadow models on similar data, build a binary classifier on model outputs High — requires training multiple shadow models
Metric-based attack Use model confidence, loss, or entropy to distinguish members from non-members Low — single model query per sample
Label-only attack Use predicted labels (no confidence scores) to infer membership Medium — requires multiple queries
Likelihood ratio attack (LiRA) Compare per-sample loss to reference distributions High — 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 Type Method Target
Confidence-based inversion Iteratively optimise input to maximise model confidence for a known label Classification models
Gradient-based inversion Use model gradients to reconstruct inputs from outputs White-box models
GAN-based inversion Train a GAN to invert model outputs to input space Face 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 Type Description
Correlation exploitation Use correlated features to infer sensitive attributes from model behaviour
Partial knowledge attack Attacker knows some attributes and uses model to infer remaining sensitive ones
Group inference Determine statistical properties of training subgroups

Testing Methodology:

  1. Identify sensitive attributes (Art. 9 categories) that may be correlated with model
Полный SKILL.md на GitHub

Установить ai-model-privacy-audit в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

assets/template.mdreferences/standards.mdreferences/workflows.mdscripts/process.py

FAQ

Что делает скилл 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.

Как установить скилл ai-model-privacy-audit?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл ai-model-privacy-audit запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить ai-model-privacy-audit с