DEV Community

Oni
Oni

Posted on

Herclew: The Autonomous AI Game Master Living in Your DMs ๐Ÿฆžโ˜ค

June Solstice Game Jam Submission

Herclew: The Autonomous AI Game Master Living in Your DMs ๐Ÿฆžโ˜ค

Herclew Game Jam Banner

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:

  1. 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.
  2. 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:

  1. TypeScript Gateway (gateway-node): Handles connection interfaces for WhatsApp, Telegram, and Discord, processes incoming DMs, and manages active session states.
  2. Python Reasoning Core (core-agent): Manages the AI agent planning loop, memory recall, and tool execution.
  3. 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 ptrace or mount).
    • 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:

  1. Narrative Generation: Gemini acts as a dynamic storyteller, reacting to players' creative inputs and describing the unfolding adventure.
  2. Structured Output Gating: Using Pydantic templates and constrained generation, Gemini validates player moves and execution results reliably.
  3. 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)