Roadmaps Security roadmaps AI and machine learning security

LLM and Generative AI Security

Secure chatbots, copilots and other apps built on large language models, from prompt injection and data leaks to RAG and output handling.

Estimated time: 12–23 months · At about 10 hours a week.

Offensive skills are for authorised testing only: your own lab, a practice platform, or a system whose owner has given you written permission. Testing anything else is a crime in most countries.

Learning path

Click a topic to see what to learn and where. Mark topics as you go; your progress is saved in this browser only.

  • Core topic
  • Optional
  1. Beginner · 1–2 months How LLM apps work and how they break
  2. Intermediate · 2–4 months Building LLM apps securely
  3. Advanced · 3–5 months Testing, monitoring and platform security
  4. Expert · 6–12 months Strategy, research and standards

All topics in detail

BeginnerTime: 1–2 months

How LLM apps work and how they break

Skills

  • Explain prompt injection and why filtering alone cannot stop it.
  • Review an LLM feature against the OWASP Top 10 for LLM Applications.
  • Find and demonstrate an injection in a practice lab.

Hands-on projects and labs

  • Complete the Gandalf levels and the PortSwigger Web LLM attacks labs.
  • Build a small chatbot with a free or local model (for example with Ollama) and try to make it reveal its system prompt.
  • Hide an instruction in a web page and show that a summarising bot you built follows it.

Done when you can…

  • Explain the difference between direct and indirect prompt injection with an example of each.
  • Write a short security review of a chatbot design using the OWASP list.

Beginner

How LLMs and chat apps work

Tokens, context windows, system prompts, temperature and tool calls. You do not need the maths, but you do need to know what the model sees on each request.

Resources

Beginner

OWASP Top 10 for LLM Applications

The standard list of LLM app risks: prompt injection, sensitive information disclosure, supply chain, poisoning, improper output handling, excessive agency and more.

Resources

Beginner

Direct prompt injection

A user types instructions that override the developer's. There is no complete fix, so design as if the model will sometimes follow the attacker.

Resources

Beginner

Sensitive data disclosure

Models can repeat secrets from their prompt, their context or their training data. Never put credentials in prompts, and only give the model data the user may see.

Resources

Beginner

System prompt leakage

Assume users can read your system prompt. Keep security decisions in code, not in instructions to the model.

Resources

IntermediateTime: 2–4 months

Building LLM apps securely

Skills

  • Build a RAG app that enforces document permissions per user.
  • Encode and validate model output before it reaches a browser, database or shell.
  • Add guardrails and measure how many attacks still get through.
  • Run garak or promptfoo against an app and triage the findings.

Hands-on projects and labs

  • Build a RAG app over a few documents with different owners, then try to read another user's document through the chat.
  • Make a chatbot render model output as HTML, exploit it with XSS, then fix it.
  • Add promptfoo red-team tests to a small app's CI pipeline.

Done when you can…

  • Ship a small LLM app that passes your own security test suite.
  • Explain to a developer why the system prompt is not a security control.

Intermediate

Improper output handling

Treat model output like untrusted user input. If it becomes HTML, SQL, a shell command or a URL, encode or validate it first, or you get XSS, injection and data theft.

Resources

Intermediate

RAG security

Retrieval-augmented generation feeds documents into the prompt. Check permissions at retrieval time, so the model only sees what this user may see, and treat retrieved text as untrusted.

Resources

Intermediate

Vector database and embedding security

Embeddings can leak the text they came from, and shared vector stores can mix tenants' data. Apply access control, tenant separation and encryption like any database.

Resources

Intermediate

Guardrails and content filters

Input and output classifiers catch many attacks and harmful outputs, but they are a layer, not a fix. Measure what they miss and keep hard limits in code.

Resources

Intermediate

Least privilege for LLM features

Limit what the model can reach: which data, which tools, which actions. Ask the user to confirm anything that changes data or sends something outside.

Resources

Intermediate

Personal data in prompts and logs

Prompts and logs often hold personal data. Detect and redact it, set retention limits, and check what your model provider keeps and trains on.

Resources

Intermediate

Automated LLM vulnerability scanning

Scanners send thousands of known attack prompts and score the replies. Run them in CI so a new prompt or model does not quietly bring back old problems.

Resources

AdvancedTime: 3–5 months

Testing, monitoring and platform security

Skills

  • Run a scoped penetration test of an LLM application and write a report with impact.
  • Design logging and detection for prompt injection and data exfiltration.
  • Assess a model provider's security and privacy terms.

Hands-on projects and labs

  • Test an intentionally vulnerable LLM app you deployed yourself, and write a full report.
  • Run PyRIT against your own app and compare its findings with manual testing.
  • Build a dashboard of prompts, tool calls and blocked requests for a small app.

Done when you can…

  • Lead the security review of a production LLM feature.
  • Show a detection that catches a real indirect injection in your lab.

Advanced

Testing LLM applications

Plan an LLM test like a web app test: scope, threat model, then injection, data exposure, output handling and abuse of integrations. Report impact, not just a funny reply.

Resources

Advanced

Automated red teaming

Tools can generate and mutate attack prompts at scale and score the results with another model. Check the scoring yourself, since judges make mistakes too.

Resources

  • PyRIT ToolFreeMicrosoft

Advanced

Logging and monitoring LLM apps

Log prompts, retrieved documents, tool calls and outputs, with care for privacy. You need these traces to detect attacks and investigate incidents.

