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
Windows Fundamentals
The Windows Fundamentals learning path provides a comprehensive foundation in Microsoft Windows operating systems, speci
ViewRecon & Enumeration Tools
Reconnaissance is the foundation of every successful penetration test. Amateurs treat it as a box-ticking exercise, runn
ViewNetwork Design and Architecture
Elevate your career from network technician to strategic network architect. This advanced learning path takes you beyond
ViewNetwork Forensics
Network traffic is the nervous system of any organization, and for attackers, it is the highway used for initial access,
ViewMalware Classification and Detection Engineering
This advanced learning path bridges the critical gap between reverse engineering and proactive threat hunting. You will
ViewPreview · 30 min
Master completion-based prompt extraction. Learn how attackers use autocomplete to leak AI system prompts and defend with instruction hierarchy and DLP.
In lesson 1 you saw that plain questions are often refused, because the model was trained with Reinforcement Learning from Human Feedback (RLHF) to refuse them. Attackers then found a mechanical gap. Instead of asking a question, they give the exact beginning of the hidden text and ask the model to finish the sentence.
This is Completion or Continuation-Based Extraction. The user supplies the first words of the system prompt. The request changes from "reveal a secret" to "autocomplete a pattern", a normal and highly rewarded task. In your logs it is labelled (category: completion).
For a defender, the key fact is: you cannot reliably use natural language to tell a next-token prediction engine to stop predicting the next token. Defence needs structural controls, not better phrasing in the prompt.
All scenarios, code and targets in this lesson are fictional and made for isolated training labs.
Create a free account to unlock the rest of this task, complete tasks, and earn Rep.
Sign in