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 persona-based jailbreaks in AI. Learn how attackers use roleplay and fictional framing to bypass LLM safety guardrails, and how to defend with intent classification.
If prompt injection is about hijacking the structure of an AI's instructions, jailbreaking is about subverting its safety alignment. The most common and most studied way to do that is the persona-based jailbreak, also called a roleplay jailbreak.
Large Language Models (LLMs) are trained to be helpful, cooperative and immersive. During Reinforcement Learning from Human Feedback (RLHF) they are rewarded for creative writing, for taking on a tone and for fulfilling requests inside a hypothetical scenario. A persona jailbreak turns that training against the model.
The user asks the model to take a fictional role: an unfiltered AI (the well-known "DAN", "Do Anything Now" family), a nostalgic relative, a cybersecurity professor or a character in a story. That creates a "safe space" inside the context window. The model wants to stay consistent with the role and to please the user, so it may relax its safety alignment because breaking character feels like failing the task.
For a defender this matters because these attacks do not need broken code. They use the same traits that make the model useful. You cannot stop them with simple keyword blocking. You need to look at intent.
Note: all scenarios, logs and targets in this lesson are fictional and made for isolated lab practice. Adversarial prompts are never written out here. In the lab they appear only as <redacted prompt N> references with a category label.
To defend well, you need to know which levers a persona prompt pulls. The defender view of the attack chain has four stages.
Visual: the persona adoption attack chain
Create a free account to unlock the rest of this task, complete tasks, and earn Rep.
Sign inNetwork Forensics
Network traffic is the nervous system of any organization, and for attackers, it is the highway used for initial access,
ViewWindows Fundamentals
The Windows Fundamentals learning path provides a comprehensive foundation in Microsoft Windows operating systems, speci
ViewExploitation Fundamentals
Build an understanding of security testing and how to document a finding. The rooms cover tool concepts, SQL injection,
ViewPrivilege Escalation
A comprehensive learning path covering the core methodologies of post-exploitation privilege escalation across both majo
ViewNetwork Design and Architecture
Elevate your career from network technician to strategic network architect. This advanced learning path takes you beyond
ViewMalware Classification and Detection Engineering
This advanced learning path bridges the critical gap between reverse engineering and proactive threat hunting. You will
View