Prompt Heist: I Built an Ancient-Kingdom Game That Teaches AI Security
Description and use
Prompt Heist is an interactive 2D game that teaches AI security by letting users practice prompt injection and jailbreak attacks safely, with debriefs linking gameplay to real security lessons.
Problem
Prompt injection and jailbreaks are hard to grasp from slides.
Outcome
Prompt Heist provides an interactive, low‑risk environment for learning about prompt injection and jailbreaks, linking gameplay to concrete security lessons.
Workflow
- Build a 2D game with React, Vite, and React Router.
- Create original art with inline SVG and CSS animation.
- Implement walk cycle with requestAnimationFrame along spline paths.
- Add a small API layer for a Python FastAPI backend and an open‑weight Gemma model via Ollama.
- Use a mock server with keyword rules to decide victory.
- Deploy locally with npm run dev and access at http://localhost:5173.
- Iterate by connecting a real FastAPI and Gemma backend, replacing emoji icons with SVG seals, and enabling adaptive boss learning from win history.
Evidence
Prompt injection and jailbreaks are hard to grasp from slides.
I built Prompt Heist for the Hacktoberfest Hack Day (Coimbatore x Init Club and Idea Club). It is a playable 2D ancient-fantasy adventure that teaches AI security by letting you try it, safely, against fictional guardians.
After every level, a short debrief explains why it worked and how a real system should defend against it.
React, Vite and React Router in plain JavaScript.
A small API layer is ready for a Python FastAPI backend and an open-weight Gemma model served through Ollama.
Victory is meant to be decided by the backend, never by the guard's own text. The prototype uses a mock server with simple keyword rules as a stand-in.
- Record date: 2026-10-08T10:40:56.080Z