Skip to content
Sandworld

Environments

What is a digital twin for AI agents?

A digital twin of an app is a working replica of its data, rules and tools, where AI agents can act safely and a verifier checks the result.

By the Sandworld teamUpdated 5 min read

A digital twin of an app is a working replica of an app category — its data, business rules, screens and tools — built so AI agents can practise real work safely. It resets to an exact state, can be seeded into variants, and lets a verifier inspect the database afterwards, so an agent can place an order or move money with no real side effects.

The term comes from engineering, where a digital twin mirrors a physical machine. For AI agents the idea is narrower and more practical: the twin is the place an agent learns and is graded, the way a flight simulator is where a pilot trains.

What does a digital twin of an app contain?

A useful twin copies how the app behaves, not how it looks. The table uses Coinpurse, Sandworld’s twin of a peer-to-peer payments wallet, as the example.

LayerWhat it isIn Coinpurse
DataRealistic records the agent has to read and reason aboutA balance, contacts with look-alike names, past payments, open money requests
Business rulesThe logic that decides what is allowedA real daily send limit, card disputes, subscriptions that can be paused or cancelled
Edge casesThe situations that trip agents upA duplicate request, a scam request and a genuine double charge on the card
ToolsTyped functions an agent calls, the same ones the screens useSend, request, split a bill, dispute a charge, look up a contact
ScreensA user interface for people and computer-use agentsA phone-sized wallet app with home, activity, requests and people tabs
Reset and seedsA way back to an exact starting state, and controlled variationEach seed rebuilds the same wallet; another seed changes the details

Because the agent acts only through tools, every action is logged. That log, plus the final state, is what a verifier checks.

How is it different from an industrial digital twin?

An industrial digital twin is linked to a real asset — a turbine, a factory line — and updated from its sensors, so engineers can monitor and predict it. An app twin for AI agents has no live link to anything. It is a self-contained copy of how a category of software works, designed to be reset, varied and graded thousands of times. Its value is in being predictable, not in tracking the real thing.

Why train agents on twins instead of real apps?

  • Real apps can’t be reset. Reinforcement learning needs the same starting state on every run; a live account drifts with every action.
  • Real apps have real side effects. An agent that books the wrong flight in a live airline app has booked a flight.
  • Real apps change without notice. A redesign silently breaks tasks and makes results incomparable over time.
  • Real apps hide their state. A grader can only see what the screen shows; a twin’s verifier can read the database and prove what happened.
  • Real apps rate-limit and block automation. Training needs thousands of parallel episodes.

What makes a twin good enough to train on?

Fidelity where it matters: the rules and edge cases agents get wrong, not pixel-perfect styling. Skyfare, Sandworld’s airline twin, models a ten-day schedule of 380 flights across eleven airports, fare rules for changes and refunds, the 24-hour rule and check-in windows, because those are where booking agents fail. Then the tasks built on the twin have to be gradeable: each needs a verifier that a reference solution passes on every seed and that agents doing nothing, acting at random or stopping early all fail. Sandworld publishes that check, its verifier QA, for every task.

How do you build a digital twin of an app?

  1. Start from how the app works. An OpenAPI description of the real app’s API gives the resources and operations; Sandworld’s scaffold turns one into a working twin to build on (see the environment spec).
  2. Write the business rules. Limits, windows, fees and permissions, with the edge cases a real user meets.
  3. Seed realistic data. Generated from a seed, so every run is reproducible and variants are cheap.
  4. Write tasks and verifiers together. A user request, the policy the agent must follow, and code that checks the outcome.
  5. Attack every verifier before it ships. Reference, do-nothing, random and early-stop agents, plus checks for changes nobody asked for.

To see one, open a world and play a task yourself, or read what an RL environment is for the reset-step-verify loop agents run inside it.

Frequently asked questions

Is a digital twin the same as a mock or a test stub?

No. A mock returns canned answers for one test. A twin is a working app: it keeps state, enforces business rules and responds correctly to any sequence of actions, so an agent can complete open-ended tasks in it.

Does a twin copy a specific company's app?

Sandworld twins app categories, not brands: a grocery delivery app, a payments wallet, an airline app. The names and data are invented, so tasks are realistic without depending on one company's product.

Can computer-use agents use a twin?

Yes. Each twin has screens as well as tools, and the same verifier grades an episode whether the agent acted through tool calls or by clicking and typing on the screen.

How realistic does a twin need to be?

Realistic in behaviour: the rules, limits and edge cases agents get wrong. Visual detail matters only for computer-use tasks, and even then layout and labels matter more than styling.

Try it

See every idea here in a working environment.

The examples come from real Sandworld tasks. Play one in your browser — every tap is the tool call an agent would make — then read the verifier’s check-by-check verdict.