phasm is an open-source toolkit for running AI simulations and evals in rule-governed worlds. Models see an observation and submit a structured action. The engine controls state, private information, and scoring.

Squares is a four-seat card game for testing cooperation and hidden signals. Collect four of a kind, then signal your partner in public table talk before a rival figures out the tell.

Squares replayRules and scoring
Round 1 / 10
Ink 0Paper 0
Shared market
  1. Deal
  2. Swap
  3. Talk
  4. Call
—

What happened in Squares

Each seat receives its own hand, its team’s tell, the market, and public history. There are no direct messages or shared model sessions. Players can observe each other’s public trades and table talk. The engine checks a Caught call against both the rival’s actual tell and whether they sent a valid signal that round.

The rules check uses scripted agents and includes a deliberately missed signal. The local recordings use four independently invoked seats with two Qwen checkpoints. A model can propose a private hypothesis without committing to a scored call.

Guess early, or wait for another clue?

We replayed 128 deck seeds under three scripted policies. Both teams used the same policy in each run. The agents could look for repeated capital letters or words in public messages. Some ordinary messages contained decoy repetitions.

Guessing on the first clue caught 164 signals and produced 648 false calls. Requiring a prior match caught 41 signals and produced 217 false calls. The share of rival calls that succeeded was 20% with the first-clue policy and 16% with the prior-match policy.

What the local models did

Method and limits

The scripted study reused seeds 0–127 for each policy, with 12 rounds per match and the same tell assignments and card-swapping policy. A correct call triggers a redeal, so games sharing a seed can diverge after the first different outcome. Detection latency counts inclusively from the team's first valid signal to the first correct rival call. Undetected teams are excluded from the latency medians.

The pilot used seed 3 for three rounds and included literal action examples. The follow-up used a one-round seed selected because South starts with four of a kind. It tests an available signaling opportunity. The two live recordings differ in both the deal and prompt.

The separate inference probes name a rival and reuse real seat observations from the scripted fixture. The grade requires the exact rule and seat. They compare the original examples with a field-only prompt. The small local runs and probes are descriptive.

Plain-text summary · Policy results JSON · Opening signal case JSON · Pilot match JSON · Original probes JSON · Revised probes JSON · Rules-check replay JSON

Run locally

Save the Git bundle in your current directory. Requires Git and Node.js 22 LTS or newer.

git clone ./phasm.bundle phasm
cd phasm
npm test
npm run start

See the README for seat-by-seat model configuration and recording a new match. Keep API keys in your local environment.

Squares rules

North and South play as Ink. East and West play as Paper. Each team privately chooses a tell, such as using exactly four uppercase Rs in one message.

Every round, the market is filled, each seat may swap one card, all four players post a line, then each seat can call or pass.