Skip to content
Conduit
Engineering · 4 min read

Why we replay 500 tickets before every prompt change

A one-line edit to an agent's instructions can change what it writes in ways nobody predicted. How sandbox replay works in Conduit 3.1, and what the diff shows you.

Marcus Feld

Head of Engineering, Runtime · Toronto

Fig. BL-06Engineering

In March a customer added one sentence to their refund agent: "Always offer store credit before a refund." It was a reasonable business decision. Over the next two days the agent offered store credit to 61 customers whose orders had never arrived, which the policy said should be refunded at once. Nobody had predicted it, because nobody could read 61 tickets in advance.

Instructions written in plain language are easy to change and hard to test. A sentence that fixes one case quietly applies to every case. Replay, which ships today in Conduit 3.1, is how we test them.

What a replay is#

A replay takes real runs from the past and runs them again against a new version of the agent, in a sandbox. Every connector answers with the data as it was at the time of the original run, and every write is captured instead of sent. You end up with two complete versions of the same runs, step by step, and a diff of everything that changed.

  • Inputs are frozen. The sandbox serves the snapshots stored with the original run, so an order that has since been refunded still looks unrefunded.
  • Writes are captured. Payloads are recorded with their target and amount, but nothing leaves the sandbox.
  • Gates still apply. Rules run as they would in production, so you see which steps would have waited for a person.

Why 500#

The default replay set is the last 500 runs of the agent, stratified by outcome so that rare paths are included: runs that hit a gate, runs a person rejected, runs that failed. Five hundred is enough to surface most behaviour changes that affect more than 1% of traffic, and it finishes in about four minutes on Growth limits. You can pick any set instead, such as every rejected run since June.

What a 500-run replay of the store-credit edit would have shown
Change in v13RunsExample
Same writes402Address change, unchanged
Store credit offered instead of refund71R-47710, damaged lamp
Store credit offered on a lost parcel19R-47902, never delivered
Now held at a gate8R-48004, refund became a credit over $500

The 71 runs are the change the team wanted. The 19 lost parcels are the bug, visible before a single customer saw it. The 8 newly gated runs are a side effect worth knowing about: credits over $500 need Finance, so the edit would have added work to Maya Chen's queue.

Reading the diff#

The replay screen groups runs by what changed, not by run, because nobody reads 500 diffs. Each group shows one representative run with the two versions side by side and the differing step highlighted. Open a group to see every run in it.

Two things make the diff readable. First, writes are compared as structured payloads, so a change in wording of the reply email is shown separately from a change in the refund amount. Second, each group can be marked as expected or regression. A version cannot be promoted to live while any group is marked as a regression.

How it is built#

Replays reuse the production runtime with two substitutions. Connectors are swapped for a snapshot adapter that answers reads from the audit trail's stored snapshots, which is why replays need the audit trail and are not available on Starter. Writes go to a capture adapter that validates the payload against the connector's schema, so a malformed write fails in the replay rather than in production.

The model is pinned to the version that ran the original, unless you are deliberately testing a model change, in which case both the prompt and the model are shown in the diff header. Replays run at low priority on separate workers, so a large replay never slows live runs.

What changed for us#

We now replay every change to our own internal agents, including one-word edits. The median replay on our support agent takes three minutes and has caught four regressions since September that would otherwise have reached customers. That is four afternoons of apologies we did not have to write.

Written by

Marcus Feld

Head of Engineering, Runtime, Toronto

Owns runs, retries and the replay sandbox.

Try it on a queue you know by heart.

Build an agent from a procedure you already have, and read its first 50 drafts in shadow mode before it writes anything.

14 days free · 50 shadow runs per agent, not billed

176.0Ø 761READ HERE8 × M10FLOW · RUNSSIGHT GLASS SG-6SHOWSwhat flowsISSUEevery 2 weeksSCALE1 : 4