An autonomous agent built in Python to play hackmerlin.io.
The agent uses a mix of deterministic heuristics and a lightweight local LLM (3B) to solve multiple levels.
- Browser automation:
merlin_interface.py(Selenium) sends questions, captures responses, and submits passwords. - Strategies:
hardcoded_strategies.pydefines question types (direct, spelling, reverse, fragments, acronyms). - Strategy manager:
strategy_manager.pyrotates strategies, drops failed ones, and avoids repeats. - LLM + heuristics:
llm_analyzer.pyextracts candidate passwords via regex, spellcheck, or small LLM calls. - Memory:
letter_clues_manager.pystores fragments and stitches them together for later levels. - Controller:
hackmerlin_agent.pyorchestrates everything and tracks results.
- Python 3.9+
- Chrome + ChromeDriver
- Packages:
selenium,requests,pyspellchecker(seerequirements.txt)
# Install dependencies
pip install -r requirements.txt
# Run the agent
python hackmerlin_agent.py