NEWPractise supported commands in browser simulations, alongside the lesson.Try a browser practice exercise.Try a lab♥ Codelivly is 100% free, no paywall. If it helped you, chip in to keep it running.100% free. Help keep it so.Support us
Preview · 30 min
Master the difference between LLM jailbreaking and prompt injection. Learn how attackers bypass safety alignment and defend with layered guardrails.
In AI security, the terms "prompt injection" and "jailbreaking" are often used as if they mean the same thing. They are close and they often overlap, but they have different goals and they hit different layers of an AI system. Knowing the difference is the first step for anyone who defends Large Language Models (LLMs).
Prompt injection is mostly an attack on control flow and data flow. The attacker changes the model's input to take over its behaviour: steal the system prompt, force a tool call nobody approved, or leak retrieved data. It works because the system blurs "instructions" and "data".
Jailbreaking is an attack on safety alignment. The attacker writes inputs on purpose to get past the model's ethical and safety rules (set by training such as Reinforcement Learning from Human Feedback, or RLHF). The aim is to make the model produce restricted, harmful or policy-breaking content.
A simple way to remember it: prompt injection makes the model do something it was not supposed to do, like read a hidden file. Jailbreaking makes the model say something it was trained to refuse.
Note: All scenarios, data and targets in this lesson are fictional and made for isolated lab environments. Adversarial prompts are never written out here. They appear only as <redacted prompt N> references with a category label.
To defend well, compare the goal, the target and the mechanism of each attack.
Visual: the attack paradigm shift
Create a free account to unlock the rest of this task, complete tasks, and earn Rep.
Sign inExploitation Fundamentals
Build an understanding of security testing and how to document a finding. The rooms cover tool concepts, SQL injection,
ViewWeb Application Security
A comprehensive learning path covering the most critical web application vulnerabilities beyond basic injection. Progres
ViewNetwork Forensics
Network traffic is the nervous system of any organization, and for attackers, it is the highway used for initial access,
ViewComputer Fundamentals
Before you can hack, defend, or analyze malware, you must understand the machines you are working with. The Computer Fun
ViewCybersecurity Foundations
Every great security professional starts with a rock-solid foundation. The Cybersecurity Foundations learning path is de
ViewSOC Fundamentals
Dive into the daily operations of a modern Security Operations Center. The SOC Fundamentals learning path breaks down ho
View