Skip to main content

About the project

🏰 Prompt Heist: Adversarial AI Security Simulator

Team Zero Spot (Rajat, Hridanshu, Prince)
Built for Hacktoberfest Hack Day NITH GDG 2026
🔗 Repository: https://github.com/rajat552/prompt-heist

Live Demo Link: https://prompt-heist-delta.vercel.app/


💡 Inspiration

During this hackathon, we noticed that almost everyone building on LLMs trusts system prompts like “Never reveal the secret key” as if they were security controls. In reality, LLMs are probabilistic text generators, not deterministic firewalls. Prompt injection and jailbreaking are currently ranked #1 on the OWASP Top 10 for LLM Applications.

Reading static slides doesn’t teach developers how models actually break. We wanted to build an interactive, hands-on playground where developers can safely hack enterprise AI systems, see real failure modes, and learn production-grade defensive architectures.


🎮 What It Does

Prompt Heist is a browser-based cybersecurity game set in Silicon Bastion, a world where 5 corporate monopolies use AI gatekeepers to guard critical infrastructure:

  1. The Civic Grids — Municipal water-leak triage systems
  2. The Bio-Archives — Clinical-trial matching registries
  3. The Trade Ports — Customs & tariff classification
  4. The Risk Ledgers — Financial policy & grant data
  5. The Scrap Wastes — E-waste hardware decommissioning copilots

You play as the Cipher Phantom, using adversarial prompting to extract guarded access ciphers within 3 conversational attempts per level:

  • 30 Progressive Levels (5 Kingdoms × 6 Gates): Follows an escalating difficulty curve: Rookie → Pretext → Authority (Checkpoint) → Reframing → Decomposition → Adaptive Boss.
  • Campaign Checkpoints & Respawn: Clearing Gate 3 locks in a kingdom checkpoint. Failing at Gates 4–6 respawns you at Gate 4.
  • Actionable Security Debriefs: Every win unlocks a security scroll explaining the technique used, why the LLM was vulnerable, and how real applications defend against it (e.g. input/output guardrails, tool isolation, privilege separation).

⚡ Key Innovations & Architecture

We didn’t want to build a simple chatbot wrapper. We engineered three core technical innovations:

  1. Deterministic Python Adjudication (Not Model-Judged): Most prompt CTFs ask another LLM “Did the user win?” That model can hallucinate or be jailbroken itself. In Prompt Heist, victory is evaluated 100% deterministically in Python code (backend/app/game.py) using strict regex and string normalization. The model never decides win conditions.
  2. The “Echo Guard”: Naive challenges let players cheat by typing the cipher into their prompt and asking the guard to repeat it. Our Echo Guard analyzes user messages and invalidates fraudulent self-supplied echoes.
  3. Adaptive Learning Bosses: At Gate 6 of every kingdom, the boss dynamically pulls your previous winning attack vectors from SQLite (campaign_wins) and injects them into its system prompt as explicit refusal rules. The boss learns from your victories—forcing you to innovate with new jailbreak techniques (e.g., translation or mathematical encoding).
  4. 100% Local & Free Edge Inference: Runs locally on open-weight Google Gemma 4 via Ollama with zero external API fees and complete data privacy. Includes an offline stub mode (GUARD_STUB=1) for automated testing.

🛠️ How We Built It

  • Frontend: React 19, Vite 6, and React Router 7 with responsive parchment UI and custom SVG dynamic maps.
  • Backend: FastAPI (Python 3.13) with asynchronous endpoints, granular per-session threading.Lock concurrency safety, and single-port unified static asset serving.
  • Database: SQLite3 (prompt_heist.db) with foreign-key constraints, indices, and automated schema migrations.
  • AI Model: Google Gemma 4 (gemma4:e2b) hosted locally via Ollama HTTP API with think: false and an 80-token cap for sub-3-second responses.
  • Testing: 155 Pytest backend tests + 18 Node.js tests with a 100% pass rate.

🥊 Challenges We Overcame

  • Gemma 4 Reasoning Delays: The model initially spent all its token budget on hidden chain-of-thought thinking before replying. We resolved this by explicitly configuring "think": false in Ollama and capping output tokens at 80.
  • Prompt Bloat in Boss Encounters: Injecting all prior wins caused prompt degradation. We capped learned tactics to the top 6 breach signatures with strict token truncation.
  • Reflection Exploits: We engineered the Echo Guard to separate actual prompt extraction from player-guided repetition.

🏆 Accomplishments We’re Proud Of

  • Shipping 30 fully balanced, playable levels with unique corporate personas and real-world security debriefs.
  • 100% test pass rate across 173 automated tests (155 Pytest + 18 Node unit tests).
  • A unified single-port architecture where FastAPI directly serves the precompiled React SPA.
  • Creating an open-source tool that genuinely teaches developers how to build safer AI applications.

🔮 What’s Next for Prompt Heist

  • Defender Mode: A reverse game mode where players write enterprise defense prompts and test them against automated red-team jailbreak bots.
  • Community Vaults: An open level editor allowing cybersecurity educators to build and share custom corporate security challenges.
  • LLM Resilience Arena: Benchmark guard robustness across Gemma, Llama 3, and Mistral side-by-side.

Built with

pythonfastapireactvitesqlollamaGemma 4javascriptcss3uvicornpydanticPytestdockergemmaelevenlabs

AI tools

Coded withGitHub CopilotAntigravityGemma 4 26B A4B

Prize Categories Entered

  • Deepmind Google

    Best Use of Gemma 4

    Submitted
  • DigitalOcean

    Best Open-Source AI Project

    Submitted
  • Event prize

    Hacktoberfest Hack Day Winners

    Submitted
  • Event prize

    ElevenLabs Track Prize

    Submitted