Herclew: The Autonomous AI Game Master Living in Your DMs ๐ฆโค
What if your next favorite role-playing game didn't live on Steam or in a browser, but directly inside your chat appsโmanaged by an autonomous, self-improving AI agent that could compile your code in a secure sandbox?
Introducing Herclew (the hybrid convergence of Nous Research's Hermes Agent and OpenClaw's universal gateway). For the June Solstice Game Jam, I built Solstice Cage, an interactive, cryptographic text-adventure game hosted entirely on WhatsApp, Telegram, and Discord, where the Game Master is an autonomous AI agent running inside a containerized kernel-level sandbox.
๐ฎ What I Built: "Solstice Cage"
Solstice Cage is a terminal-based and chat-based cryptographic adventure. You play as a field agent in June 1941, working to decrypt intercepted transmissions.
- The Interface: You play by simply DMing the Herclew agent on WhatsApp, Telegram, or Discord.
- The Gameplay: The agent acts as the Game Master (GM), describing your environment, generating cryptographic ciphers, and spawning a secure, interactive bash shell where you can write and execute decryption scripts.
- The Goal: Break the codes and escape the facility before the solstice sun sets.
โ๏ธ Solstice Theme Relevance
The game is built around the passage of time and the duality of light and shadow:
- Daylight Cycle: The gameโs difficulty and environmental descriptions sync with the real-world daylight hours of the June Solstice. During the longest day of the year, players have more time, but the heat depletes their resources.
- Visual Contrast: If played via the Web Canvas UI (A2UI), the interface transitions dynamically from deep shadow during night hours to bright, high-contrast layouts representing intense solstice daylight.
๐๏ธ How I Built It (The Herclew Architecture)
Herclew is structured as a decoupled monorepo:
-
TypeScript Gateway (
gateway-node): Handles connection interfaces for WhatsApp, Telegram, and Discord, processes incoming DMs, and manages active session states. -
Python Reasoning Core (
core-agent): Manages the AI agent planning loop, memory recall, and tool execution. -
The Secure Sandbox: Running untrusted code is dangerous. Herclew cages the agent and the player's scripts using Linux kernel-level enforcement:
- Landlock LSM: Strictly limits file system access.
-
Seccomp BPF: Filters system calls (blocking dangerous actions like
ptraceormount). - Open Policy Agent (OPA): Restricts outbound network calls.
๐ Best Ode to Alan Turing
As an entry in the "Best Ode to Alan Turing" category, the game directly incorporates his legacy:
- The Imitation Game: The core puzzle mechanic is an "inverted Turing Test" where the player must convince the AI gatekeeper that they are human by solving algorithmic code-breaking challenges.
- Bletchley Park Ciphers: Puzzles are modeled after the Enigma and Caesar ciphers. Players must write code in JavaScript or Python to decrypt complex patterns, mirroring the cryptanalysis work done during WWII.
๐ง Best Google AI Usage (Gemini 3.5)
Herclew uses the Google Gemini API (via Gemini 3.5 Flash and Pro) to drive the entire experience:
- Narrative Generation: Gemini acts as a dynamic storyteller, reacting to players' creative inputs and describing the unfolding adventure.
- Structured Output Gating: Using Pydantic templates and constrained generation, Gemini validates player moves and execution results reliably.
- Interactive Code Guide: If a player gets stuck on a cryptographic puzzle, Gemini provides contextual hints and debugging support without spoiling the answer.
๐ Check Out Herclew
The code for Herclew is fully open-source:
๐ GitHub: aniruddhaadak80/herclew
Try hosting your own AI Game Master today!
Top comments (0)