
Weekend Creative Agent Challenge: AWS Detective Game with a Mystery Agent
An agent produces a mystery challenge everyday based upon the game results played earlier in the Detective game to identify AWS Services with given clues
Series: Weekend Challenge - August 2026 (3 articles)
- 2Weekend Creative Agent Challenge: AWS Detective Game with a Mystery Agent This article
Vision — what it does, and the problem it solves
I wanted a low-stakes way to keep AWS service names, acronyms, and use cases sharp — the kind of recall you need in an interview or a whiteboard session, not just the kind you get from re-reading documentation. Flashcard apps are fine, but they don't reward reasoning — you either know the term or you don't. I wanted something closer to actually thinking through what a service does.
So I built AWS Service Detective: a browser-based trivia game where you're handed clues about a mystery AWS service, written in a noir detective voice, and you have to name it before you run out of clues. Guess it on the first clue and you've clearly used the service. Guess it on the third and you've probably just memorized the tagline. Either way, you learn something either from getting it right or from reading the explanation when you don't.
Version 1 was a static site: three fixed difficulty tiers, ten hand-written services each, thirty clue sets I wrote myself. It worked, but it was finite — I'd exhaust the content in an afternoon, and updating it meant editing HTML by hand.
The interesting problem was the next one: could the game generate its own content, indefinitely, and get smarter about difficulty the more you played?
That's what turned this into an agent project. Once a day, a small AWS-native agent wakes up, decides what today's mystery should be, writes fresh clues for it with an LLM, and adjusts tomorrow's difficulty based on how you did today. No pre-written question bank. No manual updates. Just a loop that runs itself.
How I built it — process, decisions, and where it actually went wrong
Starting deliberately small
I didn't start with the agent. I built the static three-level game first — Easy/Medium/Hard, ten AWS services per tier, three clues each, scored by which clue you needed. Getting a working, deployed thing on S3 first mattered more than getting the ambitious version right immediately. That constraint paid off later, because the agent's job ended up being narrower than I first assumed it should be.
The key architectural decision: no Bedrock Agents
Amazon Bedrock has a first-class "Agents" feature, and it was tempting to reach for it. I deliberately didn't. For a first working version, I wanted to understand — and be able to debug — every hop a request makes. So the "agent" here is hand-rolled from primitives I already understood: EventBridge Scheduler + Lambda + Bedrock + S3, wired together explicitly rather than delegated to a managed orchestration layer. Cheaper, simpler to reason about, and every failure mode was something I could trace in CloudWatch Logs myself.
Designing the agent's actual workflow
The daily agent follows a fixed sequence:
- Wake up (EventBridge Scheduler, daily cron)
- Check recent challenges — read a rolling history from S3, so it doesn't repeat the same service within a 5-day window
- Choose a service and a difficulty — deliberately not left to the model. I keep curated pools of real, correctly-spelled AWS services per difficulty tier, and the Lambda code itself picks from them. This was a conscious trust boundary: the LLM's job is to be creative with language, not to be the source of truth for facts.
- Generate three clues — this is where Bedrock comes in, using tool-use (function calling) to return structured JSON instead of me parsing free text out of a chat response
- Validate — clue count, non-empty text, and a check that the service name isn't leaked in the first two clues
- Save the challenge to S3, where the static frontend picks it up on next page load
- Go back to sleep
Closing the loop: adaptive difficulty
The part that made this feel like a real agent rather than a scheduled script generator was closing the feedback loop. The browser now posts the outcome of each mystery — solved or not, and on which clue — to a small API Gateway + Lambda endpoint, which appends it to a performance log in S3. The next day's agent run reads that log before picking a difficulty:
- Three mysteries in a row solved on the first clue → step the difficulty up a tier
- A mystery left unsolved after all three clues → step the difficulty down a tier
- Otherwise, hold steady
That's a genuinely adaptive system now, not just a random-content generator on a timer.
What actually broke — the honest version
None of this deployed cleanly on the first try, and I think the failures are more instructive than the happy path:
- CloudFormation's inline code limit. My first version of the agent Lambda tried to live entirely inside the CloudFormation template as an inline
ZipFile. That has a hard 4KB ceiling, and my code — once it had proper validation, history-reading, and tool-use — blew past it. Fix: package the Lambda as a real file and deploy it viaaws cloudformation package, which zips and stages it in S3 before the stack update runs.
- The model access story changed underneath me. AWS retired the old "Model Access" console page months before I built this, which I didn't know until I hit it. Serverless models are auto-enabled per account/region now — except Anthropic models specifically still require a one-time use case details form per AWS account, submitted through the Bedrock Model Catalog. Then, on top of that, some models are fulfilled through AWS Marketplace under the hood, and need a separate one-time subscription trigger. Three different one-time gates, three different error messages, none of which look like each other.
- Newer models need an inference profile, not a bare model ID.
InvokeModelonanthropic.claude-sonnet-4-6directly returned aValidationException— it only accepts on-demand invocation through a cross-region inference profile (us.anthropic.claude-sonnet-4-6), which also meant rewriting the IAM policy to grantbedrock:InvokeModelon both the profile ARN and the underlying foundation-model ARNs it might route to.
- CloudFormation parameter defaults don't self-update. When I bumped a parameter's default value in the template, the already-deployed stack kept using the old value on the next
deploy— CloudFormation only applies a new default on first creation, not on update, unless you explicitly pass the parameter again. Cost me a confusing round of "why is it still using the old model ID" debugging.
- IAM propagation lag. Even with the exact right policy deployed, the very next invoke was denied — the policy just hadn't finished propagating yet. A 30-second wait resolved it.
Every one of these was a genuine "the error message is telling you exactly what's wrong, you just have to read it literally" moment. Cloud debugging rarely fails quietly.
AWS services used, and the architecture

