Skip to content

Let a player's AI agent play your game, safely.

gamewarden turns a manifest of game actions into MCP tools, applies your safety policy, calls your backend with a signed request, and records every attempt.

An agent reads a player’s state, sells some food, and is stopped by a daily cap and a cooldown. Every command is real. Run it yourself with scripts/demo.sh.

Terminal recording: an agent calls tools through gamewarden, a sale succeeds, then a daily cap and a cooldown refuse further calls

The agent never talks to your backend. It calls a tool on the gateway, and the gateway decides whether that call may happen, in a fixed order, before anything reaches the game.

How a tool call flows through the gatewayAn agent calls a tool over MCP. The gateway checks the call in eight steps: lookup, rate limit, validate, confirm, reserve, signed call, settle, audit. It sends a signed request to the studio backend.Player's agentany MCP clientCoach or Operatorgamewardentools come from the studio's manifest1. lookup2. rate limit3. validate4. confirm5. reserve6. signed call7. settle8. auditEvery attempt is audited, allowed or denied. A denial tells the agent why.Studio backendany languageor the game clientMCPsigned call

A one hour soak test at a steady rate, with real Redis and Postgres behind the gateway. Flat lines mean the gateway does not leak memory, connections or policy state while it runs.

99.9/scalls per second, held for 59.8 minutes
6.55 msp99 latency for a full call
1 of 359,763calls failed
11 to 17.8 MiBgateway memory, start to end
How long a call takes milliseconds, through the whole pipeline to the backend and back (slowest single call: 202.09 ms)
p50p50: 1.87 ms1.87 msp95p95: 4.45 ms4.45 msp99p99: 6.55 ms6.55 ms
Gateway memory resident memory of the gateway container, over 59.8 minutes
012.52511 MiB at minute 014.6 MiB at minute 215.7 MiB at minute 415.4 MiB at minute 615.1 MiB at minute 715.7 MiB at minute 916.4 MiB at minute 1116 MiB at minute 1318 MiB at minute 1518.1 MiB at minute 1717.6 MiB at minute 1917.9 MiB at minute 2117.7 MiB at minute 2217.8 MiB at minute 2416.9 MiB at minute 2617.2 MiB at minute 2818.2 MiB at minute 3017.1 MiB at minute 3217.5 MiB at minute 3417 MiB at minute 3617.2 MiB at minute 3717.8 MiB at minute 3916.8 MiB at minute 4117.9 MiB at minute 4317.4 MiB at minute 4517.2 MiB at minute 4716.7 MiB at minute 4918 MiB at minute 5117.5 MiB at minute 5217.9 MiB at minute 5418.1 MiB at minute 5618.5 MiB at minute 5817.8 MiB at minute 6017.8060 min
Gateway CPU share of one core while serving the load, over 59.8 minutes
0102011.4 % at minute 09 % at minute 211.8 % at minute 411.7 % at minute 612.3 % at minute 77.7 % at minute 98.8 % at minute 117.5 % at minute 137.3 % at minute 157.8 % at minute 177.6 % at minute 197.3 % at minute 217.1 % at minute 228 % at minute 2412.3 % at minute 2614.4 % at minute 2812.1 % at minute 3013.8 % at minute 3212.1 % at minute 3412.5 % at minute 3613.2 % at minute 3712.1 % at minute 3912.7 % at minute 4111.9 % at minute 4312.4 % at minute 4511.2 % at minute 4711.8 % at minute 499 % at minute 517.9 % at minute 528.1 % at minute 547.8 % at minute 567.9 % at minute 587.3 % at minute 607.3060 min
Policy keys in Redis bounded: two per simulated player, over 59.8 minutes
02,5005,000666 keys at minute 04,000 keys at minute 24,000 keys at minute 44,000 keys at minute 64,000 keys at minute 74,000 keys at minute 94,000 keys at minute 114,000 keys at minute 134,000 keys at minute 154,000 keys at minute 174,000 keys at minute 194,000 keys at minute 214,000 keys at minute 224,000 keys at minute 244,000 keys at minute 264,000 keys at minute 284,000 keys at minute 304,000 keys at minute 324,000 keys at minute 344,000 keys at minute 364,000 keys at minute 374,000 keys at minute 394,000 keys at minute 414,000 keys at minute 434,000 keys at minute 454,000 keys at minute 474,000 keys at minute 494,000 keys at minute 514,000 keys at minute 524,000 keys at minute 544,000 keys at minute 564,000 keys at minute 584,000 keys at minute 604,000060 min
Show the numbers as a table
MeasureValue
Calls in total359,763 (287,870 succeeded, 71,892 denied by policy or the backend, 1 failed)
Latency p50, p95, p99 and the slowest call1.87, 4.45, 6.55 and 202.09 ms
Gateway memory, first and last sample11 and 17.8 MiB (peak 18.9)
Gateway CPU7.1 to 14.4 percent of one core
Redis policy keys666 at the start, 4,000 at the end (two per simulated player)
Postgres sessions7 at the start, 14 at the end. This is the gateway's pool filling towards its cap of 8, plus Postgres's own background processes. It was level for the second half of the run.
Readiness failures0 in 97 samples

