
Giving the Once Upon Agentic AI Workshop a shared party: a lightweight multiplayer extension
A prototype extends the workshop's single-player Game Master into a shared multiplayer campaign with current hosted browser interface. It reuses the Chapter 8 Amazon Bedrock AgentCore resources and adds a token-protected Lambda API with DynamoDB-backed coordination.
DevOps Engineer
Introduction
In October, I attended the Once Upon Agentic AI workshop in Berlin. I had the chance to exchange ideas with other participants, learn more about managing AI agents, and troubleshoot the infrastructure behind them. The workshop uses a fantasy role-playing game inspired by Dungeons & Dragons to teach the Strands Agents SDK. It guides learners through building agents, connecting them to tools and knowledge, and deploying a Game Master with Amazon Bedrock AgentCore.
After completing the core chapters, I wanted to try one more exercise: what would it take to let several people join the same campaign? I built an optional Chapter 9 infrastructure that adds a shared multiplayer experience while keeping the published workshop browser interface unchanged. The goal was deliberately modest: reuse the Game Master Runtime and Characters Memory already deployed in Chapter 8, add as little infrastructure as possible, and make it straightforward to test with multiple players.
The main integration challenge was the actual frontend/backend contract from Chapter 6 . The hosted browser sends
POST /inquire with only the player's question; it does not include the active character name. The character name is supplied separately when loading a character sheet, while the cross-origin Referer does not reliably identify the character's game page.
Rather than modify the hosted frontend, the extension uses its existing Server URL setting as the integration point. Each character receives a distinct URL containing the character name and a random bearer token. The backend validates the token before accepting game API requests.
Architecture Overview
The extension retains the current interface and adds one Python AWS Lambda function, a Lambda Function URL, an on-demand DynamoDB table and a CloudWatch log group.
The DynamoDB table stores the shared message feed, a conditional campaign-turn lock, per-character token hashes and short-lived rate-limit counters. The Game Master Runtime and Characters Memory remain the Chapter 8 resources; no additional agent or frontend is deployed.
All participants use the same configured AgentCore Runtime session and read the same message feed. The character name and a deterministic character-scoped identifier, derived from the normalized character name, are included in the prompt sent to the Game Master. This provides explicit context about which character is taking the current turn.
A conditional DynamoDB lock serializes Game Master turns. If another participant is already waiting for the Game Master, a concurrent request receives HTTP
409 Conflict and is not submitted to the shared session.
The adapter also preserves the message format expected by the hosted interface. Assistant messages must use the
StoryOutput tool-use structure; plain text responses are not rendered as story messages. The shared feed also prefixes user messages with the character name, replaces the long character-creation prompt with a short join notice, and prepends a synthetic first user message to accommodate the frontend's history handling.

Per-character access URLs
The existing Server URL setting is used to configure each participant's API endpoint:
https://FUNCTION_URL/player/CharacterName/RANDOM_BEARER_TOKENThe
player_access.py helper issues, rotates and revokes these URLs. Tokens are generated with 256 bits of randomness; only their SHA-256 hashes are stored in DynamoDB. Each token is associated with one normalized character name, and the handler rejects attempts to use a token with another character name.Because the token is part of the URL, it must be treated as a password and shared privately. This provides lightweight workshop access control, not a central identity provider.
Security boundaries and trade-offs
The direct Lambda Function URL uses
AuthType=NONE because the unmodified public browser cannot sign AWS SigV4 requests. The API therefore performs bearer-token validation on game routes. CORS is restricted to the workshop website, but CORS is not authentication: non-browser clients can still send HTTP requests to the Function URL.
The infrastructure also applies per-character request and turn rate limits, limits request-body size, avoids logging request bodies, redacts bearer-token path segments in its logs, avoids returning raw exception messages, and scopes the Lambda's DynamoDB and AgentCore permissions to the resources it needs.
All authenticated participants can read the shared campaign feed and list the party roster through
GET /characters . The GET /user/{name} route is restricted to the character associated with the caller's token, but character sheets are not private between authenticated party members.
The public Function URL can still receive unauthenticated requests, which are rejected by the handler but may incur Lambda invocation costs. For a workshop or a small controlled group, these trade-offs keep the architecture understandable. A public production game would require a proper identity provider, stronger authorization boundaries, more comprehensive rate limiting and monitoring, and a threat-modelled API design.
Prerequisites
The extension assumes that Chapter 8 has already been deployed and that the resources required by the Game Master are ready.
The required identifiers are the Chapter 8 Game Master AgentCore Runtime ARN and the Characters Memory ID (not its ARN).
Deployment requires Python 3.10 or newer, Node.js 20 or newer, AWS CLI v2, AWS CDK CLI v2, and credentials with permission to deploy the Lambda function, Function URL, DynamoDB table, IAM policies and CloudWatch log group. The deployment must use the same AWS account and Region as the Chapter 8 Runtime and Memory.
A unique campaign session ID of at least 33 characters is required. All participants in one campaign use the same ID. A different campaign against the same Game Master Runtime should use a new session ID.
For a multi-player test on one computer, separate browser profiles, separate browsers, or a regular browser window and an Incognito window are required. The hosted interface stores the Server URL in local storage, so tabs in the same browser profile share the same value.
Deployment
The complete Chapter 9 implementation is available in the repository on
feat/multiplayer-prod branch.
Copy
.env.example to .env and configure the Chapter 8 Game Master Runtime ARN, Characters Memory ID, campaign session ID and AWS Region. The example uses explicit placeholders so the CDK application fails early until the required values are supplied. Leave LOCK_TABLE_NAME blank to let CDK generate a unique DynamoDB table name.Install the Chapter 9 Python dependencies and package the pinned AWS SDK into the Lambda asset:
uv pip install -r requirements.txtpython package_lambda.pyThe packaging script creates
lambda_src/vendor/ . This generated dependency directory is included in the Lambda deployment asset and intentionally excluded from Git.If CDK has not previously been bootstrapped in the target account and Region, bootstrap it first:
cdk bootstrap aws://ACCOUNT_ID/REGIONThen synthesize, review and deploy:
cdk synthcdk diffcdk deployAfter deployment, the stack outputs the Function URL and DynamoDB table name. Use them to issue a separate URL for each character:
python player_access.py issue \ --name "CharacterName" \ --base-url "https://FUNCTION_URL" \ --table-name "CAMPAIGN_TABLE_NAME"Share each generated URL privately. During character creation, the participant enters their complete URL in the hosted game's Server URL field. The character name must match the name registered in the URL. Additional participants can be added by issuing more URLs using the same Function URL and DynamoDB table.
Game steps:




Existing game sessions can also be switched to a newly issued URL. The saved browser setting is stored under the local-storage key
rpg-gm-server-url ; updating that value and reloading the page changes the backend endpoint without recreating the character.Access can be rotated with
player_access.py issue --rotate or revoked with player_access.py revoke . For a multi-player test, separate browser profiles ensure that each participant retains an independent Server URL.Conclusion
The main engineering challenge was understanding the integration contract between the existing frontend and backend: the request fields, routes, local configuration and structured message format. Once that contract was established, a small adapter could reuse the workshop's existing AgentCore resources and provide a shared campaign without modifying the published browser interface.
This remains a community-built, optional infrastructure and an additional exercise for participants who have completed the original workshop. It demonstrates how existing system's interfaces can be enabled for new capabilities with relatively little additional infrastructure.
The party is now a little bigger. Roll for initiative!
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article