Model Extraction Attack

A model extraction attack (also called model stealing or adversarial distillation) is an attack in which an adversary repeatedly queries an AI model, or copies one shipped to the browser or device, to replicate its functionality, parameters, or capabilities without authorization. The result is a surrogate model that captures the original's intellectual property at a fraction of the training cost.

Key facts

FactDetail
First formalizedTramèr, Zhang, Juels, Reiter and Ristenpart, Stealing Machine Learning Models via Prediction APIs, USENIX Security 2016. The team extracted models from BigML and Amazon Machine Learning with near-perfect fidelity.
OWASP classificationLLM10:2025 Unbounded Consumption in the OWASP Top 10 for LLM Applications, which lists model extraction via API and functional model replication.
MITRE ATLAS classificationAML.T0024.002 Extract AI Model, a sub-technique of Exfiltration via AI Inference API.
What is stolenModel behavior and decision boundaries, parameters and architecture, reasoning capabilities, and the value of proprietary training data and fine-tuning.
Why it is in the newsIn 2026, Google and Anthropic each publicly reported large-scale extraction campaigns against their frontier models, and US agencies issued guidance on industrial-scale distillation.

How a Model Extraction Attack Works

A model extraction attack exploits the access a model must grant to be useful. Every answer a model returns leaks a little of how it decides. Collected at scale, those answers become training data for a copy.

  1. Gain access. The attacker uses a public API, a paid account, a web or mobile front end, or a model file downloaded to the client. No break-in is needed: Google’s threat intelligence team describes extraction as using legitimate access to probe a model at scale (TechInformed).
  2. Craft and send queries. Inputs are chosen to cover the model’s decision space or a target capability, such as coding, reasoning or a non-English language.
  3. Harvest outputs. Labels, confidence scores, embeddings, full text responses and, for reasoning models, visible reasoning traces are logged as input-output pairs.
  4. Train a surrogate. The pairs train a “student” model that imitates the target, or are used to solve for the target’s parameters directly.
  5. Refine and exploit. The attacker measures agreement with the target, sends new queries where the copy is weakest, then deploys the clone or uses it to plan further attacks.

The client-side shortcut. When inference runs in the browser (for example with TensorFlow.js or ONNX Runtime Web) or inside a mobile app, the model file and the application logic that loads and calls it are delivered to every user. The attacker can skip querying and copy the artifact itself. Practitioner guidance is blunt: a model delivered to the client should be treated as nonconfidential (Deep Learning with Python, 3rd ed.).

Types of Model Extraction Attacks

Model extraction attacks differ by what the attacker can reach and what they want to copy.

Query-based (black-box) extraction

The attacker sees only inputs and outputs. They send many queries, record the predictions, and train a surrogate that mimics the target’s decision boundary. This is the classic form described in the 2016 USENIX research, and the one MITRE ATLAS catalogs under Extract AI Model.

Equation-solving and parameter extraction

For simpler model classes, rich outputs such as confidence scores let an attacker solve for the model’s parameters almost exactly. The 2016 study also showed that removing confidence values does not close the gap: extraction still works, only more slowly (Tramèr et al.).

Functional replication and adversarial distillation

The dominant form against large language models. The attacker uses the target’s outputs as synthetic training data to fine-tune another model into a functional equivalent. OWASP lists this as functional model replication (OWASP LLM10:2025). Recent campaigns specifically targeted reasoning traces, coding, and tool use.

Side-channel extraction

The attacker infers weights or architecture from signals other than the answer itself, such as timing, resource use, or behavior when input filtering is bypassed. OWASP includes side-channel attacks that harvest model weights and architectural information within LLM10.

Direct artifact extraction from on-device and in-browser models

When the model ships to the client, the attacker extracts the file and the code around it instead of querying. Research on mobile apps found that on-device models in 1,250 of 1,511 apps tested (82.73%) could be extracted and reused (DeMistify, ICSE 2024). In-browser models face the same exposure, because the browser runtime is fully inspectable by the user.

Model extraction steals the model itself. Most related attacks steal the model’s data or change its behavior instead.

TermWhat the attacker wantsPhase targetedWhat the victim loses
Model extractionA working copy of the model or its capabilitiesInference (runtime) or the deployed artifactIntellectual property, R&D investment, competitive edge
Knowledge distillationNot an attack: a legitimate method of training a smaller model from a larger one the developer is authorized to useTrainingNothing, when authorized. It becomes adversarial distillation when done without permission.
Model inversionReconstructed training data, such as faces or recordsInferencePrivacy of the people in the training data
Membership inferenceProof that a specific record was in the training setInferencePrivacy; possible regulatory exposure
Data poisoningA model that behaves the way the attacker wantsTraining or fine-tuningModel integrity and trustworthiness
Prompt injectionControl over what the model does in one interactionInferenceData, actions or outputs in that session

The attacks also chain: a surrogate built by extraction lets an attacker develop evasion or adversarial inputs offline, then use them against the original.

Why Model Extraction Attacks Matter

