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}
version: 1is required.projectlabels every instance forps --project,clock,reset,tailanddown; it defaults to the file’s directory name.- Each service is one
rystic run -d, and its name is the instance name. - A service key is the
runflag of the same name,_for-:product,version,port,scenario,seed,runner,network,rate_limits,seed_rng,egress_retain,speed,clockand the restrystic help uplists.versiondefaults to the installed build; a product not installed yet is pulled. envis a map, one--env KEY=VALUEeach.argsis a list, passed after--. A relativeseed,injectortapespath resolves against the stack file.-
An
envvalue resolves against the stack file’s directory only when its key ends in_FILEand the value starts with./or../:CLERK_TWIN_PRIVATE_KEY_FILE: ./keys/clerk.pemnames the key beside the stack wherever you runup. Run from the folder above it,rystic export compose -f design-studio/rystic.yamlnames 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.pemor an absolute path. -
The resolved path is on your machine. A Docker service or a Compose export needs the file mounted, and
exportwarns for each such key.
-
seed_rngandegress_retaintake strings: quote a number, or the file is refused.- The top level also takes
clock(an RFC3339 instant, ornow) andspeedfor every service: One clock. - Kalshi-only keys (
tapes,tape,copies,liveand thelive_*family) are on the Kalshi page. intercept: trueon a service isrun --intercept:upalso starts the project’s gateway, so an unchanged app run underrystic exec --project <project>reaches the simulator at the vendor’s own host. The top-levelgateway: {strict, allow}sets that gateway’s policy. See Intercept vendor calls → Stack files.downstops the gateway too. The gateway’sapps,hostsandegresskeys are for Compose: In Docker Compose.- The top-level
excludelists simulators, by service or product name, thatrystic composenever 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...
-dreturns once every service serves. Without it,upholds the terminal and Ctrl-C isdown.upagain printsstripe: already running (http://localhost:8080)per service instead of restarting.rystic up -d stripe slackstarts only those services.-f <file>names another stack file;rystic down --project design-studioworks from any folder.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-2startsreview-2-stripe,review-2-paypaland the rest beside the first copy. A name over 63 characters is refused before anything starts.--projectnaming the file’s own project is plainup.- 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 stopsup, which then suggestsport: 0on that service. ps,clock,reset,tailanddowntake--project <p>, sorystic down --project review-2stops that copy and leaves the first running.rystic up --project <p> stripetakes the file’s service names; commands that take instance names, such asreset,stopandlogs, take the copy’sreview-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.
--advancetakes whole seconds:90s,15m,48h;-1hmoves back.--set 2026-04-01T09:00:00Zpins every clock to one instant.- Events fire as the clock passes them. A move past a scenario’s timeline fires every event it skips, in order, so
--seta month ahead plays the whole timeline at once. - It reads the project from
./rystic.yaml, or-f <file>, or--project <p>. - Records you create are stamped with the new time: a Stripe customer’s
created, a Slack message’sts. - It posts
/_rystic/clockto 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
-
clock(RFC3339) stands in for the clock each scenario names: the scenario’s records keep their dates, its timeline counts from the new start, andPOST /_rystic/resetreturns to it. -
clock: nowstarts at the timeupruns, in UTC to the second. Everynowin oneupis one instant, so the simulators it starts share one clock, and a restart or reset returns to that instant rather than a freshnow. Each simulator’s/_rystic/versionreports the instant its clock started at, here for aclerkand aresendservice right afterup -d:{"product":"clerk-twin","initial_clock":"2026-11-11T12:24:38Z"} {"product":"resend-twin","initial_clock":"2026-11-11T12:24:38Z"}A stack of
clerkandresendwithclock: now:# rystic.yaml version: 1 clock: now services: clerk: {product: clerk-twin, port: 18601} resend: {product: resend-twin, port: 18602}Its
up, then a laterupthat addsclerk2while they run, anddownthenupagain: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:11Zupstarts every simulator from one shared start time. A service a laterupadds while others run joins that start, anddownclears it, so the nextupreads a newnow.- An
envthat setsRYSTIC_CLOCKbesideclock: nowis refused: the start is named once, inclock. - In a Compose export, and under
rystic compose, the simulators share the time the Compose project starts: Export to Compose.
-
speedis simulated seconds per wall second for every service:speed: 60runs an hour a minute,0keeps the clock where you put it. -
Without
speed, a built-inscenariokeeps its clock manual, but a service with aseedfile that carriesevents, or with aninjectfile, paces at1. Its timestamps then follow wall time.speed: 0keeps every clock still untilrystic clockmoves it. -
A paced clock moves in steps: once per wall second it jumps
speedseconds. Each simulator steps on its own phase, so two paced simulators can read up to a step apart: up to a second atspeed: 1. -
A service’s own
clockorspeedwins over the top level. -
POST /_rystic/scenarioloads a scenario at that scenario’s own clock. To start every service over at the stack’s clock, runrystic 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
- 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. - A schedule or network profile set since the service started is dropped, and a
seed_rngis pinned again. rystic reset github slackresets only those services. A name that isn’t in the file or isn’t running exits 5, as does a project with nothing running.- 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. - 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 (...)
- 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.
--eventsapplies to every simulator (Live feed has the event kinds).--project <p>follows a project from any folder.- A dropped feed reconnects on its own and replays only what it missed. Nothing of the project running exits 5.
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
-
Export needs no Docker. Each
image:isregistry.rystic.ai/<product>@sha256:…, looked up over HTTPS with your credential. -
A service without
versionexports the latest release, asrystic composedoes. 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. -
Each service gets
RYSTIC_TOKEN: ${RYSTIC_TOKEN}on an API key orRYSTIC_LICENSE: ${RYSTIC_LICENSE}on a license. It also getsinit: true,hostnameset to its name, and its keys as variables:scenario→RYSTIC_SCENARIO, a fixedclock→RYSTIC_CLOCK,speed→RYSTIC_PACE,egress_retain→RYSTIC_EGRESS_RETAIN.argsbecome thecommand. -
Each service mounts the volume
rystic-<service>-dataat its data directory, where a simulator keeps the files it makes, such as Clerk’s signing key. On an API key it also mountsrystic-<service>-leasesat its lease cache. A recreated container keeps both, anddocker compose down -vdeletes them. A service whoseenvsetsRYSTIC_DATA_DIRorRYSTIC_LEASE_CACHEgets no volume for that path, and export warns. -
A service whose clock is
nowgetsRYSTIC_CLOCK_FILEand therystic-clockvolume, 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.downthenupstarts at a new now.- Such a service also gets
RYSTIC_CLOCKset to the time of the export, withRYSTIC_CLOCK_FALLBACK: "1". Only an image older thanRYSTIC_CLOCK_FILEreads it, so a stack that mixes older and newer images doesn’t share one start. Pin every service to a current release.
- Such a service also gets
-
An
envpath a_FILEkey resolved names a file on your machine, and export warns, here for a stack that adds aclerkservice withCLERK_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 -
The credential is the one
rystic pulluses. A license on the machine wins and exportsRYSTIC_LICENSE. Otherwise an API key (RYSTIC_TOKEN,RYSTIC_TOKEN_FILE, the secrets mount or the stored key) exportsRYSTIC_TOKEN, and the image digest pinned is the key’s build..env.examplelists the variable it needs, never a value. With no credential, export writesRYSTIC_LICENSE, warns and pins by tag, as--no-digestdoes on purpose. A key setup that is broken exits withpull’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.
- Antithesis environments have no outbound network, so they need an Enterprise license, and an Antithesis export always uses it.
- The simulator never emits
setup_complete; your workload does. - 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.
| Stack | Simulators (scenario) | For |
|---|---|---|
| stripe-ci | Stripe (design_studio) | one simulator behind a CI job |
| kalshi-bot | Kalshi (thin_book) on 8080, Kalshi (flash_crash) on 8081 | one 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
- Control plane — what each route is for; the reference has
/_rystic/clock,/_rystic/resetand/_rystic/inject. - Docker — the same simulators as containers.
- Integration tests in CI — a simulator as a GitHub Actions service.