The newest target in security.
Every company is shipping an AI feature. Support chatbots, internal copilots, assistants that read your email and agents that open tickets on your behalf. Each one is software that takes instructions in plain language, which means each one can be talked into doing the wrong thing.
Hacking an LLM application is rarely about breaking the model itself. It is about breaking the system built around it: the prompts, the data it can read, the tools it can call and what happens to its output. This guide covers where to practise without breaking the law, the methodology real AI red teams follow, the tools worth learning and how this becomes a job.
First, the rules.
Only test what you own or have written permission to test. Public chatbots come with terms of service, and some vendors run bug bounty programmes with clear scopes for AI issues. Read the scope before you type a single prompt. Everything in this guide is for your own lab, deliberately vulnerable training targets or authorised engagements.
Where to practise legally.
Gandalf by Lakera. A free game where each level guards a password behind stronger defences. It teaches the core instinct of prompt injection: the model's instructions and your input live in the same channel, so the right words can override the rules.
PortSwigger Web Security Academy. Free labs on web LLM attacks, where the chatbot is wired into a real web application with APIs behind it. This is the closest thing to what you meet in a real assessment.
Damn Vulnerable MCP Server. A deliberately vulnerable project for practising attacks on AI agents and the tools they connect to: tool poisoning, rug pulls, tool shadowing, indirect prompt injection and token theft.
Your own lab. Run an open-weight model locally with a tool like Ollama, wrap it in a small app with a system prompt and one tool, and attack it. Then fix it. You learn twice as much building the target as attacking someone else's.
The methodology.
AI red teaming follows the same shape as any penetration test: understand the target, map the attack surface, test systematically, prove impact, report. What changes is the attack surface.
1. Recon. Which model family sits behind it, what the system prompt is trying to enforce, which data sources it reads (documents, web pages, emails, a vector database) and which tools it can call. Ask it. Models are often surprisingly willing to describe their own setup.
2. Map the trust boundaries. Draw every place untrusted text can enter: the chat box, uploaded files, pages it browses, emails it summarises, results returned by tools. Each one is an injection point. Indirect injection, where the malicious instruction hides inside content the model reads, is where the serious findings live.
3. Test the guardrails. Direct injection and jailbreaks: role play, instructions split across several messages, translation, encoding and formatting tricks. You are measuring how easily the rules bend, not collecting screenshots of rude answers.
4. Go after impact. This is what separates a real finding from a party trick. Can you make it reveal another user's data? Expose hidden context such as the system prompt or retrieved documents? Call a tool it should not? Produce output that becomes cross-site scripting in the page, or a markdown image that quietly sends data to a server you control? Burn compute until the bill itself becomes the attack?
5. Report like a professional. Map each finding to the OWASP Top 10 for LLM Applications or the OWASP Top 10 for Agentic Applications, show the exact steps, explain the business impact and recommend a fix that changes the architecture, not just the wording of the prompt.
Want a structured cybersecurity path?
The free roadmap covers offensive, defensive, and AI security in one PDF.
Get the free roadmap →The tools worth learning.
garak. An open-source LLM vulnerability scanner from NVIDIA. It throws whole families of probes at a model (injection, leakage, jailbreaks and more) and reports what got through. Broad coverage, fast.
PyRIT. Microsoft's Python Risk Identification Toolkit for generative AI, built by its AI red team to automate multi-turn attacks and score the results.
promptfoo. An open-source tool for testing and red teaming LLM applications. Developers like it because it runs in CI, so every change to a prompt gets attacked again automatically.
Burp Suite. Still essential. Most LLM features sit behind ordinary web APIs, and intercepting the requests shows you exactly what the model receives and what it is allowed to call.
Scanners find the obvious. The findings that matter usually come from a human who understood what the application was supposed to do, and made it do something else.
How this becomes a career.
AI red teaming barely existed as a job title a few years ago. Now security teams, AI companies and consultancies hire for it, under titles like AI security engineer, AI red teamer or LLM penetration tester. The people getting hired combine three things: solid web and application security, a working understanding of how LLM applications are built (prompts, retrieval, tools and agents) and the ability to explain risk to people who are excited about the product.
The fastest route in is the unglamorous one: get strong at web application security first, then specialise. Almost every serious LLM finding still ends in a classic weakness such as broken access control, injection or data exposure. If you can already break web apps, you are most of the way there.
Start this week. Clear Gandalf, finish the PortSwigger LLM labs, build and break your own small chatbot, and write up one finding as if a client had paid for it. That write-up is worth more on your CV than another certificate.
The complete plan.
Module 8 of the Academy, The AI Edge, covers how AI is changing both sides of security. Modules 1 to 3 are free.
Explore the Academy →