Skip to content
Yoann Frayce
All systems
August 2026Daytona HackSprint

SimForge

Model-generated simulators, executed in isolated sandboxes

Describe a physical operation in plain language; SimForge generates a simulator, runs it in an isolated sandbox, forks that sandbox into competing interventions, and ranks them.

Primary author — simulation, execution and decision engineView source ↗View architecture
Tests
200
test functions across the simulation, sandbox, API and finance layers
Application code
4,806 lines
Build time
1 day

Figures with a dotted underline carry their source. Hover one to see whether it was verified in code or reported in project documentation.

Context

The situation

A CAPEX question — “should we buy another tank?” — is usually answered with a spreadsheet built on averages, which cannot express what happens when a collection is missed three days running.

The problem

Two problems at once. Modelling the operation properly requires code somebody has to write, and if a language model writes that code it must not execute inside the application that trusts it.

What I built

Separate reasoning from numerical truth, and isolate execution. The model produces a structured specification and generates a simulator against a fixed contract; the simulator runs inside an isolated sandbox; and the sandbox’s native copy-on-write forking branches one baseline operational state into competing interventions that are compared under the same assumptions.

Industrial infrastructure decisions — storage capacity, logistics schedules, operational buffers — are evaluated with averages and spreadsheets, and a decision that looks good on an average fails under operational uncertainty. SimForge turns a natural-language description of an operation into an executable model, runs it inside an isolated sandbox, then forks that sandbox into alternative futures to compare interventions on operational and financial outcomes. The language model builds the specification and generates the simulation logic; Python owns time evolution, resource constraints, stochastic events, Monte Carlo aggregation and every financial calculation.

Architecture

How it fits together

  1. Operation describedinput

    natural language

  2. Model specificationlanguage model

    typed, with provenance per parameter

  3. Generated simulatorlanguage model

    fixed simulate(config, seed) contract

  4. Isolated sandboxguard

    static validation, then execution

  5. Forked futuresdeterministic

    copy-on-write, one per intervention

  6. Monte Carlodeterministic

    seeded rollouts per fork

  7. Ranked decisionoutput

    operational and financial, computed in Python

Generated code is validated statically, executed in isolation, and its result schema-validated before anything reaches the decision layer.

Key decisions

The choices that shaped it

Each of these was a fork in the road where the obvious option would have produced something that looked the same and behaved worse.
  1. 01

    Forking is the product primitive, not a checkbox

    Each intervention branches from the same baseline sandbox state via native copy-on-write forking, so scenarios differ only by the intervention being tested. The runner deliberately detects whether fork support is available and reports why it is not, rather than silently degrading to something that looks the same but is not.

  2. 02

    One contract for every generated simulator

    Every generated simulator exposes the same entry point and returns the same shape — timeseries, metrics, events — which is schema-validated on return. The configuration defines the world; the simulator defines behaviour. A CAPEX scenario is a different config, never a rewrite.

  3. 03

    Every parameter carries provenance

    Each value is labelled as supplied by the user, researched, estimated, or introduced as an assumption to make the model executable. The interface must show the difference. An estimate is never silently promoted into a site-specific fact.

  4. 04

    Finance is Python, not prose

    Recovered output, annual benefit, and payback are computed in code from simulation results. If the backend did not calculate a number, the assistant cannot present it as a simulation result.

Evidence

What it actually looked like

Scenario comparison between a baseline and three interventions.

Baseline against three interventions, compared under the same assumptions.

Interface
The recommendation panel with operational and financial outcomes.

The decision layer: operational resilience and payback, computed in Python.

Interface

My contribution

Primary author. Owned the simulation engine, sandbox execution, scenario forking, Monte Carlo, finance and tests.

What I owned

  • A deterministic reference simulator for a production, storage and collection operation
  • The sandbox execution layer, including deliberate detection of fork support
  • Scenario forking and the Monte Carlo aggregation layer
  • The financial and decision engine — recovered output, benefit, payback
  • The API contract between the simulation half and the modelling half
  • The full test suite

What I did not

  • The requirements agent and natural-language specification building
  • The simulator-generation prompt and provenance labelling
  • The frontend

Stack and limits

Built with

  • Python
  • FastAPI
  • Pydantic
  • Daytona SDK
  • OpenAI API
  • Chart.js
  • pytest

Techniques

  • Sandboxed execution of model-generated code
  • Copy-on-write sandbox forking
  • Seeded Monte Carlo scenario evaluation
  • Parameter provenance labelling

What it is not

  • The end-to-end flow was built in a single day and demonstrated on one worked industrial example.
  • The reliability loop allows one repair attempt on generated code. It is safe execution, not an autonomous debugger.
  • A teammate owned the natural-language modelling half; my ownership is the execution and decision side.