liveBook · Manning

Threat model

As explained in Build AI-Enhanced Web Apps

A threat model is a structured process for identifying potential vulnerabilities and assessing which application components are most at risk.

A threat model is a structured process for identifying application vulnerabilities and assessing which components face the greatest risk. It provides the starting point for securing AI applications before validating or processing user data. section 9.1.1 section 9.7

Build the model around three inspection areas:

  • Public endpoints: find every endpoint external users can access, including page POST requests in React server-component applications and API routes in earlier architectures. section 9.1.1
  • User input points: locate forms, API requests, and other places where external data enters the application. section 9.1.1
  • Data sensitivity: prioritize inputs that could expose personal or sensitive information, including emails, passwords, IPs, and special identifiers. section 9.1.1

Threat-model pass for an AI chat endpoint

Enumerate the chat endpoint, identify its prompt input, and classify the data it accepts. Use those findings to prioritize server-side validation before the prompt reaches application or model-processing logic; client checks can improve the experience but must not be the security boundary. section 9.1.1 section 9.7

How Build AI-Enhanced Web Apps covers it

How deep it goes
Defines a three-part inspection process covering endpoints, input locations, and data sensitivity, then connects findings to validation priorities.
Examples
Uses React server-component POST requests, API routes, forms, user inputs, and personal data as analysis targets.
What you can do after
Evaluate application exposure and prioritize server-side validation for endpoints, inputs, and sensitive data.
How it connects
Connects threat modeling with input validation, public endpoints, server validation, prompt injection, security middleware, and rate limiting.

Also explained in

Compare how 7 books explain threat model →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build AI-Enhanced Web Apps. The section links point to the parts of the book it draws on.