Skip to content

johnny603/lux

Repository files navigation

Interactive Puzzle Server + Agent

CI CodeQL

Overview

  • A minimal Flask-based puzzle server exposing simple levels and a validation endpoint.
  • An interactive CLI agent that lists levels, fetches descriptions, accepts attempts, and asks Ollama for hints.

Setup

  • Python 3.10+
  • Docker installed and running (required for script-based puzzles)
  • Ollama installed and running locally
  • Model llama3.2 pulled

It is recomended to use a virtual environment

python3 -m venv venv
source venv/bin/activate
  1. Install dependencies:
python3 -m pip install -r requirements.txt

Run

  1. Start Ollama service
ollama serve
ollama pull llama3.2
ollama list
  1. Start the server:
python3 server.py
  1. In another terminal, run the agent:
python3 agent.py

Server is hosted in http://127.0.0.1:5050

Notes and security

  • Some levels validate by string comparison.
  • Script-based levels run inside a Docker container with network disabled, dropped capabilities, and limited CPU/memory.
  • Docker must be installed, the daemon must be running, and the user running the server must be allowed to run docker.
  • For production, use stronger sandboxing, authentication, and persistent progress storage.

Design

  • The server exposes /levels, /level/<id>, and /submit.
  • For script-based levels, POST /submit accepts JSON { "level_id": "5", "files": { "answer.c": "<source>" } } and returns test output.
  • The agent uses Ollama (llama3.2) to produce contextual hints; it instructs the model not to reveal flags.

Next steps

  • Add more levels with staged tasks and progressive hints.
  • Implement an interactive web UI.
  • Add secure sandbox execution for C compilation and run (via Firecracker, gVisor, or chrooted containers).

About

Lux is an open-source puzzle and learning platform that combines Linux, programming, cybersecurity, and AI-assisted problem solving into an interactive adventure. Players progress through hands-on challenges, receive contextual hints powered by local AI models, and learn practical technical skills through experimentation rather than memorization.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages