Skip to Content
Multi-simulator environments

Guides

Multi-simulator environments

One rystic.yaml names every simulator your code talks to. rystic up starts them as one project, rystic clock reads or moves all their clocks at once, rystic reset starts them over, rystic tail follows them on one timeline, and rystic export compose turns the same file into a Compose stack. rystic compose writes and keeps the file for your own Compose app. Every flag is in the CLI flag reference; the Docker builder writes the file for you.

The stack file

# rystic.yaml
version: 1
project: design-studio
services:
  stripe: {product: stripe-twin, port: 8080, scenario: design_studio}
  paypal: {product: paypal-twin, port: 8081, scenario: design_studio}
  slack:  {product: slack-twin,  port: 8082, scenario: design_studio}
  resend: {product: resend-twin, port: 8083, scenario: design_studio}
  okta:   {product: okta-twin,   port: 8084, scenario: design_studio}
  lob:    {product: lob-twin,    port: 8085, scenario: design_studio}
  1. version: 1 is required. project labels every instance for ps --project, clock, reset, tail and down; it defaults to the file’s directory name.
  2. Each service is one rystic run -d, and its name is the instance name.
  3. A service key is the run flag of the same name, _ for -: product, version, port, scenario, seed, runner, network, rate_limits, seed_rng, egress_retain, speed, clock and the rest rystic help up lists. version defaults to the installed build; a product not installed yet is pulled.
  4. env is a map, one --env KEY=VALUE each. args is a list, passed after --. A relative seed, inject or tapes path resolves against the stack file.
    • An env value resolves against the stack file’s directory only when its key ends in _FILE and the value starts with ./ or ../: CLERK_TWIN_PRIVATE_KEY_FILE: ./keys/clerk.pem names the key beside the stack wherever you run up. Run from the folder above it, rystic export compose -f design-studio/rystic.yaml names the path it resolved:

      warning: clerk: env CLERK_TWIN_PRIVATE_KEY_FILE names /home/me/design-studio/keys/clerk.pem on this machine, which the container cannot read — mount the file in a volume and point CLERK_TWIN_PRIVATE_KEY_FILE at it
      
    • Any other value passes as written, including a bare key.pem or an absolute path.

    • The resolved path is on your machine. A Docker service or a Compose export needs the file mounted, and export warns for each such key.

  5. seed_rng and egress_retain take strings: quote a number, or the file is refused.
  6. The top level also takes clock (an RFC3339 instant, or now) and speed for every service: One clock.
  7. Kalshi-only keys (tapes, tape, copies, live and the live_* family) are on the Kalshi page.
  8. intercept: true on a service is run --intercept: up also starts the project’s gateway, so an unchanged app run under rystic exec --project <project> reaches the simulator at the vendor’s own host. The top-level gateway: {strict, allow} sets that gateway’s policy. See Intercept vendor calls → Stack files. down stops the gateway too. The gateway’s apps, hosts and egress keys are for Compose: In Docker Compose.
  9. The top-level exclude lists simulators, by service or product name, that rystic compose never adds when it detects them: exclude: [resend]. Each must be one detection knows, listed once.

The same keys reach the simulator as they would from run:

  stripe: {product: stripe-twin, port: 8080, scenario: design_studio, egress_retain: "500", args: ["--events=all"]}
curl -s localhost:8080/_rystic/version | jq .egress_retain
# -> 500

A malformed file exits 2 and names the problem:

rystic: rystic.yaml: service stripe: unknown key "scenaro" (keys: args, clock, copies, egress_retain, env, …)
rystic: rystic.yaml: service stripe: a stack file never carries a license — `rystic login <file>` activates one for this machine, and every twin finds it
rystic: rystic.yaml: service stripe: env RYSTIC_CLOCK "2026-03-01T00:00:00Z" beside clock: now — name the start once, in clock

Start, list, stop

In the folder that holds rystic.yaml:

rystic up -d
# -> lob-twin ... (model ...) → http://localhost:8085  [native lob]
# -> ...
rystic ps --project design-studio
# -> NAME ... STATUS
# -> ...
rystic down
# -> ...stopped lob...
  1. -d returns once every service serves. Without it, up holds the terminal and Ctrl-C is down.
  2. up again prints stripe: already running (http://localhost:8080) per service instead of restarting.
  3. rystic up -d stripe slack starts only those services.
  4. -f <file> names another stack file; rystic down --project design-studio works from any folder.
  5. rystic up -d --project <p> runs the file under project <p> instead of its own. Each instance is then named <p>-<service>, so --project review-2 starts review-2-stripe, review-2-paypal and the rest beside the first copy. A name over 63 characters is refused before anything starts. --project naming the file’s own project is plain up.
  6. Ports are shared across the machine, so a second copy needs port: 0 (any free port) on its services, or ports of its own. A port another instance holds stops up, which then suggests port: 0 on that service.
  7. ps, clock, reset, tail and down take --project <p>, so rystic down --project review-2 stops that copy and leaves the first running. rystic up --project <p> stripe takes the file’s service names; commands that take instance names, such as reset, stop and logs, take the copy’s review-2-stripe.

A copy whose instance names are too long exits 2 before anything starts, and a copy started beside the first with the file’s fixed ports names the service to change:

rystic: --project design-studio-review-for-the-quarterly-pricing-change-in-march: service lob would run as design-studio-review-for-the-quarterly-pricing-change-in-march-lob, over the 63 characters an instance name takes — pick a shorter project
rystic: review-2-stripe: port 8080 is in use by instance stripe (http://localhost:8080) — set port: 0 on service stripe in rystic.yaml, or give it another port

One clock

Every design_studio scenario boots at 2026-03-01T00:00:00Z. Moving the clock moves every simulator in the project:

rystic clock --advance 1h
# -> NAME    PRODUCT      CLOCK
# -> lob     lob-twin     2026-03-01T01:00:00Z
# -> okta    okta-twin    2026-03-01T01:00:00Z
# -> paypal  paypal-twin  2026-03-01T01:00:00Z
# -> …

Some of these scenarios carry a timeline that plays as the clock passes 2026-03-01; each simulator’s page says which. One hour in, Okta has added Hannah Kim to Content and PayPal has opened an order for invoice WDC-1298:

curl -s localhost:8084/api/v1/users/00uFmE5mnLllb4P4sys9/groups -H 'Authorization: SSWS x' | jq -c '[.[].profile.name]'
# -> ["Everyone","Development","Content"]

curl -s localhost:8081/v2/checkout/orders/ORD00000000000001 -H 'Authorization: Bearer x' | jq -c '{status, invoice: .purchase_units[0].invoice_id}'
# -> {"status":"CREATED","invoice":"WDC-1298"}

GET /_rystic/inject on each lists its events and when they fired. Timelines has the event shape.

  1. --advance takes whole seconds: 90s, 15m, 48h; -1h moves back. --set 2026-04-01T09:00:00Z pins every clock to one instant.
  2. Events fire as the clock passes them. A move past a scenario’s timeline fires every event it skips, in order, so --set a month ahead plays the whole timeline at once.
  3. It reads the project from ./rystic.yaml, or -f <file>, or --project <p>.
  4. Records you create are stamped with the new time: a Stripe customer’s created, a Slack message’s ts.
  5. It posts /_rystic/clock to every running instance at once and prints each clock as it reads back. Nothing running under the project is exit 5.

With neither --set nor --advance, rystic clock reads every clock and moves nothing:

rystic clock
# -> NAME    PRODUCT      CLOCK
# -> lob     lob-twin     2026-03-01T01:00:00Z
# -> okta    okta-twin    2026-03-01T01:00:00.001Z
# -> …

Start every simulator at the same instant

Scenarios outside the shared design_studio company boot at different instants, each given in its simulator’s Scenarios table. A top-level clock lines them up:

# rystic.yaml
version: 1
project: coding-agent
clock: 2026-03-02T09:00:00Z
speed: 0
services:
  github: {product: github-pulls-twin, port: 8080, scenario: github-pulls_bot_pr_queue}
  linear: {product: linear-twin,       port: 8081, scenario: linear_triage_inbox}
  slack:  {product: slack-twin,        port: 8082, scenario: design_studio}
rystic up -d
rystic clock --advance 24h
# -> NAME    PRODUCT            CLOCK
# -> github  github-pulls-twin  2026-03-03T09:00:00Z
# -> linear  linear-twin        2026-03-03T09:00:00Z
# -> slack   slack-twin         2026-03-03T09:00:00Z

curl -s localhost:8080/repos/tb-owner/tb-repo/issues/11/comments -H 'Authorization: Bearer ghp_x' -d '{"body":"needs a test"}' | jq -r .created_at
# -> 2026-03-03T09:00:00Z
curl -s localhost:8082/api/chat.postMessage -H 'Authorization: Bearer xoxb-x' -d channel=CWDC0000001 -d text=shipped | jq -r '.ts | tonumber | floor | todate'
# -> 2026-03-03T09:00:00Z
  1. clock (RFC3339) stands in for the clock each scenario names: the scenario’s records keep their dates, its timeline counts from the new start, and POST /_rystic/reset returns to it.

  2. clock: now starts at the time up runs, in UTC to the second. Every now in one up is one instant, so the simulators it starts share one clock, and a restart or reset returns to that instant rather than a fresh now. Each simulator’s /_rystic/version reports the instant its clock started at, here for a clerk and a resend service right after up -d:

    {"product":"clerk-twin","initial_clock":"2026-11-11T12:24:38Z"}
    {"product":"resend-twin","initial_clock":"2026-11-11T12:24:38Z"}
    

    A stack of clerk and resend with clock: now:

    # rystic.yaml
    version: 1
    clock: now
    services:
      clerk:  {product: clerk-twin,  port: 18601}
      resend: {product: resend-twin, port: 18602}
    

    Its up, then a later up that adds clerk2 while they run, and down then up again:

    rystic up -d
    rystic clock
    # -> NAME    PRODUCT      CLOCK
    # -> clerk   clerk-twin   2026-11-16T05:35:30Z
    # -> resend  resend-twin  2026-11-16T05:35:30Z
    # add clerk2: {product: clerk-twin, port: 18603} under services, then
    rystic up -d
    rystic clock
    # -> clerk   clerk-twin   2026-11-16T05:35:30Z
    # -> clerk2  clerk-twin   2026-11-16T05:35:30Z
    # -> resend  resend-twin  2026-11-16T05:35:30Z
    rystic down && rystic up -d
    rystic clock
    # -> clerk   clerk-twin   2026-11-16T05:36:11Z
    # -> clerk2  clerk-twin   2026-11-16T05:36:11Z
    # -> resend  resend-twin  2026-11-16T05:36:11Z
    
    • up starts every simulator from one shared start time. A service a later up adds while others run joins that start, and down clears it, so the next up reads a new now.
    • An env that sets RYSTIC_CLOCK beside clock: now is refused: the start is named once, in clock.
    • In a Compose export, and under rystic compose, the simulators share the time the Compose project starts: Export to Compose.
  3. speed is simulated seconds per wall second for every service: speed: 60 runs an hour a minute, 0 keeps the clock where you put it.

  4. Without speed, a built-in scenario keeps its clock manual, but a service with a seed file that carries events, or with an inject file, paces at 1. Its timestamps then follow wall time. speed: 0 keeps every clock still until rystic clock moves it.

  5. A paced clock moves in steps: once per wall second it jumps speed seconds. Each simulator steps on its own phase, so two paced simulators can read up to a step apart: up to a second at speed: 1.

  6. A service’s own clock or speed wins over the top level.

  7. POST /_rystic/scenario loads a scenario at that scenario’s own clock. To start every service over at the stack’s clock, run rystic reset.

Start over

rystic reset returns every service to the state it started in:

rystic reset
# -> NAME    PRODUCT            CLOCK
# -> github  github-pulls-twin  2026-03-02T09:00:00Z
# -> linear  linear-twin        2026-03-02T09:00:00Z
# -> slack   slack-twin         2026-03-02T09:00:00Z
  1. Each service loads its scenario or seed file again at the stack’s starting clock: the service’s own clock, else the top-level one, else its scenario’s own. Its timeline replays from the start as the clock moves, rather than firing at once.
  2. A schedule or network profile set since the service started is dropped, and a seed_rng is pinned again.
  3. rystic reset github slack resets only those services. A name that isn’t in the file or isn’t running exits 5, as does a project with nothing running.
  4. A simulator that plays a tape or live feed, or whose build can’t reset to its boot state, can’t reset in place, and neither can one that doesn’t respond. The command names it and resets none of them; rystic restart <name> starts it again instead. It exits 7 when every one it names didn’t respond, else 1.
  5. A simulator whose plan no longer includes one of its boot inputs refuses its own reset. The command names it, resets the rest and exits 1.

Observing a project

rystic tail -f rystic.yaml shows every simulator of the stack on one timeline, each line led by its service name:

rystic tail -f rystic.yaml
# -> github | 09:00:00.000 CTL reset
# -> github | 09:00:00.000 CTL scenario frames=0 name=github-pulls_bot_pr_queue
# -> …
# -> github | 09:00:00.001 REQ POST /repos/tb-owner/tb-repo/issues/11/comments -> 201 (...)
# -> slack  | 09:00:00.001 REQ POST /api/chat.postMessage -> 200 (...)
  1. Lines are in order of each event’s simulator time, ties by service name, and print about a second late so the feeds can interleave. Each simulator keeps its own clock, so one whose clock runs behind shows its events early.
  2. --events applies to every simulator (Live feed has the event kinds). --project <p> follows a project from any folder.
  3. A dropped feed reconnects on its own and replays only what it missed. Nothing of the project running exits 5.
  4. rystic logs <name> is one simulator’s process output.

One company across simulators

design_studio is one company in six simulators: Website Design Contractors (WDC), a web design studio. Clients, people, invoice numbers and dates agree across all six. Each simulator’s Scenarios section lists what WDC holds there: Stripe, PayPal, Resend, Slack, Okta and Lob.

Ids are fixed, so the calls below work on any machine.

The same invoice in Stripe and Resend:

curl -s localhost:8080/v1/payment_intents/pi_b8MAu55IELPL0e -u sk_test_x: | jq -c '{description, amount, status}'
# -> {"description":"Invoice WDC-1257: design stage","amount":1200000,"status":"requires_payment_method"}

curl -s localhost:8083/emails/32cad955-6ad1-48d1-aaf1-739f0e5a4fa2 -H 'Authorization: Bearer re_x' | jq -r .text
# -> Hi Deborah,
# -> Here is invoice WDC-1257 for Pickford Law (design stage).
# -> Amount due: $12,000.00. Due date: January 9, 2026.
# -> …

The same person in Okta and Slack:

curl -s -g 'localhost:8084/api/v1/users?search=profile.email%20eq%20%22hannah@wdcontractors.example%22' -H 'Authorization: SSWS x' | jq -c '.[0].profile | {firstName, lastName, title}'
# -> {"firstName":"Hannah","lastName":"Kim","title":"support and maintenance"}

curl -s 'localhost:8082/api/users.lookupByEmail?email=hannah@wdcontractors.example' -H 'Authorization: Bearer xoxb-x' | jq -c '.user | {id, real_name}'
# -> {"id":"UWDC0000027","real_name":"Hannah Kim"}

Export to Compose

rystic export compose -o ./deploy
# -> wrote .env.example, docker-compose.yaml to ./deploy
cp deploy/.env.example deploy/.env      # then set RYSTIC_TOKEN, or RYSTIC_LICENSE
docker compose -f deploy/docker-compose.yaml up
  1. Export needs no Docker. Each image: is registry.rystic.ai/<product>@sha256:…, looked up over HTTPS with your credential.

  2. A service without version exports the latest release, as rystic compose does. When the catalog can’t be read or doesn’t list the product, export uses the installed build, and exits 2 only if there is none.

  3. Each service gets RYSTIC_TOKEN: ${RYSTIC_TOKEN} on an API key or RYSTIC_LICENSE: ${RYSTIC_LICENSE} on a license. It also gets init: true, hostname set to its name, and its keys as variables: scenario → RYSTIC_SCENARIO, a fixed clock → RYSTIC_CLOCK, speed → RYSTIC_PACE, egress_retain → RYSTIC_EGRESS_RETAIN. args become the command.

  4. Each service mounts the volume rystic-<service>-data at its data directory, where a simulator keeps the files it makes, such as Clerk’s signing key. On an API key it also mounts rystic-<service>-leases at its lease cache. A recreated container keeps both, and docker compose down -v deletes them. A service whose env sets RYSTIC_DATA_DIR or RYSTIC_LEASE_CACHE gets no volume for that path, and export warns.

  5. A service whose clock is now gets RYSTIC_CLOCK_FILE and the rystic-clock volume, a tmpfs. The first simulator to boot writes the time it starts there and the rest read it, so they agree, and a restarted one rejoins them. down then up starts at a new now.

    • Such a service also gets RYSTIC_CLOCK set to the time of the export, with RYSTIC_CLOCK_FALLBACK: "1". Only an image older than RYSTIC_CLOCK_FILE reads it, so a stack that mixes older and newer images doesn’t share one start. Pin every service to a current release.
  6. An env path a _FILE key resolved names a file on your machine, and export warns, here for a stack that adds a clerk service with CLERK_TWIN_PRIVATE_KEY_FILE: ./keys/clerk.pem:

    warning: clerk: env CLERK_TWIN_PRIVATE_KEY_FILE names /home/me/design-studio/keys/clerk.pem on this machine, which the container cannot read — mount the file in a volume and point CLERK_TWIN_PRIVATE_KEY_FILE at it
    
  7. The credential is the one rystic pull uses. A license on the machine wins and exports RYSTIC_LICENSE. Otherwise an API key (RYSTIC_TOKEN, RYSTIC_TOKEN_FILE, the secrets mount or the stored key) exports RYSTIC_TOKEN, and the image digest pinned is the key’s build. .env.example lists the variable it needs, never a value. With no credential, export writes RYSTIC_LICENSE, warns and pins by tag, as --no-digest does on purpose. A key setup that is broken exits with pull’s messages. The registry login for either credential is under Docker → Pull.

When your app already runs in Compose, rystic compose up does all of this in one command. It writes the stack file from what your app uses, exports it as an overlay and starts your app with it.

To export by hand instead, the route that needs no code change is the gateway. Set gateway: {apps: [<your service>]} and intercept: true on each simulator in the stack file, export it, and run your own Compose file together with the exported one. Your app then reaches each simulator that claims vendor hosts at the vendor’s own host. A simulator that claims none, such as Word, is reached at its own URL instead. Intercept vendor calls → In Docker Compose has the full steps.

# rystic.yaml
version: 1
project: shop
gateway: {apps: [app]}
services:
  stripe: {product: stripe-twin, version: 0.0.36, intercept: true}
rystic export compose -o ./deploy

A tape: key has no Compose form, so export reports it.

A service with intercept: true exports with RYSTIC_PRESERVE_SERVICE_URLS=1, and the file gains a rystic-gateway service and a rystic-ca volume. Your app’s container then reaches those simulators at the vendors’ own hosts, through HTTPS_PROXY=http://rystic-gateway:3128 or directly, since network aliases on the internal rystic-intercept network send those hosts to the gateway. Only the gateway and the apps gateway: {apps} names join that network; the simulators stay off it, so their own calls to a vendor resolve by real DNS.

With gateway: {apps} set, the file also carries your app’s wiring as an overlay for your own Compose file. The default network has no route out unless the stack sets gateway: {egress: open}: The network.

rystic export antithesis -o ./anti --tenant <t> --gcp-project <p> writes the same Compose file with platform: linux/amd64, a FROM scratch Dockerfile.config and a README with the push and launch steps. -o is required.

  1. Antithesis environments have no outbound network, so they need an Enterprise license, and an Antithesis export always uses it.
  2. The simulator never emits setup_complete; your workload does.
  3. Copying the image into your own registry needs Rystic’s sign-off: ask for it.

Example stacks

Four ready stacks in rystic-scripts/environments . Each folder holds the rystic.yaml, the docker-compose.yaml exported from it, and .env.example.

StackSimulators (scenario)For
stripe-ci Stripe (design_studio)one simulator behind a CI job
kalshi-bot Kalshi (thin_book) on 8080, Kalshi (flash_crash) on 8081one trading bot against a thin book and a flash crash at once
coding-agent GitHub (github-pulls_bot_pr_queue), Linear (linear_triage_inbox), Slack (design_studio)a coding agent’s pull requests, issue queue and team chat
design-studio Stripe, PayPal, Slack, Resend, Okta, Lob (design_studio)one company across six APIs

Run one from your clone with rystic up -f environments/<stack>/rystic.yaml. The files pin a version per service; delete it to run your installed build. The stacks serve from fixed ports, 8080 and up, so stop anything that holds them first.

Next

  1. Control plane — what each route is for; the reference has /_rystic/clock, /_rystic/reset and /_rystic/inject.
  2. Docker — the same simulators as containers.
  3. Integration tests in CI — a simulator as a GitHub Actions service.
Last updated on