# Backtesting (/docs/guides/backtesting)



`POST /decisions/:key/backtest` answers "what would change if I published this?" against real
traffic. It replays past executions or uploaded records through a candidate and compares every
answer with a baseline.

## What it replays [#what-it-replays]

By default, the candidate is **the draft**. It can be any published version.

## What it compares against [#what-it-compares-against]

By default the baseline is **what was actually answered at the time**. It can also be another
version re-run on the same input, which is useful when the production traffic ran on a version
that has since changed in some subtle way.

The report has the **before → after decision matrix**, how many records changed each output, and
the changed records themselves with the paths that differ.

## Filters [#filters]

Filter the backlog by date, version, or status. **Simulations are excluded** — only real traffic
counts.

You can also upload a CSV or JSON file in the console and replay that instead.

## Safety [#safety]

* **Nothing is persisted.** The run is read-only against the executions table and the candidate.
* **No action is enqueued.** Side effects described by the candidate are evaluated, not performed.
* **Outbound calls are live unless `mocks.http` is set**; the console keeps them offline by default
  (`http: []`) so the run stays inside the box.

`BACKTEST_MAX_RECORDS` (1,000) caps one run.
