Introduction to AI Hacking

Pwned Labs
  • October 10, 2026

AI hacking is the practice of attacking the systems built on top of large language models: chat assistants, retrieval pipelines, and the agents that now take actions on their own. It is a fast-growing area of security work, and it is more approachable than it first appears. If you can test a web application, you already have most of the skills you need. Pwned Labs teaches AI hacking hands-on, from prompt injection labs set in live Azure environments to the AI Systems Attack and Defense bootcamp, which requires no prior AI security experience and leads to the AISRTP certification. This introduction explains what AI hacking is, the families of attack we use to map the surface, what they look like in the real world, and how to start.

Key Takeaway: AI hacking is the authorized testing of applications built on large language models. The weak point is usually how the model is wired into a product: what untrusted text reaches it, what tools it can call, and how its output is handled. The skills transfer directly from web and API testing, so a machine learning background is not required to start.


What is AI hacking?

AI hacking, sometimes called AI red teaming, is the authorized testing of AI-powered applications to find and exploit weaknesses before a real attacker does. It focuses on the application around the model, not the mathematics of the model itself: how untrusted text reaches it, what tools it can call, and what happens when it is convinced to do something it should not. The model is only one component, and the interesting bugs live in how it is wired into a product. Pwned Labs builds its Breach the Perimeter via Prompt Injection lab on that point: what an assistant discloses becomes a credential that leads into Azure, rather than a jailbreak for its own sake.


Why AI systems are a new attack surface

Traditional software keeps instructions and data in separate lanes. An AI application does not. The system prompt, the developer rules, retrieved documents, and the user message all arrive as one stream of text, and the model does its best to be helpful with all of it. That single property moves the trust boundary in ways defenders rarely model, and it is why an attacker who controls any part of that text can try to steer the system. Add tools and autonomy, and one successful nudge can turn into a real action: reading a record, calling an API, or changing a file. Pwned Labs teaches this trust inversion in its Exploit Indirect Prompt Injection for Azure Access lab, where content from a low-trust source directs actions the application believes only its own instructions can direct.


The attack surface: seven families

Pwned Labs groups AI attacks into seven families, ordered by where they act on the pipeline, from the input the model reads to the actions it takes. Each family maps to the OWASP Top 10 for LLM Applications, the standard reference for this work, and to MITRE ATLAS. The full taxonomy, with techniques and defenses for each family, is covered in our guide to AI penetration testing. As a beginner, the first three rows are where almost all early wins come from.

Family What it targets A beginner example OWASP
01 Instruction The prompt itself Typing an instruction that overrides the system prompt (direct injection, jailbreak) LLM01
02 Context What the model is fed Planting an instruction in a document or web page the assistant later reads (indirect injection, RAG poisoning) LLM01, LLM08
03 Model The model itself Probing to extract the model or its training data, or slipping past intent detection LLM03, LLM04
04 Disclosure What the model reveals Coaxing out the hidden system prompt or another user context LLM02, LLM07
05 Output What the model emits Making the model return markup or a link that fires when the page renders it LLM05
06 Agency What the model can do Coercing a tool call so the agent reads a record or takes an action the user never asked for LLM06
07 Platform The control plane around the model Reaching the cloud identity, storage, or network the model service runs on Cross-cutting

Instruction: the prompt itself

Instruction attacks hijack the text the model treats as its orders. The classic case is direct prompt injection, where the attacker types an instruction that overrides the system prompt, and jailbreaks that talk the model out of its restrictions. This is LLM01, the top risk in the OWASP list, and it is the warm-up that every other family builds on.

Context: what the model is fed

Context attacks poison the material the model reads during a normal request. In indirect prompt injection the instruction is planted in content the model later retrieves, such as a document, ticket, email, or web page, so the victim never sees the payload. Retrieval-augmented generation widens this: if an attacker can seed or edit a source the assistant retrieves, they can make it treat attacker-controlled text as truth. Weak ingestion controls, broad source scope, and poor tenant isolation in vector stores all make it easier. Indirect injection is the more dangerous form because it needs no direct access to the application. Our explainer covers indirect prompt injection in more detail.

Agency: what the model can do

When an assistant can call tools, the impact grows. The model decides and the server executes, so coercing a sensitive call, shaping its arguments, or treating a tool response as a trusted instruction can make an agent read restricted data or take actions the user never requested. When an agent treats a tool or retrieval response as trusted instruction, a single poisoned response can drive the next action. OWASP tracks this as excessive agency, LLM06, and it is where retrieval poisoning and tool abuse chain into real-world impact.

Platform: where it all runs

The last family is the control plane around the model: the cloud identity, storage, and network the model service depends on. It is cross-cutting because it sits under every other family. Agents that chain tools, run in CI/CD, or connect to external tool servers over the Model Context Protocol widen the surface again, through tool description poisoning, missing provenance, and unsafe trust in tool responses. This family is also the bridge to cloud security, which we return to at the end.


