Blog Post
What-If Simulation: Change an Input, See What Flips
You just ran a RuleSet and got a result. The natural next question is “what would have happened if this one input were different?” Until now the only way to answer it was to change the input and run again — a real, metered run that lands in your history. AI Rule Engine now answers it in place, with the new What if? panel.
Edit, Compare, understand
After any run in the RuleSet Runner, open What if?. The panel is seeded with the inputs from the run you just made. Change whatever you want — a price, a status flag, a customer field — and click Compare. As the runner puts it: try changing an input and see which outcomes flip, without queueing a real run.
Behind Compare, the RuleSet runs twice in the sandbox: once with the original inputs (baseline) and once with your edits (modified). Then it shows you the difference, not two separate result dumps you have to diff in your head.
What the comparison shows
The results are organized around change, top to bottom:
- Changed inputs — the edits you made, as chips reading old → new, so the premise of the comparison is explicit.
- Rule flips — every rule whose behavior changed, badged: “Now fires”, “No longer fires”, “Fires more”, or “Fires less” (the last two show the firing counts). This is the fastest read of impact: which rules woke up, which went quiet.
- Changed conclusions — each final-context value that ended up different. And this is the part that matters most: every changed conclusion expands into “Why it changed” — the chain of firings that produced the new value, traced all the way back to the input you edited. Not just that it changed, but the path from your edit to the outcome.
- Derived-fact changes — any computed facts that resolved differently because their inputs moved.
- The full modified trace — the complete inference trace of the modified run, if you want to read the whole thing firing by firing.
A real sandbox
What-if runs use the same sandbox as your tests. That means they have no side effects — no external actions fire, nothing is written anywhere real. They are unmetered, so exploring costs nothing. And nothing lands in run history, so you can try ten variations without cluttering the record of what actually ran.
For AI-prompt conditions, the sandbox behaves exactly like tests: provide mocks, or enable allow live AI to call the model for real. Live AI adds a warning, because AI outputs are nondeterministic — a live comparison may come out differently if you run it again. For a clean, repeatable what-if, mock the AI conditions.
Not just for inference
What-if reaches its full depth on inference-mode sets, where the “Why it changed” chain can walk backward through a cascade of firings. But it works on classic single-pass RuleSets too. There you get the same input/flip/conclusion comparison — just with a thinner provenance chain, since a single pass has no cascade to trace. Either way, you can see what your change did before you commit to it.
Built into your tests, too
What-if is not only a Runner feature. Every test result carries its own What if? panel, seeded with that test’s inputs and mocks. So when a test is passing but you want to know how fragile that pass is — how close an input is to flipping the outcome — you can probe it right from the result, in the same sandbox, without touching the test itself.
Simulation turns “I think changing this would…” into “here is exactly what changing this does.” Run a RuleSet, open What if?, and start asking.
Visit RuleEngine.ai to try it.
The AI Rule Engine Team