Model extraction turns a model’s public interface into a way to copy it. It is no longer a research scenario.

  • It is happening at scale. In February 2026, Google reported one campaign of more than 100,000 prompts aimed at Gemini’s reasoning (CSO Online). Anthropic reported about 24,000 fraudulent accounts generating over 16 million exchanges with Claude (NYU Shanghai RITS).
  • It is not only a frontier-lab problem. Google’s chief threat analyst expects similar attacks against smaller companies’ custom models, including models trained on proprietary data (NBC News).
  • It is now a policy issue. In April 2026, the White House issued memorandum NSTM-4, the first US policy instrument to classify systematic extraction from frontier models as a national security threat (Cloud Security Alliance).
  • Clones can lose their guardrails. A student model trained on extracted outputs tends to copy capability while reproducing safety behavior inconsistently, so organizations that unknowingly deploy one inherit the gap (Cloud Security Alliance).
  • It drives cost and outages. OWASP groups extraction with resource abuse because high-volume querying also inflates inference bills and degrades service for legitimate users.
  • It exposes the logic around the model. In web and mobile apps, the code that prepares inputs, calls the model and acts on its output often holds business rules of its own, such as fraud scoring or pricing. Copying the model and that logic together gives an attacker the full feature.

How to Prevent Model Extraction Attacks

No single control stops model extraction. The goal is to make copying slow, expensive, detectable and traceable, both at the API and wherever model logic executes on the client.

  • Meter and rate-limit queries. Set per-account and per-key quotas, timeouts and throttles. Treat tokens and compute as security boundaries, not only billing metrics.
  • Return less than you can. Give labels instead of full probability vectors, round scores, and keep internal reasoning traces hidden. This slows extraction but does not prevent it on its own.
  • Detect extraction patterns. Watch for query distributions that sweep the input space, repeated harvesting of reasoning or coding behavior, clusters of related accounts, and traffic routed through resale proxies. US agencies recommend behavioral detection for exactly these signals (eSecurity Planet).
  • Harden identity and access. Verify accounts, detect automation and proxy infrastructure, and apply least privilege to model registries and training environments.
  • Watermark and fingerprint. Embed detectable signals in model outputs, and watermark client-side code, so a copy can be traced back to its source.
  • Keep the most sensitive models server-side. Run inference behind your own controls when the model is the asset. If it must run on the client, protect the delivery.
  • Protect client-side model logic. Harden the application logic that loads, decodes, and calls an in-browser model against inspection, debugging, and tampering, and restrict it to approved domains.
  • Govern AI scripts in the browser. Control which third-party scripts can read prompts, responses, and form fields on pages that host AI features, and block unauthorized outbound transmission of that data.
  • Map controls to frameworks and test them. Track coverage against OWASP LLM10:2025 and MITRE ATLAS AML.T0024, keep a central model inventory, and red-team extraction at each major model release.

Solutions by Jscrambler

API-side controls belong to whoever hosts the model. But more AI now executes in the browser, beyond the traditional edge, where server-side controls cannot follow it. The Jscrambler Client-Side Security Platform governs that layer.

  • LLM-Resilient Code Protection. The Jscrambler Code Integrity product protects the first-party application logic that loads, prepares, and calls client-side models. Polymorphic obfuscation produces a different protected output with every build. Anti-debugging, anti-tampering, and Code Locks such as Domain Lock restrict where and how that logic runs. Code watermarking helps trace leaked code back to its source. Together, these dramatically increase the effort needed to lift model-handling logic out of the browser, including with AI-assisted reverse engineering tools.
  • AI Data Governance & Security. Jscrambler Webpage Integrity discovers AI-powered scripts running on your pages and maps what they access. It blocks unauthorized outbound transmission of prompts and context, so third-party scripts can’t quietly harvest the input-output pairs your AI features produce.
  • Fraud & Abuse Prevention. Runtime variability and environment-based execution controls disrupt the automation that drives high-volume querying through web front ends.

Get a demo to see how runtime enforcement protects AI-powered applications in the browser.

FAQs

Is model extraction the same as model distillation?

No. Knowledge distillation is a legitimate technique for training a smaller model from a larger one. It becomes a model extraction attack, often called adversarial distillation, when someone uses another party’s model outputs without authorization to build a competing model.

Does a model extraction attack require hacking into a system?

Usually not. Most extraction uses the same access any customer has: an API key, an account or a web interface. That is what makes it hard to tell apart from heavy legitimate use.

Does hiding confidence scores stop model extraction?

No. It raises the number of queries needed, but research since 2016 shows models can still be extracted from labels alone. Treat output minimization as one layer among several.

Are AI models running in the browser at risk?

Yes, and more directly. An in-browser model and the code that runs it are delivered to every visitor, so an attacker can copy the artifact instead of querying it. Protecting the client-side logic around the model is essential.

How do OWASP and MITRE ATLAS classify model extraction?

OWASP covers it under LLM10:2025 Unbounded Consumption in the Top 10 for LLM Applications. MITRE ATLAS lists it as AML.T0024.002 Extract AI Model, under the Exfiltration tactic.

How can you tell if your model is being extracted?

Look for unusually broad or systematic query patterns, repeated requests for reasoning or step-by-step output, many accounts with similar behavior, and access through proxy or resale services. Sudden growth in inference cost is often the first visible signal.