AI Platform and Security · Module 4 · Security

AI Security Engineering in Practice

The lesson is the engineering handbook that follows from the threat map. Using a payment-dispute assistant at a retail bank, participants apply a threat-modelling method that extends STRIDE with MITRE ATLAS and OWASP, then work through the controls at each layer from training data to tool execution, a registry gate with six checks, security tests as a pipeline stage, incident playbooks under the European reporting duties, and a control catalogue that generates the evidence mapping.

Lesson 17 of 25Chapter 17105 minutes

Read the chapterThe whitepaperThe slides

All courses / AI Platform and Security / Module 4 / Chapter 17

Learning objectives

After the lesson the participant can:

Key concepts

Defence in depth for AI
Layers from the data and training path through retrieval and the gateway to agents and tools, each assuming the one before it has failed. The threat model, the security tests in CI and the tamper-evident audit log cut across all of them.
Six AI asset classes
Training data; model weights and adapters; prompts, which encode business rules; the retrieval corpus and its index; tools and their credentials; and outputs, which become actions and records. Each has a classification and an owner.
Review trigger
The list in the threat model of configuration paths, such as retrieval sources, tools, model version and prompt template, whose change forces a review. A code-ownership rule routes such changes to the security architect.
Entitlement-aware retrieval
Each document's access attributes are carried onto every chunk, and the filter on the user's delegated identity is applied before the similarity search, never after, because a post-filter leaks through ranking.
Control catalogue entry
An entry that carries framework mappings, the configuration key that implements the control and an evidence query with a fail condition. The pipeline resolves the implementation path, so a renamed configuration fails the build.

Interactive exercises

Do them here and get feedback at once. Choose a card and then where it belongs, or drag it.

Interactive exercise 1 · Sort

STRIDE for AI systems

Sort each AI manifestation under the STRIDE category the chapter's table assigns it to.

Interactive exercise 2 · Put in order

The injection playbook PB-AI-001

Put the steps of the dispute assistant's runbook for a suspected indirect injection in order. Legal classification runs in parallel and is left out.

Teaching plan

15 minThe teacher introduces the dispute assistant and runs a short asset and boundary listing with the room; participants guess which two boundaries surprise teams.
25 minWork down the layers: data and training path, the five retrieval controls, the gateway configuration and the agent runtime with its policy decision point.
15 minRead the security test job and its thresholds, then the three playbooks and the table of reporting duties.
40 minExercise: a threat-modelling workshop in miniature followed by a tabletop on one of the modelled threats.
10 minClose with the control catalogue entry and what the organisation asks of suppliers: exactly what it demands of itself.

Discussion

  1. The security test job tolerates a small success rate for injection attempts but fails on any leakage of another customer's data. How would you justify different thresholds for different suites in your own systems?
  2. The record-keeping duty of AI Act Article 12 and the GDPR's data minimisation principle pull in opposite directions. How does logging identifiers and hashes resolve that, and what does it require of your stores?
  3. Which of your controls is falsifiable today, in the sense that a query would show it failing?

Written exercise

Exercise · 40 minutes

Threat-model workshop and tabletop

Work on an AI system of your own, or on Hansa Mutual's claims correspondence assistant. First list its assets in the six classes with an owner each, and its trust boundaries. Write three threat entries using a STRIDE category, an OWASP identifier and the boundary crossed, with the vector described at the level needed to design the control, and link each to named controls. Add the review trigger paths. Then run a tabletop on one entry: a canary or flag alert has fired. Write who scopes the incident from the trace, what is quarantined or narrowed and by when, which reporting regimes are assessed in parallel, what evidence is preserved, and which regression case and threat model update follow.

Deliverable: A threat model with assets, boundaries, three linked entries and review triggers, plus a one-page playbook with timed steps and owners.

Self-test

Choose an answer to see whether it is right, or open the answer below each question.

  1. Why must the entitlement filter be applied before the similarity search and never after?

    Show the answer

    C. Because a post-filter leaks through ranking
    The chapter requires each chunk to carry its document's access attributes and the filter on the delegated identity to run before search, since filtering afterwards leaks through ranking.

  2. In the agent authorisation policy, which two properties does the chapter say matter more than the details?

    Show the answer

    A. An approval is bound to the hash of the specific action, and the token's subject must equal the user
    Approving one refund cannot authorise the next, and a hijacked agent cannot act for a customer who never opened the session.

  3. How does the chapter position red teaming in the delivery of an AI system?

    Show the answer

    B. As external discovery whose every finding becomes an automated test that also runs on a schedule
    Behaviour changes with every prompt edit and model update, so findings become version-controlled suites in CI, run weekly as well to catch drift in a third-party model.