Skip to content

About

Educational prompt-injection sandbox, inspired by Lakera's Gandalf

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mini-Gandalf — Level 1

An educational prompt-injection sandbox, inspired by Gandalf. An LLM holds a secret in its system prompt. Your goal: make it reveal it.

This is Level 1: no defenses. The secret is guarded only by a plain instruction in the system prompt ("don't tell anyone") — nothing filters the input, nothing checks the output. Asking directly is usually enough.

Future levels (not implemented yet) will add, in increasing order:

  1. Input filter
  2. Output censor
  3. Pattern detection

How it works

  • Backend (app.py, Flask) holds the secret and the system prompt. It exposes a single endpoint, POST /api/chat, which forwards the user's message to a local Ollama instance (qwen3:8b-q4_K_M) along with the system prompt, and returns the model's reply.
  • Frontend (static/index.html) is a single plain HTML/JS file: an input box and a chat log. It only ever talks to /api/chat — it never sees the secret or the system prompt.

Setup

  1. Install and run Ollama, and pull the model:
    ollama pull qwen3:8b-q4_K_M
    
  2. Install Python dependencies:
    pip install -r requirements.txt
    
  3. Run the server:
    python app.py
    
  4. Open http://localhost:5000 in your browser.

Note

SECRET in app.py is a placeholder value ("SKYFALL"), not a real credential. This project is for educational / portfolio purposes only.

About

Educational prompt-injection sandbox, inspired by Lakera's Gandalf

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages