detecting-model-extraction-attacks

detecting-model-extraction-attacks is a skill for Claude Code, Codex from adriannoes/awesome-agentic-ai. It costs 45 tokens per session (2,665 once invoked), scanned A, original, MIT.

A defensive workflow for finding attempts to steal or reconstruct an AI model through its inference API. Model extraction copies a model's behavior, model inversion reconstructs likely training inputs, and membership inference checks whether specific data was used for training.

In plain words
What is it for?
Monitoring inference requests, perturbing model outputs, and red-teaming your own model's resistance to extraction, inversion, and membership-inference attacks.
Why use it?
It helps model owners spot abusive query patterns and test whether their model reveals too much information through its API.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Monitoring inference requests, perturbing model outputs, and red-teaming your own model's resistance to extraction, inversion, and membership-inference attacks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/adriannoes/awesome-agentic-ai/detecting-model-extraction-attacks
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add adriannoes/awesome-agentic-ai --skill detecting-model-extraction-attacks
Clone the repo
git clone --depth 1 https://github.com/adriannoes/awesome-agentic-ai

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for detecting-model-extraction-attacks

README.md
[![agentmods](https://agentmods.dev/badge/skills/adriannoes/awesome-agentic-ai/detecting-model-extraction-attacks/github.svg)](https://agentmods.dev/skills/adriannoes/awesome-agentic-ai/detecting-model-extraction-attacks)
Your own site
<a href="https://agentmods.dev/skills/adriannoes/awesome-agentic-ai/detecting-model-extraction-attacks"><img src="https://agentmods.dev/badge/skills/adriannoes/awesome-agentic-ai/detecting-model-extraction-attacks/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for detecting-model-extraction-attacks

Your own site · 80×15
<a href="https://agentmods.dev/skills/adriannoes/awesome-agentic-ai/detecting-model-extraction-attacks"><img src="https://agentmods.dev/badge/skills/adriannoes/awesome-agentic-ai/detecting-model-extraction-attacks.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,665 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00045 $0.02665
Opus 5.5 $0.00018 $0.01066
Sonnet 5.5 $0.00009 $0.00533
Haiku 4.5 $0.00005 $0.00266

Measured 1mo ago against content hash 80653a5d209c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

detecting-model-extraction-attacks scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/agent.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

cursor-claude-codex/skills/anthropic-cybersecurity-skills/skills/detecting-model-extraction-attacks/SKILL.md · 205 lines

How it starts

The opening of the file, as written. The whole thing — 205 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Detecting Model Extraction Attacks

Authorized Use Only: The extraction, inversion, and membership-inference techniques described here are intended for defenders testing their own models and for red teams operating under written authorization. Querying a third-party model to clone it, reconstruct its training data, or infer membership without permission may violate terms of service, copyright, and privacy law.

Overview

Model extraction is the family of attacks in which an adversary abuses a model's inference API to steal value that the model owner intended to keep private. MITRE ATLAS catalogs these under AML.T0024 — Exfiltration via AI Inference API, in the Exfiltration tactic, with three sub-techniques:

  • AML.T0024.000 — Infer Training Data Membership (membership inference): the adversary determines whether a specific record was part of the training set, a privacy violation that can expose, for example, whether a patient's record trained a medical model.
  • AML.T0024.001 — Invert AI Model (model inversion): the adversary reconstructs representative training inputs (e.g., faces, text) by exploiting confidence scores returned by the API.
  • AML.T0024.002 — Extract ML Model (model stealing): the adversary repeatedly queries the victim model, collects (input, prediction) pairs, and trains a surrogate model offline that mimics the victim's decision boundary — avoiding the per-query cost of a Machine-Learning-as-a-Service offering and stealing the owner's intellectual property.

All three share a common signal: an attacker must send many queries, often crafted to probe the decision boundary (high-entropy, near-boundary, synthetic, or systematically grid-sampled inputs), and frequently requests full confidence vectors / logits rather than just the top label. Detection therefore centers on per-principal query monitoring, input-distribution analysis, and confidence-exposure controls, while defense centers on rate limiting, output perturbation, and reducing the information returned per query. This skill follows the MITRE ATLAS technique definition for AML.T0024 (https://atlas.mitre.org/techniques/AML.T0024) and the NIST AI RMF MEASURE function (MEASURE-2.6, security and resilience of the AI system).

Read the full file on GitHub · 205 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 205 lines · 45 tokens per session scan A 80653a5d209c

Subscribe to this mod's changes

detecting-model-extraction-attacks is a skill published in the GitHub repository adriannoes/awesome-agentic-ai (72 stars, last pushed 2d ago), licensed MIT. It adds 45 tokens to every session and 2,665 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

AI/ML Model Testing

Testing machine learning models including accuracy validation, bias detection, drift monitoring, A/B testing, and model regression testing.

PramodDutta/qaskills · 29 tokens

model-inversion-attacks

Extract sensitive training data and internal capabilities from AI models through repeated programmatic querying. Use this skill when testing LLMs and ML models for data privacy leaks, intellectual property exposure, or unintended memorization. Covers membership inference, prompt extraction, training data…

akashrpatil/awesome-offensive-security-skills · 63 tokens

spark-training-gotchas

Preflight and diagnose the ten known failure modes for ML training on NVIDIA DGX Spark. Use when a training run on DGX Spark fails to start, OOMs below the 128GB limit, slows down mid-run, or before any multi-hour training job on GB10.

wshobson/agents · 63 tokens

9router-stt

Speech-to-text via 9Router /v1/audio/transcriptions using OpenAI Whisper / Groq / Gemini / Deepgram / AssemblyAI / NVIDIA / HuggingFace models. Use when the user wants to transcribe audio, convert speech to text, or get subtitles from audio files.

decolua/9router · 63 tokens

9router-embeddings

Generate vector embeddings via 9Router /v1/embeddings using OpenAI / Gemini / Mistral / Voyage / Nvidia / GitHub embedding models for RAG, semantic search, similarity. Use when the user wants embeddings, vectors, RAG, semantic search, or to embed text.

decolua/9router · 66 tokens

9router

Entry point for 9Router — local/remote AI gateway with OpenAI-compatible REST for chat, image, TTS, embeddings, web search, web fetch. Use when the user mentions 9Router, NINEROUTERURL, or wants AI without writing provider boilerplate. This skill covers setup + indexes capability skills; fetch the relevant capability…

decolua/9router · 84 tokens