Resources

Advanced

Choosing and configuring model providers

Check data retention, training on your data, regional hosting, abuse monitoring and the shared responsibility split. Use the provider's own safety settings where they exist.

Resources

Advanced

Design patterns against prompt injection

The strongest defences limit what an injected instruction can do: separate trusted and untrusted data, restrict tools after reading untrusted text, and keep a human in the loop.

Resources

AdvancedOptional

Multimodal attacks

Images, audio and files can carry hidden instructions too. Test every input type the model accepts, not only text.

Resources

ExpertTime: 6–12 months

Strategy, research and standards

Skills

  • Set GenAI security policy and review processes for a whole organisation.
  • Discover and responsibly disclose new classes of LLM vulnerability.
  • Contribute to industry guidance.

Hands-on projects and labs

  • Write a GenAI security standard for a fictional company, with design rules, tests and monitoring.
  • Publish a write-up or tool on a new LLM attack or defence.

Done when you can…

  • Have your findings, tools or guidance used by others.
  • Run the review process that every new AI feature in an organisation goes through.

Expert

Running a GenAI security programme

Set the rules for every team: an approved list of models and providers, design reviews, mandatory tests, monitoring and an AI incident process.

Resources

Expert

AI bug bounties and disclosure

Many AI companies run bug bounties with their own rules on what counts. Learn what is in scope, report clearly and never use real users' data.

Resources

  • huntr PracticeFreeProtect AI

Expert

Contributing to standards

OWASP, CoSAI and standards bodies welcome practitioners. Contributing is the fastest way to shape the field and learn from the people leading it.

Resources

Overview

Large language models (LLMs) now sit inside search boxes, help desks, coding assistants and internal tools. They take text from users, documents and websites, and they cannot reliably tell instructions from data. That single weakness, prompt injection, is behind many of the attacks in this field.

LLM security is about the whole application around the model: what data it can see, what it can do with its output, how it is grounded with retrieval (RAG), and how you test and monitor it. Much of it is classic application security, applied to a new and unpredictable component.

Why it matters

Almost every organisation is shipping or buying generative AI, and most of the security problems are still being worked out. OWASP, NIST and national cyber agencies now publish guidance, and teams need people who can apply it.

Typical job roles

  • EntryApplication security engineer (AI apps) Reviews LLM features for prompt injection, data leaks and unsafe output handling.
  • Mid-levelAI security engineer Designs guardrails, access control and monitoring for LLM applications.
  • Mid-levelLLM penetration tester Tests chatbots and copilots for injection, jailbreaks and data exposure, with permission.
  • SeniorAI security architect Sets patterns for how teams build RAG, assistants and integrations safely.
  • LeadHead of AI security Owns AI security strategy, policy and the review process for new AI features.

Prerequisites

  • How web applications and APIs work: HTTP, JSON, authentication and sessions.
  • Basic Python, enough to call a model API and write small scripts.
  • The OWASP Top 10 for web applications, at least at a beginner level.
  • No ML maths needed to start; the Machine Learning Security roadmap goes deeper.

Web development AI and machine learning Cybersecurity

Tools and technologies

  • garak Open source LLM vulnerability scanner with hundreds of probes.
  • promptfoo Open source Test and red-team prompts, models and apps, including in CI.
  • PyRIT Open source Microsoft's framework for automated generative AI red teaming.
  • NeMo Guardrails Open source Programmable rails for LLM conversations.
  • LLM Guard Open source Input and output scanners for LLM apps.
  • Purple Llama (Llama Guard, Prompt Guard, CyberSecEval) Open source Safety classifiers and security benchmarks from Meta.
  • Presidio Open source Find and redact personal data in text.
  • Langfuse Open source Tracing and monitoring for LLM applications.
  • Ollama Open source Run open models locally for safe testing.

Certifications

Take them in roughly this order. Costs and details for the ones marked with a link are on the Certifications page.

  1. Intermediate Certified AI Security Professional (CAISP) Practical DevSecOpsHands-on LLM and AI application security.
  2. Advanced AAISM (AI Security Management) ISACAFor AI security management roles, after CISSP or CISM.Cost and exam details
  3. Entry Azure AI Fundamentals (AI-901) MicrosoftOptional AI basics.Cost and exam details

Resources

Frameworks and standards

  • OWASP GenAI Security Project Home of the OWASP Top 10 for LLM Applications and guidance on securing generative and agentic AI.
  • MITRE ATLAS ATT&CK-style knowledge base of attacks on AI and machine learning systems, with real case studies.
  • NIST AI Risk Management Framework (AI RMF) A voluntary framework to map, measure, manage and govern the risks of AI systems.
  • OWASP Top 10 The ten most critical web application security risks, updated every few years from real data.
  • ISO/IEC 42001 The international standard for an AI management system, the AI counterpart to ISO/IEC 27001.
  • EU AI Act The EU law that regulates AI by risk level, including security and robustness duties for high-risk systems.

All frameworks and standards

Career path

A common progression. Titles vary between companies.

  1. Developer or application security engineer0–2 years
  2. AppSec engineer reviewing AI features2–4 years
  3. AI security engineer or LLM penetration tester4–7 years
  4. AI security architect or head of AI security7+ years

Related domains to move into

All security roadmaps Back to top

Last reviewed: . Found a mistake, or want a roadmap written sooner? Contact