π° Originally published on Securityelites β AI Red Team Education β the canonical, fully-updated version of this article.
π€ AI/LLM HACKING COURSE
FREE
Part of the AI/LLM Hacking Course β 90 Days
Day 32 of 90 Β· 35.6% complete
β οΈ Authorised Targets Only: AI Model stealing assessment β systematic API probing for input-output pair collection β must only be performed within authorised scope. Most bug bounty programs explicitly exclude model extraction testing. In assessment contexts, agree specific query volume limits and data handling procedures before beginning.
A startup spent eighteen months and a team of six data scientists fine-tuning a legal document analysis model. Jurisdiction-specific contract clause detection, custom entity types, specialised confidence scoring. The model was their competitive moat. Theyβd never served the weights directly β just an API. They thought the API was the protection. Their terms of service prohibited βsystematic data collection or model training from API outputs.β They didnβt have rate limiting past 1,000 requests per day per key. They didnβt have output watermarking. They didnβt have input fingerprinting or anomaly detection on query patterns.
A competitor needed twelve thousand API calls, spread across thirty accounts over six weeks, to collect enough input-output pairs to fine-tune a reproduction. Six weeks later, the competitorβs product launched. Same jurisdiction-specific clause detection. Same custom entity types. Similar confidence scoring. The startupβs eighteen months of investment was reproducible for the cost of thirty API accounts and six weeks of patience. The protection they thought they had β the API boundary, the ToS clause, the unpublished weights β had a specific, measurable attack surface that nobody had assessed. Day 32 covers how to assess that surface, what controls actually work, and how to report model stealing vulnerability in terms that make the business risk clear.
π― What Youβll Master in Day 32
Understand the model stealing attack surface and what IP is exposed via API access
Build systematic input-output pair collection probes across a modelβs capability surface
Test embedding extraction vulnerability in embedding API endpoints
Assess countermeasure effectiveness: rate limiting, watermarking, output perturbation
Estimate extraction cost in API queries for different model capabilities
Report model stealing risk in business-impact terms for non-technical stakeholders
β±οΈ Day 32 Β· 3 exercises Β· Kali Terminal + Kali Terminal + Think Like Hacker ### β Prerequisites - Day 24 β AI Model Fingerprinting β model characterisation from Day 24 is the first step of any stealing assessment; you need to understand the target before extracting it - Day 2 β How LLMs Work β understanding embeddings and model architecture is prerequisite to understanding whatβs being extracted in an embedding stealing attack - Python with scikit-learn and numpy β Exercise 2 builds the embedding similarity analysis tool ### π AI Model Stealing β Day 32 Contents 1. The Model Stealing Attack Surface 2. Systematic Input-Output Pair Collection 3. Embedding Extraction and Space Reconstruction 4. Assessing Countermeasure Effectiveness 5. Extraction Cost Estimation 6. Reporting Model Stealing Risk to Business Stakeholders In Day 31 you extracted data from the modelβs context and training. Day 32 extracts something different β the modelβs learned capability itself. Day 33 covers LLM denial of service β the resource exhaustion attacks that are the opposite of extraction: instead of taking the modelβs value out, they destroy the modelβs ability to deliver value to anyone.
The Model Stealing Attack Surface
Model stealing attacks have one input and one output. The input is API access. The output is a model that reproduces the originalβs behaviour without the originalβs training investment. The attack surface is anything that increases the fidelity of reproduction: more input-output pairs (wider coverage), more targeted inputs (better coverage of the specialised capability), access to confidence scores or log-probabilities (better calibration of the reproduced model), and access to the embedding space (allows reconstruction of the modelβs internal representations).
The value of the stolen model scales with the originalβs specialisation. A general-purpose model adds minimal value by stealing because the underlying base model is public. A fine-tuned specialist model β legal, medical, financial, domain-specific β represents a real investment in training data collection, annotation, fine-tuning compute, and evaluation. That investment is what the model stealing attack recovers without cost. The assessment question isnβt βcan this model be stolen?β β any model accessible via API can be approximated through sufficient probing. The question is βhow much investment does an attacker need to produce a reproduction of acceptable quality, and does that cost exceed the value of not having done the fine-tuning?β
Systematic Input-Output Pair Collection
The input-output pair collection strategy determines the fidelity of the reproduction. Random sampling covers the modelβs general behaviour but misses the specialised capability. Targeted sampling focuses on the fine-tuned domain β the specific inputs where the modelβs behaviour diverges from the base model β and produces a higher-fidelity reproduction with fewer queries. A legal model targeted with legal inputs, a medical model targeted with clinical inputs, a financial model targeted with financial queries.
β‘ EXERCISE 1 β KALI TERMINAL (25 MIN)
Build a Systematic Model Probing and Pair Collection Tool
β±οΈ 25 minutes Β· Kali Linux Β· Python Β· OpenAI API
π Read the complete guide on Securityelites β AI Red Team Education
This article continues with deeper technical detail, screenshots, code samples, and an interactive lab walk-through. Read the full article on Securityelites β AI Red Team Education β
This article was originally written and published by the Securityelites β AI Red Team Education team. For more cybersecurity tutorials, ethical hacking guides, and CTF walk-throughs, visit Securityelites β AI Red Team Education.

Top comments (0)