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 $0.00023 $0.01333
Sonnet 5 $0.00009 $0.00533
Haiku 4.5 $0.00005 $0.00266

Measured 7d ago against content hash 80653a5d209c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, 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 7d 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. 7d 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 (57 stars, last pushed 12d ago), licensed MIT. It adds 45 tokens to every session and 2,665 once invoked, about $0.0002 per session on Opus 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

building-agents

Use when building or restructuring an LLM agent — provider adapter, tool calling, structured output, RAG, agent loop, eval gate, cost routing, tracing, MCP server — model-agnostic across OpenAI/Anthropic/Gemini/OSS so a model swap is a config change. NOT vector-store SQL alone (that is postgresdb) or service…

ericrisco/rsc-harness · 85 tokens

open-weights

Use when choosing an open-weight LLM and clearing it for use — which family and size fit the task, the hardware and the budget, and above all whether the license permits shipping. Owns the license-class map (OSI-open versus custom-community versus non-commercial), the always-verify-the-model-card rule, size-to-VRAM…

ericrisco/rsc-harness · 146 tokens

AI & LLM Security

LLM and AI application security testing — prompt injection, jailbreak resistance, OWASP LLM Top 10 (2025), RAG and agent/tool-use security, model supply chain, and AI red teaming for authorized assessments.

Masriyan/Claude-Code-CyberSecurity-Skill · 50 tokens

agent-eval

Use when measuring whether an LLM or agent system actually got better and gating merges on it: golden sets, fixing an inflated LLM-as-judge, scoring RAG (faithfulness, contextual recall) or agent trajectories (tool correctness, completion), or picking an eval framework. NOT building the agent loop, tools or RAG…

ericrisco/rsc-harness · 79 tokens

llm-pipeline

Use when wiring several LLM calls into a production flow: typed contracts between steps, a router/gateway so 429s, timeouts and outages fail over instead of taking you down, and cost control via caching, model tiers and abort caps. NOT single-prompt wording (that is prompt-engineering), NOT a model-driven tool loop…

ericrisco/rsc-harness · 83 tokens

huggingface

Use when running open models or working on the Hugging Face platform — the Inference Providers router or InferenceClient, Hub repos via the hf CLI, a dedicated Inference Endpoint with scale-to-zero, a Gradio Space with ZeroGPU, picking an open model by task/license/size, or loading one locally with transformers. NOT…

ericrisco/rsc-harness · 131 tokens