Module 11 — AI Cybersecurity
Same theory-first structure as Modules 1–10: for every technique below, what it is, why it exists — the specific problem it was invented to solve — what else you could use instead, and a real financial example. The difference now: the moment Module 10 put the model behind a real API, RR Finance acquired a real attack surface. This module threat-models that system and then attacks it — extraction, evasion, and membership inference — measuring every result honestly, including two findings that are deliberately un-dramatic.
Recap — what RR Finance already has, and why it is now a target
Module 11 is not a fresh start. Here is exactly what it inherits — and why that inheritance is now something an adversary can reach.
A validated tabular model, deep-learning fundamentals with adversarial attacks, NLP and a from-scratch LLM, RAG and agents, and an explainability + fairness audit.
Federated and differentially-private training, multimodal pipelines with tamper detection, and graph-based fraud detection.
A real, running FastAPI service wrapping Module 1's pipeline — Pydantic-validated, containerised, Trivy-scanned, and behind a mutual-TLS boundary. The first time the model was reachable over a network.
Why attack our own system
A model behind an API is only as safe as the weakest thing an attacker can do with query access — and the only way to know that is to try, carefully and honestly.
The core shift
Ten modules built capability; deployment turned that capability into an attack surface. Module 11 measures the exposure that Module 10's convenience created.
The path this module walks
Threat-model the architecture (STRIDE) → map the course to a standard taxonomy (ATLAS) → execute extraction, evasion, and membership inference against the real API → harden it with measured defences.
Why honesty is the method
Every number here comes from a real attack against the real deployed model. Two attacks under-perform — reported as-is, because a security course that only shows scary results teaches nothing about where the real boundaries are.
Threat Modelling with STRIDE
Before attacking anything, enumerate what could go wrong — one structured question per threat class.
STRIDE is a threat-modelling framework that walks six categories of threat — Spoofing, Tampering, Repudiation, Information disclosure, Denial of service, Elevation of privilege — against a specific system, turning "is this secure?" into six concrete, answerable questions.
✓ Use it when
- You have a concrete architecture to model — Module 10's API, container, and mTLS boundary give STRIDE something specific to bite on
- A security review or regulator expects a documented, category-by-category threat model
✗ Reach for something else when
- You need to model attacker capability and likelihood, not just threat categories — STRIDE enumerates what could go wrong, not how likely each is (pair it with a risk-scoring method for that)
The MITRE ATLAS Taxonomy
A shared, standard vocabulary for adversarial ML — so the course's scattered attacks become one coherent picture.
MITRE ATLAS (Adversarial Threat Landscape for Artificial-Intelligence Systems) is the ML-specific counterpart to the well-known MITRE ATT&CK framework: a real, maintained knowledge base of adversary tactics (goals) and techniques (methods) observed against real ML systems.
✓ Use it when
- You need to communicate an ML risk to a security team, or compare your exposure against documented industry incidents
- You want to turn ad-hoc security demos into an auditable map of which standard techniques you have evidence about
✗ Reach for something else when
- You need step-by-step exploit code — ATLAS names and categorises techniques; it is a taxonomy, not an attack toolkit
Model Extraction (Model Stealing)
Reconstructing a functional copy of the model from nothing but its API answers.
Model extraction trains a surrogate model to imitate a target using only (input, output) pairs harvested through the target's API. The attacker chooses inputs, records the returned decisions, and fits their own model — measured by fidelity: how often the surrogate agrees with the victim on fresh inputs.
✓ Use it when
- You are assessing a model that is exposed behind a query API (like Module 10's /predict) and want to know whether it can be cloned
- You want to understand the enabling attack behind offline evasion — a stolen surrogate lets an attacker craft attacks with unlimited, undetected tries
✗ Reach for something else when
- The model is never queryable by untrusted parties — extraction needs query access, so a fully internal model with no exposed API is out of scope for this specific attack
Evasion: Query-Only Adversarial Inputs
Flipping a rejection to an approval by changing only what is reported — with no model internals.
Evasion crafts an input that the model misclassifies in the attacker's favour. In a query-only (black-box) setting the attacker has no gradients — so they start from a real rejected case and greedily probe small, in-range changes, keeping whichever lowers the returned risk, until the decision flips.
✓ Use it when
- You want to test whether a deployed decision can be gamed by an applicant or broker adjusting only reported fields
- You need the black-box counterpart to Module 2's white-box gradient attacks — the realistic case when only an API is exposed
✗ Reach for something else when
- You control the whole pipeline and can verify every input against an authoritative source — then the attack surface this exploits (self-reported, unverified fields) largely disappears
Membership Inference (and an Honest Failure)
Asking whether a specific person was in the training set — and finding, honestly, that this model does not tell.
Membership inference tries to determine whether a specific record was in a model's training set, using the model's outputs alone. It exploits overfitting: a model that memorised its training data tends to answer more confidently on records it has seen than on ones it hasn't.
✓ Use it when
- You are auditing a model's privacy exposure — especially a high-capacity model likely to memorise training rows
- You want to test, not assume, whether Module 7's privacy concern actually materialises for a given deployed model
✗ Reach for something else when
- The model is a small, well-regularised one that barely overfits — as this lesson shows, there may simply be no membership signal to find, and reporting that honestly is the correct result
Defences: What Actually Helps, and By How Much
Turning the attack findings into real, measured mitigations — including where a defence only half-works.
Three real controls, each targeting a specific attack: output minimisation (return only the decision, never the probability), rate limiting (cap queries per caller), and input integrity (consistency checks or server-side recomputation of derived features). Each is measured against the live attacks, honestly, including where it falls short.
✓ Use it when
- You are hardening a deployed model API and want evidence-backed, prioritised changes rather than a checklist
- You need to know the limits of each control — which is exactly what tells you where monitoring must pick up
✗ Reach for something else when
- You are looking for a single silver-bullet fix — the honest finding here is that none of these controls, alone, stops the attacks; they raise cost and must be layered
Module 11 hand-off
The notebook threat-models Module 10's real architecture, maps the whole course onto MITRE ATLAS, then runs real model-extraction, evasion, and membership-inference attacks against the actual deployed API — reporting each result honestly, including an attack that fails and a defence that only half-works — and saves a threat model, an ATLAS map, and per-attack metrics as artifacts.