AI hacking in the real world

These families are not hypothetical. Each of the following is a disclosed, real incident.

  • EchoLeak (CVE-2025-32711, CVSS 9.3, June 2025): a zero-click indirect prompt injection in Microsoft 365 Copilot that could exfiltrate data with no user interaction. Patched by Microsoft.
  • ForcedLeak (CVSS 9.4, 2025): indirect prompt injection in Salesforce Agentforce, delivered through a Web-to-Lead field, led to CRM data exfiltration. Reported and patched by Salesforce.
  • Slack AI (August 2024): data exfiltration from private channels via indirect prompt injection, cataloged as MITRE ATLAS case study AML.CS0035.
  • Google Bard and Workspace (2023): researchers used indirect injection to pull account data and exfiltrate it through a rendered markdown image link, an early public example of the output-rendering sink. Documented by Embrace The Red and mitigated by Google.

The Pwned Labs Exploit Indirect Prompt Injection for Azure Access lab uses the same delivery route as these incidents, instructions planted in content the assistant later retrieves, and follows it into Azure storage.


How AI hacking differs from traditional hacking

The mindset is familiar: enumerate the surface, find where untrusted input meets trusted logic, and abuse the gap. What is new is the medium. Instead of crafting a payload for a parser, you are persuading a model, and instead of a fixed exploit, you sweep a catalog of techniques and record what works. The base skills transfer directly. Comfort with HTTP, reading JSON, an intercepting proxy, and a general security foundation are enough to start, and a machine learning background is not required. Pwned Labs sets the same bar for its AI Systems Attack and Defense bootcamp, where lab guides give every command in full, so no Python is required.


The skills and tools you need to start

You need less than you might think. A working knowledge of HTTP requests and responses, comfort reading and editing JSON, and an intercepting proxy such as Burp Suite, Caido, or OWASP ZAP cover most of the day-to-day work. On top of that, three habits matter more than any single tool. First, we learn to recognize when an application is model-backed, by watching for natural-language responses, streamed output, and calls to model endpoints. Second, we keep a running catalog of injection and jailbreak techniques, because AI testing is iterative: we try many phrasings and record what moves the model. Third, we track how the application behaves, so we notice when a tool call or a retrieved document quietly changes what the model does. None of this requires training a model or understanding the underlying mathematics. Pwned Labs opens its AI Systems Attack and Defense bootcamp with the first of those habits: recon and fingerprinting to confirm that an application is LLM-backed and to identify the model and stack.


How do I learn LLM prompt injection attacks?

Prompt injection is the first technique to learn because it is the entry point for nearly every real AI attack, and it is learned by doing it in order against authorized targets. The sequence that works runs like this.

  1. Understand the stream. Everything the model reads arrives as one stream of text: the system prompt, the developer's rules, any retrieved documents, tool results, and the user's message. Injection works because the model has no hard boundary between them, only a priority it tends to follow. Once that is clear, the question for every target becomes which parts of the stream an attacker can write to.
  2. Start with direct injection. Against a target built for practice, work the basic patterns methodically: instruction override, role and persona framing, asking the model to repeat or translate its own instructions, and encoding tricks that slip past string filters. Keep a catalog and record a success rate for each phrasing, because model behavior is probabilistic and one refusal proves nothing.
  3. Move to indirect injection. Plant the same instructions where the model will later read them: a document in a knowledge base, a support ticket, an email, a web page, or the output of a tool. This is where the real incidents live, and our glossary entry on indirect prompt injection covers the delivery vectors in more depth.
  4. Learn the exits. An injection only matters once it reaches an effect, so learn how injected instructions get data out (a rendered markdown image or link whose URL carries the data, a tool that sends messages) and how they turn into actions (a tool call with attacker-chosen arguments).
  5. Chain it in a real environment. Production assistants run on cloud services, so the last step is driving an injection through a tool or agent into IAM, storage, or secrets. That is the point at which a prompt trick becomes a security finding.

For practice targets, the Pwned Labs labs breaching the perimeter via prompt injection and indirect prompt injection for Azure access, both Premium, take you from direct and indirect injection into a live cloud environment, and the PromptStorm blue team cyber range shows how this kind of breach looks to defenders in AWS. The OWASP Top 10 for LLM Applications entry for prompt injection, LLM01, is the reference to read alongside, and our OWASP LLM Top 10 guide explains it with the disclosed incidents it caused.


How to get started with AI hacking

The fastest way to learn is hands-on, by attacking real, authorized targets. A practical path runs in order: learn the LLM application surface and how to tell an app is model-backed; work the direct prompt injection techniques methodically; move to indirect injection and RAG poisoning; then attack tools and agents. We only ever test systems we own or are explicitly authorized to assess.

