Lab Icon

Prompt Injection: Jailbreak an AI Assistant

Jailbreak a real LLM chatbot, bypass its guardrails, and capture the flags

Hard Updated Sep 01, 2026 Solution (Pro)
Prompt Injection LLM Security AI Red Teaming Jailbreak OWASP LLM Top 10 Guardrail Bypass System Prompt Leakage Excessive Agency

Learn how to jailbreak an AI by prompt-injecting a real language model to leak its hidden system prompt and abuse its internal tool. A hands-on OWASP LLM01 and LLM06 lab you solve from the Attack Terminal with curl.

2
Flags
700
XP
60%
Success Rate

What is prompt injection?

Prompt injection is the number one security risk for large language model applications (OWASP LLM01). It happens when untrusted user input reaches a model that also carries trusted instructions, and the attacker crafts that input to override those instructions: leaking secrets, ignoring safety rules, or triggering actions the developer never intended. Learning how to jailbreak an AI in a safe, legal setting is the fastest way to understand why this bug class is so hard to stamp out.

How this lab works

You are talking to Qwenly, a customer-support assistant backed by a real, locally-run language model. Nothing here is faked: a genuine model reads a system prompt and applies its own safety training, and a wrapper adds an input filter and an output filter around it, exactly how production teams bolt guardrails onto an LLM. Working entirely from the Attack Terminal with curl against its /api/chat endpoint, you will prompt-inject the model to leak the user flag hidden in its system prompt, then talk its internal knowledge-base tool into reading a file well outside the scope it was given (the root flag). The obvious tricks are blocked, so you have to work out what a small model can and cannot be talked into.

Why practice jailbreaking AI?

Every company shipping an AI feature is now defending against these exact attacks. Prompt injection and excessive agency (OWASP LLM06) sit behind real incidents like the 2025 EchoLeak zero-click exploit against Microsoft 365 Copilot. Guardrail products, system-prompt hardening, and output filters are the standard defenses, and this hands-on lab shows you how they fail from the attacker's side. Practicing prompt injection on HackerDNA builds the instinct to spot a weak input filter, notice when a model's output can be smuggled past a naive redactor, and understand that giving an LLM a tool hands that capability to everyone who can talk to it.

What You Will Learn

  • Exploit prompt injection to override an AI assistant's safety instructions
  • Leak a hidden system prompt past both an input and an output guardrail
  • Bypass an output filter with delimiter injection instead of encoding
  • Abuse an LLM tool's excessive agency to read out-of-scope files
  • Chain a path traversal through an AI agent's file-reading tool
  • Map the attack to OWASP LLM01 prompt injection and LLM06 excessive agency

Prerequisites

HTTP basics curl command line Text encodings Basic LLM concepts Curiosity

Ready to hack this lab?

Create a free account and start practicing cybersecurity hands-on.

Start Hacking - It's Free
Start Your Challenge
~1-2 min setup
Dedicated server
Private instance
Standard power
New here? Here's what to do
1
Click "Start Lab" above You'll get your own private machine with an IP address
2
Explore the target Open the IP in your browser and look for vulnerabilities
3
Find and submit flags Flags are secret text strings hidden in the system - paste them below to score

Ready to hack this lab?

Create a free account to start your own dedicated server, submit flags, and earn XP on the leaderboard.

Start Hacking Free
23,000+ Hackers 100+ Labs & Courses Free
Start Hacking Free