This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine
What I Built
The Haunted Prompt is a spooky game about prompt injection. A local open-weight model plays a ghost that guards a secret word. You get six levels to trick it, and after every win the game opens a "defense workshop" that shows the defense that would have stopped you, with a copy-paste fix.
The ghost in the machine is literal here: a language model that was told to keep a secret, and that gives it away if you ask the right way.
The Chatty Ghost: the secret is protected only by an instruction.
The Keyword Warden: a blocklist on what you type.
The Censor: an output filter that hides the plain word.
The Letter: the ghost only summarises a letter you write, which it was told is untrusted data (indirect injection).
The Crypt Keeper: the ghost has tools, and you must get it to call the one it must never call.
The Gated Crypt: same attack, but a human approval gate stands between the model and the…