Measured on Darwin arm64, Docker Compose, one gateway, Redis, Postgres and a fake backend on the same machine, on 2026-11-19. It is a single machine with a fake backend that answers instantly, so the figures show what the gateway adds (policy, validation, signing, audit and the Redis and Postgres round trips), not what your game's own backend will cost. 71,892 calls were denied on purpose by the demo's limits and the fake backend, and are not failures. Repeat it yourself withscripts/soak.sh, described in the runbook.

The same signed request, sent straight to the backend and then through the gateway, at the same load. The difference is the gateway’s own work.

+2.25 msadded at the median, read tool
+2.52 msadded at the median, capped action tool
+4.08 msadded at p99, the worse of the two
11,260/scalls per second through one gateway, flat out
A read tool get_city_state: look up, rate limit, validate, signed call, audit. Milliseconds at 100 calls per second.
p50p50 alone: 0.66 ms0.66 msp50 through the gateway: 2.91 ms2.91 msp95p95 alone: 1.93 ms1.93 msp95 through the gateway: 5.46 ms5.46 msp99p99 alone: 4.15 ms4.15 msp99 through the gateway: 8.23 ms8.23 ms
A capped action tool sell_resource: also reserve a daily cap, then settle it. Milliseconds at 100 calls per second.
p50p50 alone: 0.71 ms0.71 msp50 through the gateway: 3.23 ms3.23 msp95p95 alone: 1.66 ms1.66 msp95 through the gateway: 5.12 ms5.12 msp99p99 alone: 2.94 ms2.94 msp99 through the gateway: 6.65 ms6.65 ms
Show the numbers as a table
Runp50p95p99Calls per second
A read tool, alone, 100/s0.66 ms1.93 ms4.15 ms100
A read tool, through the gateway, 100/s2.91 ms5.46 ms8.23 ms100
A read tool, added by the gateway+2.25 ms+3.54 ms+4.08 ms
A capped action tool, alone, 100/s0.71 ms1.66 ms2.94 ms100
A capped action tool, through the gateway, 100/s3.23 ms5.12 ms6.65 ms100
A capped action tool, added by the gateway+2.52 ms+3.46 ms+3.71 ms
A read tool, alone, flat out0.16 ms0.87 ms1.57 ms117,899
A read tool, through the gateway, flat out2.47 ms3.83 ms5.43 ms11,964
A capped action tool, alone, flat out0.18 ms1.06 ms1.75 ms101,532
A capped action tool, through the gateway, flat out2.59 ms4.41 ms6.38 ms11,260

Median of 3 repetitions, each 60 seconds paced and 20 seconds flat out after a 5 second warmup, with 32 workers and 20,000 simulated players. Measured on Docker Desktop (aarch64), Docker 29.9.3 with 8 CPUs and 8 GiB, one gateway, Redis, Postgres and a fake backend on the same machine, on 2026-11-19. The fake backend answers in microseconds, so almost all of the time shown is the gateway's own work (policy in Redis, validation, signing, the audit write), and a real game backend that takes tens of milliseconds will make the gateway's share much smaller. "Flat out" is limited by this one laptop and by the load generator, so read it as a floor for one gateway process, not a ceiling. Repeat it withscripts/bench-overhead.sh, described in the runbook.

Tools from a manifest

Describe actions once, in JSON or YAML. Strict validation reports every problem at once.

Policy per tier

Read, safe, medium and sensitive tiers. Sensitive tools stay hidden from agents.

Caps and cooldowns

Daily call and amount caps, cooldowns and rate limits. Caps reserve first, so concurrent calls cannot overspend.

Signed backend calls

HMAC-SHA256 with a timestamp and an idempotency key. Any language can verify it in a few lines.

Player confirmations

Mark a tool confirm and the player approves each call in your own UI before it runs.

OAuth linking

An embedded OAuth 2.1 server links a player’s agent with PKCE. Players list and revoke agents.

Kill switches

Turn off a tool, a player or everything, and the next call is refused.

Audit with hashed arguments

Every attempt is recorded, allowed or denied. The log keeps hashes, not game data.

Live manifest and keys

Upload and roll back manifests, and rotate signing keys, without a restart.

MCP over streamable HTTP

Works with any MCP client. A stdio bridge covers desktop clients.

Six rules the gateway is built around, in plain words.

  1. The agent plays by the human’s rules. No side door around game logic.
  2. Every attempt counts. A call that fails validation still uses up the rate limit.
  3. Limits are reserved before the call. Two calls at once cannot both spend the last of a cap.
  4. If policy is down, actions stop. The gateway refuses rather than guesses.
  5. Backend replies are data, not orders. Nothing a backend returns is treated as an instruction.
  6. The audit log keeps hashes, not game data. You can prove what happened without storing what it was.
Level 0

Manifest only

Map each tool onto a REST endpoint you already have. No backend code.

Level 1

One signed endpoint

Your backend verifies the signature and handles tool calls, in any language.

Built

Relay

For games whose logic runs in the client. The game opens a WebSocket and the gateway sends calls down it.

version: 1
tools:
- name: sell_resource
description: Sell food, water or materials at the current sell price.
tier: medium
caps: {per_day_amount: 300, amount_param: quantity}
http: {method: POST, url: /api/v1/market/sell}
params:
resource: {type: string, enum: [food, water, materials]}
quantity: {type: integer, min: 1, max: 1000}