Compute & orchestration: AWS Lambda (the agent, and the result-recording endpoint), Amazon EventBridge Scheduler (daily trigger)
AI: Amazon Bedrock, Claude Sonnet 4.6, invoked via a cross-region inference profile with tool-use for structured output
Storage: Amazon S3 — doubles as both the static website host and the agent's data store (current challenge, rolling history, performance log, dated archive)
API: Amazon API Gateway (HTTP API) — the one write path into an otherwise fully static site
Monitoring: Amazon CloudWatch (error alarm) + Amazon SNS (email notification)
IAM: scoped execution roles per Lambda — no shared "do everything" rol
The design principle underneath all of it: the site itself stays a plain static S3 website — no server, no container, nothing running when nobody's playing. The only place state changes outside of a scheduled run is the single API Gateway route that records a result. Everything else is read-only from the browser's perspective.
What I learned
The interesting design problem wasn't the AI — it was the trust boundary. The most important decision in this whole build was not letting Bedrock choose which AWS service to feature. Language models are good at generating plausible-sounding clues; they're not what I want deciding whether "AWS Transit Gateway" is a real, correctly-named service. Keeping fact selection in code and creative writing in the model made the whole system far more reliable, and made validation genuinely tractable — I'm checking clue quality, not fact-checking an LLM's memory of the AWS service catalog.
"Agent" doesn't require a framework. EventBridge, Lambda, Bedrock, and S3 wired together by hand gave me a system I could fully explain to someone else, hop by hop — which mattered more to me right now than the extra capability a managed agent framework would have added. I'd reach for Bedrock Agents on a bigger project, but starting without one taught me what an agent loop actually is underneath the abstraction.
Serverless "gotchas" are mostly documentation catching up to reality. Nearly every failure I hit — the retired console page, the inference-profile requirement, the Marketplace subscription — wasn't a bug in my code. It was AWS's model-access story evolving faster than the tutorials describing it. The lesson isn't "be more careful"; it's that when you're building on a fast-moving platform, the error message is more current than the blog post you're reading, mine included by the time you read this.
A feedback loop turns a generator into an agent. Before the performance-tracking piece, this was a scheduled content generator with good taste. After it, the system has memory of how you specifically are doing and adjusts for you — which is a small change in code and a real change in what the thing feels like to use.
Built as a weekend project — three phases of static game, then four phases of turning it into a self-updating agent.
Series: Weekend Challenge - August 2026 (3 articles)
- 2Weekend Creative Agent Challenge: AWS Detective Game with a Mystery Agent This article
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article