← ALL PROJECTS

AI AGENTS / GAME

Evil Genius

A turn-based villain-management game with one bounded AI decision: a small Strands Decider model picks the mission specialist, the game engine resolves the consequences, and Amazon Bedrock adds cosmetic dialogue.

Strands DeciderBedrock AgentCoreAmazon BedrockLambdaDynamoDBCloudFront
Evil Genius live game headquarters screen showing resources, the first mission and the four-step guide, with an offline deterministic status badge
LIVE SITE / CAPTURED NOVEMBER 28, 2026

The problem

Most AI game demos let a model make every decision, which makes outcomes unpredictable and costs hard to control. Evil Genius tests a narrower pattern: give the model one typed choice, validate it, and let deterministic code apply the consequences.

I built it for the AWS Builder Center “Agent Experience Hackathon: Strands Decider” (October 16 to 23, 2026). It is a personal project, not employer work.

Architecture

  1. Frontend: a static game served from private S3 through CloudFront.
  2. Bridge: an IAM-authorized Lambda enforces a DynamoDB kill switch and atomic daily quotas before any paid call.
  3. Decision: a pinned int8 Strands Decider model on an AgentCore runtime picks the Breach specialist from an allowlist.
  4. Consequences: the game engine resolves the outcome; Amazon Bedrock Nova Lite only adds escaped, cosmetic narration that cannot change saved state.
  5. Operations: a scheduled cost watchdog Lambda and an SNS budget topic.

Decisions and tradeoffs

  • One bounded AI decision. The browser applies no model-generated arithmetic.
  • Works without AI. When paid inference is off, the game falls back to deterministic choices instead of breaking.
  • Hard cost limits: 50 paid calls per day globally, 10 per player, short session lifetimes, a six-hour spending watchdog, and inference expiry after judging.
  • Reusable pattern: the repository includes a standalone typed-choice to allowlisted-action recipe.

Security considerations

  • The AI bridge requires IAM-signed requests and is protected by a kill switch and per-player quotas.
  • Model output is validated against an allowlist and escaped before display.
  • Saved games are validated on import and fail closed instead of crashing.

Testing and validation

Node tests cover the game engine, campaign balance, save validation and the narration contract; Python tests cover the Lambda bridge and the decision recipe.

Outcome and limits

Deployed and playable. The AI-driven path was live during judging and is now off by design, so visitors play the deterministic version. The demo video is an edited screenshot tour of the build.

PROJECT EVIDENCE

Evil Genius live game headquarters screen showing resources, the first mission and the four-step guide, with an offline deterministic status badge
LIVE SITE / CAPTURED NOVEMBER 28, 2026