AI security: secure and test LLM apps and agents

Stage 2 · Lesson 2 of 7

Instructions and data share one channel

How LLM apps and agents work, and where they break

In a normal program, code and data are kept apart: a database knows which part of a query is the command and which part is a value. A language model has no such separation. The , a user's question and a paragraph from a retrieved web page all arrive as the same kind of text, and the model decides by probability which parts to treat as .

That is the of , and it is why the model cannot be a security boundary. Every serious defence in this roadmap follows from it: enforce rules in code outside the model, limit what the model can trigger, and treat its output as untrusted.

Common trapbelieving a stronger model or a cleverer system prompt will fix this, when the problem is the shared channel itself.

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

Resources for this stage

Start with· follow one of these

  • CoursePaid
    Grokking Prompt Engineering for Software Engineers

    Design Gurus · Beginner · Subscription

    How system prompts, context and structured output really work, the ground every LLM risk stands on

  • CourseFree
    Hugging Face Learn

    Hugging Face · Intermediate

    Free courses on how language models, embeddings and agents work, at an engineer's level

Practise

  • Run a small model locally as the heart of the practice app you will defend and test

  • Build your practice app's two tools as a tiny MCP server, so later stages have something real to secure

Keep handy

Also worth your time

Mark this stage as not done?