AI security: secure and test LLM apps and agents

Stage 1 · Lesson 5 of 7

The web weaknesses AI apps inherit

Security foundations for AI builders

Most LLM apps are web apps, so the classic weaknesses still apply, and several come back through the model. happens when untrusted text is pasted into a query or command. Cross-site scripting (XSS) happens when untrusted text is shown in a page as code.

Broken lets one user reach another's data. (SSRF) tricks a server into fetching an internal address. Now replace "untrusted text" with "model output" and you have several LLM risks: a model answer rendered as HTML, a generated SQL query run as is, a URL the agent fetches.

If you know the classic fixes, such as output encoding, parameterised queries, access checks on every request and for outbound requests, you already know half of AI app defence.

Common traplearning AI security without ever learning the web basics.

A question to check yourself, an AI practice session and 2 cheat sheet entries come with the full roadmap. Unlock

Resources for this stage

Start with· follow one of these

Practise

  • Free labs on injection, XSS, access control and SSRF, the weaknesses AI apps inherit

  • A deliberately vulnerable web app to run locally and practise finding and fixing classic bugs

Keep handy

  • Short, reliable guides on threat modelling, secrets, output encoding and SSRF prevention

  • Scan your repositories for committed keys before you build anything with a model API

Also worth your time

Mark this stage as not done?