Test a proposed change
Use this guide to test proposed changes before you edit your code. Runtype builds a simulation copy of your agent from traces. A proposal run tests the baseline’s proposed changes side by side with that copy so you can compare the results.
Every step works through your coding agent with the Runtype Connect MCP server, or through the runtype-connect CLI.
Before you begin
You need the following:
- A claimed Runtype organization. If your organization is unclaimed, claim it with
npx @runtypelabs/connect claim. For steps, see Claim an unclaimed organization. - A finished baseline simulation whose report lists proposals. For setup steps, see Run a baseline simulation.
- A coding agent connected to the Runtype Connect MCP server, or the
runtype-connectCLI. To connect your coding agent, see Connect your coding agent. For CLI commands and flags, see Connect CLI.
Where proposals come from
A few minutes after a baseline simulation finishes with graded conversations, the report lists up to two proposed changes. Runtype generates proposals from four sources:
- Failing conversations: changes drawn from failed baseline conversations.
- Passing conversations: changes from reviewing passing conversations when a problem still appears.
- Channel writing guidance: plain-text, short-reply guidance added to your agent’s instructions when your agent’s declared channel is SMS or iMessage and a baseline reply uses markdown.
- Default tests: when no conversation fails and the review finds nothing to change, up to two tests of general practices, such as lower reasoning effort or a newer or cheaper model. A default test’s label starts with
Default test:, it hasdefaultTest: true, and its rationale says which result means you should switch.
If you propose changes through the simulation API instead, default tests are staged only when the propose request sets defaultTests: true (default_tests on the MCP tool). A later run without variantIds plays every staged variant, default tests included.
A proposal can change your agent’s instructions, model, sampling or loop settings, or tools. Instruction changes are usually small in-place edits. Runtype replaces the whole prompt only for short prompts.
Price and run the proposals
A proposal run tests the copy and every staged proposal side by side on the baseline’s scenarios, with three trials per scenario by default.
When Connect credit covers a proposal run, Runtype starts the run on its own after writing the proposals. In that case, get_report on the baseline shows a proposalRunId, and you can skip to step 4. Otherwise, price, approve, and start the run by following these steps:
-
Price the proposal run with the
estimatetool, or run the CLI command with your baseline run ID:Price the proposal runReplace
BASELINE_RUN_IDwith therunIdfrom your baseline report. The response gives the expected cost, the spending limit, an estimate ID, and astatevalue. An estimate is valid for 24 hours.The spending limit grows with the number of versions tested. Pricing again is free and returns the same estimate. If
stateisready, Connect credit covers the run and you can skip to step 3. Ifstateisawaiting_approval, the response includes apendingActionto approve in step 2. -
If
stateisawaiting_approval, review the expected cost and spending limit, then approve the spend with theresolve_pending_actiontool or the CLI:Approve the spendReplace the following:
ACTION_ID: thependingAction.idfrom step 1.ESTIMATE_ID: theestimateIdfrom step 1. An approval authorizes only that estimate.
To decline the spend, pass
--resolution dismiss. Your coding agent asks for your decision and never approves spend on your behalf. -
Start the proposal run with the
run_simulationtool or the CLI:Start the proposal runReplace
ESTIMATE_IDwith theestimateIdfrom step 1. The response returns the proposal run’srunId.Calling
run_simulationagain with the sameestimateIdreturns the same run and charges nothing more. If your organization is at its active run limit, wait for a run to finish and start again with the sameestimateId. -
Follow progress with
list_runsuntil the run finishes, then read the report with theget_reporttool or the CLI:Read the proposal run reportReplace
PROPOSAL_RUN_IDwith therunIdfrom step 3, or withproposalRunIdif Runtype started the run on its own. You can also pass the baselinerunIdto read each proposal’s most recent result.
Run more trials
To detect a smaller difference between the copy and a proposal, pass --trials with a whole number from 2 to 8 when you price the run:
Replace BASELINE_RUN_ID with the runId from your baseline report. To run the proposals again, price the run with a different --trials value.
If more trials would cost more than the spending limit, the estimate notes roughly how many conversations run before the limit stops the run.
Compare each proposal with the baseline
In the report, each proposal shows its pass rate and how it compares with the copy. For the rest of the report fields, see Read a simulation report.
Each comparison reports an outcome in comparison.outcome, along with the numbers behind it:
better: the proposal passed more often than the copy. Either the confidence interval excludes no difference, or the proposal achieved a directional gain with zero regressions across paired conversations.no_clear_difference: the confidence interval includes no difference. That result usually means the sample was too small to separate the two versions, not that the change has no effect. To gather more evidence, see Run more trials.worse: the proposal passed less often than the copy, and the confidence interval excludes no difference.not_comparable: the run couldn’t compare the proposal with the copy. For example, too many conversations went ungraded, more than 25% of paired conversations were dropped, tool calls lacked recorded answers, or the model provider stalled.
The top-level recommendation field names the run’s pick only when the evidence supports it. A proposal can win by passing more often than the copy, or by passing about as often at lower cost. Runtype names no pick when the run covered only part of the scenario plan, when dropped conversations could change the winner, or when the result depends on synthesized answers, answers derived from other records or earlier writes, or writes that could not be verified. The copy must also have been checked against production. Read notes and the report headline for the reason.
Check recommendation.confidence before you act on a pick:
replay_verified: the copy matched production in the baseline replay check, and the measured gain is verified.directional: either the copy didn’t reach verified agreement in the replay check, or the pick rests on a directional gain. Verify a directional pick against your real agent rather than treating it as a verified recommendation.
Watch for two run conditions that affect how you read a comparison:
- Spending limit stops: if a proposal run reaches its spending limit, it stops and compares the conversations that both versions finished. The report shows how many scenarios ran. A partial run names no recommended winner, because the completed scenarios may not represent the full plan.
- Generated tool answers: if a proposed change calls a tool with no recorded production answer, Runtype generates a model answer and reports the count. Generated answers stay consistent with earlier answers in the same conversation, although a result that uses them still rests partly on simulated responses. A result that depends on generated or derived answers, or on an unverified write, is not recommended even when
comparison.outcomeisbetter.
Next steps
- Export the change brief: export a tested proposal with a change ID to apply in your code.
- Test against your real agent: verify a directional result against your running agent.
- Share a report: create an unlisted link to share a simulation report with teammates.
- Connect MCP tools: view the full input and output schemas for
estimate,run_simulation, andget_report. - Troubleshooting: resolve refusal codes and spend approval conflicts.