{"slug": "let-s-strands-decider-our-role-playing-game", "title": "Let's Strands Decider our Role-Playing Game", "summary": "A developer built a sample role-playing game that uses Strands Decider, a small decision model from Strands Labs, to let an AI Game Master act on confident answers and ask the player when unsure. The model returns a typed answer with a confidence score in a few hundred milliseconds on a laptop, and the app compares that score against a developer-set threshold (0.8 in the sample) to decide whether to commit, ask the player, or route to a specialist agent.", "body_md": "If you build agents that call tools, you can let them act when they're sure and ask when they're not.\n\nThat is the job [Strands Decider](https://github.com/strands-labs/strands-decider) does. It is a small decision model that answers a typed question (yes/no, pick one, or a score) in a few hundred milliseconds on a laptop. \n\n[re:Using our Once Upon Agentic AI Series' Articles](https://dev.to/thewitcherish/series/46409), let's play with Strands Decider to give our AI Game Master three useful reactions: commit to an answer, ask the player first, or pick the right specialist agent before answering.\n\nYou need a terminal and [uv](https://docs.astral.sh/uv/getting-started/installation/), the Python package and project manager. No uv yet? Its install page has a one-line installer for macOS, Linux and Windows, and uv fetches the right Python for you. Clone the sample, install its dependencies, and start the model server:\n\n```\ngit clone https://github.com/TheWitcherish/sample-strands-decider-rpg\ncd sample-strands-decider-rpg\nuv sync\n\n# terminal 1: the model server (leave it running)\nexport DECIDER_MODEL=StrandsAgents/strands-decider-2B-qwen3.5-v1-2610\nuv run --extra decider strands-decider serve \"$DECIDER_MODEL\" --port 8000\n```\n\nThe first start installs the model runtime and downloads about 4 GB of model weights, and it runs on Apple silicon, an NVIDIA GPU, or CPU. It is ready when it prints `Uvicorn running on http://127.0.0.1:8000`. Leave that terminal open, open a second terminal in the same folder for every command below, and stop the server with Ctrl+C when you are done. Model identifiers change, so check the current one in the [Strands Decider README](https://github.com/strands-labs/strands-decider).\n\nEvery `once-upon-strands-decider` command below sends its question to this server, and `--say` lets you put your own words in your character's mouth. \n\nFirst, a word on the bar. Strands Decider hands back an answer and a confidence between `0` and `1`; whether your app acts on that answer is your call, not the model's. The bar is the confidence your code requires before it acts, and you, the developer, set it: the model never sees it. In this sample it is one constant, `CONFIDENCE_BAR = 0.8` in `engine.py`, and `--bar` overrides it for a run. Above the bar, the AI Game Master acts on the answer; below it, it asks the player.\n\nChapter 1 asks one yes/no question: does the action need a perception check, a roll to notice something? This is the whole decision, from `chapters.py`:\n\n```\nCH1_Q: Final = YesNoQuestion(\n    key=\"needs_check\",\n    instructions=\"Does the adventurer's action call for a perception check, a roll to notice?\",\n    criteria={\n        \"true\": \"The adventurer actively stops, looks, listens or heads toward the sound\",\n        \"false\": \"The adventurer chooses to ignore the sound and carries on without looking\",\n    },\n)\n\nacted = answer.confidence >= bar\n```\n\nThe `criteria` say what counts as yes and as no. The routing is one line: `acted = answer.confidence >= bar`. Strands Decider never rolls the dice. It only answers whether a roll is needed; the d6 is a few lines of plain Python with a seed, so the same run always rolls the same number. Run it in the second terminal and guess first: will the AI Game Master roll, or ask you?\n\n```\nuv run once-upon-strands-decider chapter 1\nadventurer : \"Wait, what was that? I stop and look toward the sound.\"\n  decider    : needs_check -> yes (p_yes=0.929)\n  evidence   : perception check -> needs 4+; the d6 shows 3\n  confidence : 0.857 (bar 0.80) -> ACTED\n  speed      : 1 round trip(s), 180 ms on strands-decider-2B-qwen3.5-v1-2610\n  The d6 lands short of the number. Something big steps out of the brambles, and it saw you first: a bramblehoot, a bear with an owl's face.\n>>> Face to Beak: It tilts its head all the way sideways and hoots. You decide that was hello.\n```\n\nStopping to look is clearly a check: the model answers yes at `0.857`, clears the bar, and the d6 rolls. A 3 misses the 4+, and TheWitcherish meets a creature he has never seen before. The bramblehoot is right in front of him now, so he tries the friendliest thing he knows:\n\n```\nuv run once-upon-strands-decider chapter 1 \\\n  --say \"The bramblehoot is right in front of me. I slowly offer it a sip of my coffee.\"\nadventurer : \"The bramblehoot is right in front of me. I slowly offer it a sip of my coffee.\"\n  decider    : needs_check -> no (p_yes=0.470)\n  confidence : 0.060 (bar 0.80) -> HELD BACK\n  speed      : 1 round trip(s), 178 ms on strands-decider-2B-qwen3.5-v1-2610\n  The AI Game Master pauses. Roll or no roll -- too close to call, so the dice go to you.\n```\n\nOffering coffee to a bear is neither looking for the sound nor ignoring it, so neither criterion fits. The model says exactly that: `p_yes=0.470`, almost a coin flip, and a confidence of `0.060`. The AI Game Master asks the player instead of guessing. That is a quiet superpower for your own app: when an input falls outside the cases you described, the confidence drops instead of the model confidently picking a side. For a yes/no answer the sample turns the probability into a confidence with `|2p - 1|`: `0` is a coin flip, `1` is certain.\n\nThe answer is not the permission, so pick the bar by what a wrong call costs. The project reports that on tasks it has never seen, answers at `0.9` or more are right about 95% of the time, and on the independent [JevBench](https://github.com/fstandhartinger/jevbench) benchmark the gap between its stated confidence and how often it is actually right averages `0.072`. The sample uses `0.8` because a wrong call in a game costs a story beat, not a refund; add `--bar 0.9` to any command for the stricter rule.\n\nThe bramblehoot is still sniffing TheWitcherish's coffee when a Wizard steps out of the trees with three tools: a rulebook that answers over HTTP, a shell, and a quill that writes files. Before going any further, TheWitcherish wants to know what he just met. One `choice` question picks the tool:\n\n```\nuv run once-upon-strands-decider chapter 2\nadventurer : \"What is a bramblehoot, and is it friendly? Look it up in the rulebook.\"\n  decider    : tool -> http_request\n  confidence : 0.978 (bar 0.80) -> ACTED\n  speed      : 1 round trip(s), 176 ms on strands-decider-2B-qwen3.5-v1-2610\n  The rulebook glows and answers: bramblehoots are gentle, curious, and follow anyone who carries coffee.\n>>> The Scholar's Edge: You walk on with a new friend at your side. It walks on with its nose in your coffee.\n```\n\nThe rulebook wins at `0.978`, so it runs. Now TheWitcherish asks for two things at once, and the Wizard only allows one tool per request:\n\n \n\n```\nuv run once-upon-strands-decider chapter 2 \\\n  --say \"Look up bramblehoots and write it all down on a scroll for later.\"\nadventurer : \"Look up bramblehoots and write it all down on a scroll for later.\"\n  decider    : tool -> file_editor\n  confidence : 0.310 (bar 0.80) -> HELD BACK\n  speed      : 1 round trip(s), 246 ms on strands-decider-2B-qwen3.5-v1-2610\n  The AI Game Master pauses. Which tool, though -- too close to call, so the dice go to you.\n```\n\n \n\nThe request needs both the rulebook and the quill. The model leans to the quill, but only at `0.310`, so no tool runs and the AI Game Master asks which one comes first. Picking a tool and being sure enough to run it are two decisions; in your own app, that is the difference between asking \"which file?\" and running a command on a guess.\n\nChapters 3 and 4 are in the repo too, with a dice tool and magic portals. The story picks up at chapter 5, where that coffee-loving bramblehoot comes in handy.\n\nThe dragon lands on the bridge, the bramblehoot at TheWitcherish's side. The AI Game Master is an orchestrator here: in the workshop it reaches two specialist agents through an A2A (agent-to-agent) client tool, a Rules Agent that knows how the game works and a Character Agent that knows the party and what it carries. It is the same orchestrator-and-specialists shape as the [agents as tools](https://strandsagents.com/docs/user-guide/sdk/multi-agent/agents-as-tools/) pattern in Strands Agents. Each specialist call is a full model call of its own, so the orchestrator's first decision is which one, if any, it needs before answering the player.\n\nThat decision is one `choice` question for Strands Decider, with three options: `rules_agent`, `character_agent`, or `no_agent` for plain talk the AI Game Master can answer directly. Here is the routing idea in four lines; `chapters.py` wires the same logic into the story:\n\n```\nanswer = decide(player_message, WHICH_SPECIALIST)   # one Strands Decider call, ~200 ms\nif answer.confidence < bar:\n    return ask_player()                             # unsure: no specialist is called\nreturn call(answer.choice)                          # rules_agent, character_agent or no_agent\n```\n\nIn this sample the specialists' replies are scripted narration; the choice of which one to call comes from the real model. Guess first: which specialist does a daring leap need?\n\n```\nuv run once-upon-strands-decider chapter 5\nadventurer : \"Can I leap from the bridge onto the dragon's back?\"\n  decider    : specialist -> rules_agent\n  confidence : 0.866 (bar 0.80) -> ACTED\n  speed      : 1 round trip(s), 214 ms on strands-decider-2B-qwen3.5-v1-2610\n  The AI Game Master calls the Rules Agent, then comes back to you with the ruling: a leap that far needs a roll.\n>>> By the Book: You decide the dragon's back can wait. The dragon looks quietly relieved.\n```\n\nA leap is a rules question, and the model is sure at `0.866`, so the AI Game Master calls the Rules Agent only and comes back to TheWitcherish with the ruling. The Character Agent never runs. Now the trade the bramblehoot has been hoping for:\n\n```\nuv run once-upon-strands-decider chapter 5 \\\n  --say \"I offer the dragon a cup of my coffee in exchange for safe passage.\"\nadventurer : \"I offer the dragon a cup of my coffee in exchange for safe passage.\"\n  decider    : specialist -> character_agent\n  confidence : 0.195 (bar 0.80) -> HELD BACK\n  speed      : 1 round trip(s), 199 ms on strands-decider-2B-qwen3.5-v1-2610\n  The AI Game Master pauses. Which specialist to call -- too close to call, so the dice go to you.\n```\n\nIt leans toward the Character Agent, but only at `0.195`. Fair: the trade needs a rule (is a bargain with a dragon binding?) and the party sheet (is there coffee left?), so no single specialist is a safe pick. The AI Game Master goes back to the player before calling anyone, instead of spending a specialist call on a guess. \n\nIn your own orchestrator, that is one decision of about 200 ms in front of the agents you already have: call the one the request needs, skip the ones it does not, and ask the user when the request does not clearly belong to any of them.\n\nThe game is a thin layer over one HTTP call to the server you started (`POST /v1/systemone`: a state and typed questions in, typed answers out), so your own code can make the same call from any language. Here is the most common guard for an agent: before it runs a tool, check that the arguments came from the user. The user asked about the weekend without naming a city, and the agent wants to call `get_weather(city=\"Paris\")`:\n\n```\ncurl -s localhost:8000/v1/systemone -H 'content-type: application/json' -d '{\n  \"state\": \"User: \\\"What will the weather be like this weekend?\\\"\\nProposed tool call: get_weather(city=\\\"Paris\\\")\",\n  \"questions\": {\"args_from_user\": {\"type\": \"noul\",\n    \"instructions\": \"Does every argument of the proposed tool call come from what the user said?\",\n    \"criteria\": {\"true\": \"Each argument value is stated in, or clearly implied by, the user message\",\n                 \"false\": \"At least one argument value was invented: the user never gave it\"}}}}'\n{\"model\":\"strands-decider-2B-qwen3.5-v1-2610\",\"answers\":{\"args_from_user\":{\"type\":\"noul\",\"noul\":0.6652}},\"usage\":{\"input_tokens\":122,\"output_tokens\":1},\"latency_ms\":222.35}\n```\n\nA yes/no question is type `noul`, and its answer is one probability that the statement is true. Your code turns it into a confidence and checks your bar, three lines in any language:\n\n```\np = response[\"answers\"][\"args_from_user\"][\"noul\"]   # 0.6652, from the JSON above\nconfidence = abs(2 * p - 1)                         # 0.330\nrun_the_tool = p >= 0.5 and confidence >= 0.8       # False: ask the user which city\n```\n\nThe model leaned the wrong way, but at a confidence of `0.330` the tool never runs and the agent asks which city instead. Put \"in Paris\" in the user's message and the same request returns `0.9435`, a confidence of `0.887`: the call goes through. One output token, about 200 ms on my laptop, nothing leaving your machine.\n\nWhere it fits in your own code:\n\n`score` its weakest shape on rubrics unlike its training data, so test it on your own rubric before you rely on it.)\nA `choice` question takes its options as a `criteria` map of names to descriptions, and its answer already carries a `confidence`; a `score` question takes a list ordered from low to high. The sample's `decider.py` builds all three request shapes. The [worked Strands Agents example](https://github.com/strands-labs/strands-decider/tree/main/examples/strands) applies this same guard inside an agent, asking for a missing city rather than guessing one. Before you trust a bar on real traffic, collect 20 to 50 decisions from your app with known answers and check that the high-confidence ones really are right more often; a benchmark score does not prove reliability on your own workload.\n\nWhich decision in your own app would benefit most from knowing when the model is unsure?", "url": "https://wpnews.pro/news/let-s-strands-decider-our-role-playing-game", "canonical_source": "https://dev.to/aws/lets-strands-decider-our-role-playing-game-489e", "published_at": "2026-11-18 09:03:35+00:00", "updated_at": "2026-11-18 09:13:41.428705+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "large-language-models", "ai-products"], "entities": ["Strands Decider", "Strands Labs", "StrandsAgents/strands-decider-2B-qwen3.5-v1-2610", "uv", "GitHub"], "also_reported_by": [], "takeaway": "Gate an agent's actions on the decision model's confidence score against a developer-set bar (0.8 in the sample), acting above it and asking the user below it, with the model answering in about 180 ms.", "recommendation": {"advice": "Set an explicit confidence bar in your code and only let the agent act when the decider's score clears it; otherwise fall back to asking the user.", "playbook": "agent-architecture", "playbook_url": "https://wpnews.pro/playbooks/agent-architecture"}, "alternates": {"html": "https://wpnews.pro/news/let-s-strands-decider-our-role-playing-game", "markdown": "https://wpnews.pro/news/let-s-strands-decider-our-role-playing-game.md", "text": "https://wpnews.pro/news/let-s-strands-decider-our-role-playing-game.txt", "jsonld": "https://wpnews.pro/news/let-s-strands-decider-our-role-playing-game.jsonld"}}