How I solved this level. But there are many other ways to do it!
Try it yourself at
Prompt injection
Though the Gandalf challenge is light-hearted fun, it models a real problem that large language model applications face: prompt injection.
Your goal is to make Gandalf reveal the secret password for each level. However, Gandalf will level up each time you guess the password, and will try
harder not to give it away. Can you beat level 7?