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
Linux Fundamentals for Cybersecurity
Linux is the backbone of modern cybersecurity. Whether you are defending enterprise servers, analyzing malware, or launc
ViewActive Directory Attacks
A comprehensive, advanced learning path covering the core methodologies of Active Directory exploitation. Progress from
ViewPrivilege Escalation
A comprehensive learning path covering the core methodologies of post-exploitation privilege escalation across both majo
ViewWeb Application Security
A comprehensive learning path covering the most critical web application vulnerabilities beyond basic injection. Progres
ViewRouting & Switching Fundamentals
Build a rock-solid foundation in modern network infrastructure. This learning path takes you deep into the mechanics of
ViewPentest Methodology & Reporting
A great hack is useless if you cannot communicate its business impact. This learning path bridges the gap between techni
ViewPreview · 30 min
Master role-confusion and delimiter injection in AI. Learn how attackers break naive prompt boundaries and how to defend using strict XML delimiters.
Developers learn about basic overrides and try to fix them by wrapping user input in separators, also called delimiters. If those boundaries are built naively, they create a newer and cleverer class of bugs: role confusion and delimiter injection.
Role confusion happens when the LLM loses track of who is who in the conversation: "System", "User" or "Assistant". The attacker writes input that copies the format of a system-level directive, so the model believes the user is now the administrator.
Delimiter injection (or delimiter escaping) is the mechanical side of this confusion. If the app separates the system prompt from user input with a common sequence such as """, ### or even <user>, the attacker simply types the same sequence. That closes the data section early, and the text after it is read as an authoritative system command.
For a security professional these techniques mark the move from semantic manipulation (tricking the model with words) to syntactic manipulation (breaking the structure of the prompt itself). Defence needs careful, parameterized prompt design, not hopeful rules in the system prompt.
Note: All scenarios, code and targets in this lesson are fictional and made for isolated lab environments. Attack wording is replaced with <redacted instruction>.
Naive prompt templates create seams in the context window that an attacker can pull apart.
Visual: the mechanics of delimiter injection
Create a free account to unlock the rest of this task, complete tasks, and earn Rep.
Sign in