Pwned Labs builds this hands-on. You can practice against dedicated targets in prompt injection labs such as breaching the perimeter via prompt injection and indirect prompt injection for Azure access, both Premium, and see the defender's side in the PromptStorm blue team cyber range. To go end to end, from prompt injection through RAG and agentic compromise, and validate the skill hands-on, the AI Systems Attack and Defense bootcamp leads to the AISRTP certification. For the broader curriculum, see our AI security training overview.

For free practice beyond our own labs, we keep an open list of AI security labs, tools and courses on GitHub, including Lakera's Agent Breaker for prompt attacks against mock AI apps, Damn Vulnerable LLM Agent for attacking an agent that has tools, and scanners such as garak and PyRIT.

Once the fundamentals feel comfortable, the next step is applying them where these systems actually run: the cloud. Production AI typically runs as a set of cloud services, so model exfiltration, agent pivots, and retrieval poisoning quickly become cloud attack paths that touch IAM, storage, and network controls. Our deeper walkthrough of attacking AI workloads in the cloud picks up where this introduction leaves off.


Common beginner mistakes

Three mistakes often slow beginners down. The first is treating the model as the target. The model is rarely the weak point; the wiring around it is, so the questions that matter are what untrusted text reaches it, what tools it can call, and what it is trusted to do with the result. The second is testing only direct prompt injection. Direct injection is the warm-up, and the higher-impact bugs live in indirect injection and retrieval poisoning, where a payload planted in a document, ticket, or web page fires during a normal user's request. Pwned Labs orders its prompt injection labs the same way, with Exploit Indirect Prompt Injection for Azure Access building on the direct injection covered in Breach the Perimeter via Prompt Injection. The third is stopping at the first refusal. Guardrails are probabilistic mitigations, not hard boundaries, so one blocked prompt tells you little; real assessment means sweeping many variations and encodings before concluding that a control holds.

Practice this at Pwned Labs

Pwned Labs runs the beginner path in this guide as hands-on labs in live Azure environments. The two prompt injection labs are Premium, and the free key vault lab assumes no prior Azure experience.

  • Breach the Perimeter via Prompt Injection (Premium, Beginner): use prompt injection to make an AI assistant disclose secrets, then follow a leaked SAS token and multi-tenant service principal credentials into Azure storage and across tenants.
  • Exploit Indirect Prompt Injection for Azure Access (Premium, Beginner): plant instructions in content an AI assistant retrieves, then follow what it exposes into Azure storage and on to deployment credentials. It builds on the perimeter lab.
  • Unlock Access with Azure Key Vault (Free, Beginner): enumerate an Azure environment, find a key vault your access can reach, and use the secrets inside it to move further in.


Frequently asked questions

Is AI hacking legal?

Only when it is authorized. Test systems you own or have explicit written permission to assess, and use dedicated practice environments like Pwned Labs labs to learn safely and legally.

Do I need a machine learning background to hack AI?

No. AI hacking targets the application around the model. Web and API testing skills, comfort with HTTP and JSON, and a general security foundation are enough to start.

What is the most important AI attack to learn first?

Prompt injection. It is the top risk in the OWASP Top 10 for LLM Applications and underpins most disclosed incidents, especially in its indirect form against agentic and retrieval-augmented systems.

How do I learn LLM prompt injection attacks?

In order, against authorized targets: understand that the model reads one stream of text with no hard boundary between instructions and data, work direct injection patterns and record what succeeds, move to indirect injection through documents, tickets, emails and tool output, learn how injected instructions exfiltrate data or trigger tool calls, then chain it into a cloud environment. The Pwned Labs prompt injection labs cover direct and indirect injection through to cloud access, and the PromptStorm blue team cyber range covers the defender's side.

What tools do I need to start AI hacking?

An intercepting proxy such as Burp Suite, Caido, or OWASP ZAP, something to send and read raw HTTP and JSON, and a running catalog of injection and jailbreak techniques. The web and API tooling you already use covers most of the work.

How does AI hacking relate to cloud security?

Closely. Production AI typically runs as cloud services, so attacks like model exfiltration, agent pivots, and retrieval poisoning become cloud attack paths that touch IAM, storage, and network controls. Cloud security skills and AI security skills reinforce each other.

About Pwned Labs

Pwned Labs is a hands-on cloud and AI offensive security training platform. It runs real-world attack labs and bootcamps for AWS, Azure, GCP, Kubernetes and AI systems, including the ACRTP, MCRTP, GCRTP, KRTP and AISRTP certifications. Free labs are at pwnedlabs.io/explore.

Related Articles

OWASP LLM Top 10 (2025): Risks and How to Test Them

October 8, 2026
The most common attacks against AI systems and large language models are application-layer attacks on how the model is...

AI Penetration Testing: Methodology, Tools and Scope

October 8, 2026
AI penetration testing is the authorized security assessment of an AI-powered application to find and exploit...

Prompt Injection Prevention: How to Defend LLM and AI Agent Applications

October 29, 2026
Prompt injection prevention is the set of controls that stop an attacker's text from steering a large language model...