AI security: secure and test LLM apps and agents

Stage 2 · Lesson 7 of 7

Build the app you will defend and test

How LLM apps and agents work, and where they break

The best practice target is an app you built and own. Run a small open model on your own machine with , or use a hosted with a spending limit set first. Build a little support assistant around it: a , a few documents of your own for retrieval, and two harmless tools, such as looking up a fake order and drafting a fake email.

Keep it on your machine, not the public internet. Now you can see every prompt, chunk and tool call, and testing costs little. Every later stage adds to it: defences on the builder's side, test suites on the tester's side. Keep it in Git from day one so your portfolio shows the history.

Common trappractising on a company's live chatbot, which is unauthorised testing whatever your intent.

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?