Skip to navigation
Get started

How Runtype works

Runtype works alongside an AI agent that already runs in your codebase, on your hosting and model provider. It doesn’t host your agent or proxy production traffic. Everything Runtype observes comes from exported OpenTelemetry traces, plus the agent map and business context you send from your repository.

Runtype runs a four-step loop around your agent:

  1. Connect: export OpenTelemetry traces from your agent and optionally send an agent map and business context from your repository.
  2. Observe: inspect each agent’s observed profile, drift from your codebase, and built-in or custom signals.
  3. Simulate: test a simulation copy of your agent (the copy) on scenarios drawn from production, compare proposed changes side by side, and optionally check against your real agent.
  4. Ship and check: export a Markdown change brief, apply the edits in your code, tag production traces with the change ID, and compare production before and after.

Traces as the source of truth

Runtype builds its record of your agent from OpenTelemetry traces. Each distinct gen_ai.agent.name maps to one agent in your product, and gen_ai.conversation.id groups runs into conversations.

Set the deployment.environment.name resource attribute to production where your agent serves real traffic. Simulations draw only from production traces.

From recent production runs, Runtype builds an observed profile of each agent: the system prompts, tools, and models it actually uses. When those change, Runtype records a new profile version.

To replay production conversations against the copy, enable content capture so your traces include messages and tool inputs and outputs. Logging or redaction settings in Runtype that block content prevent both replay and building the copy.

If your traces omit prompts or tool schemas, declare them in your agent map. When traces omit tool results, Runtype still builds the copy and synthesizes answers for tools with a schema.

For the exact attributes Runtype reads, see Trace attributes. For content capture and privacy controls, see Control what content is sent.

Agent map, observed profile, and drift

Traces show what production ran. Your repository holds what you meant to ship. You can send Runtype an agent map from your codebase with each agent’s name, role, system prompt, tools with input schemas, and handoffs. The agent map can also list the channels people reach the agent through in surfaces.

You can also save business context facts covering your product, users, agent placement, interaction style, and what success and failure look like. Facts inferred from traces stay unconfirmed until you confirm or reject them. Unconfirmed facts never block later steps. Confirming your criteria lets Runtype grade scenarios and check shipped changes against what matters to your team.

Runtype compares your agent map with production and reports prompts, tools, and tool schemas that differ. When your agent map and production traces disagree, production wins. For how to send and inspect these views, see Describe your agents and Read the observed profile.

Scoring conversations with signals

Signals evaluate each turn of your agent’s runs to identify failures, track user friction, and measure custom business criteria across production traffic. Every connected agent receives the following built-in signal sets by default:

  • Failure facts (built-in): deterministic checks from span data, with no model call, for failed runs, tool errors, repeated or invalid tool calls, turn-limit exhaustion, abrupt endings, and latency and cost outliers.
  • Failure detector (built-in): model-scored checks for agent failures, including unrecovered tool errors, calling the wrong tool, claiming success after a tool failed, looping, and giving up.
  • Conversation health (built-in): model-scored checks for friction, including frustration, users repeating themselves, corrections, escalation requests, out-of-scope requests, promised follow-ups, and unanswered questions.

Some signals, such as cost outliers or frustration, appear in reports but don’t count as agent failures when Runtype checks a shipped change.

You can add custom signals linked to your confirmed success or failure criteria. A custom yes-or-no signal tied to a confirmed criterion counts when Runtype checks a shipped change. For how to read, preview, and save signals, see Score conversations with signals.

How baseline simulations work

A baseline simulation builds the copy from your agent’s production traces and tests it on scenarios drawn from production conversations. The baseline measures how your agent performs before you test any proposed change.

To build the copy, Runtype uses the most frequent system prompt from the observed profile, or from your agent map if traces omit it. It runs the copy on the closest model Runtype offers. It attaches your tools with observed input schemas, using schemas from your agent map when traces didn’t capture them.

If your agent map lists slack, telegram, sms, or imessage in surfaces, the copy simulates behind that channel. Runtype formats and splits each reply as that channel delivers it, without connecting to the channel or sending any message. The copy keeps your agent’s own instructions. Runtype doesn’t add channel writing guidance.

To test the copy, Runtype draws five to eight scenarios from recent production conversations, weighted toward conversations that went wrong. Each scenario pairs a simulated user with grading criteria. One multi-turn conversation between the copy and a simulated user is an episode.

Where a conversation involves a domain record such as an order or ticket, Runtype keeps real record IDs from recorded tool calls and strips personal details. Each scenario grades against your confirmed success and failure criteria when available, or against a success signal inferred from the conversations.

What is real and what is simulated

In a baseline simulation, the copy’s replies, the simulated users’ multi-turn conversations, and the grading of each episode are real. The simulation doesn’t call your application wrapper or live backends. A trace-built copy never calls a live tool, and every tool call follows this order:

  1. Recorded answer: Runtype first checks for a recorded production call made under the same tool schema.
  2. Synthesized answer: if no recorded call matches and the tool has a schema, a model generates a response from the schema and recorded calls.
  3. Unanswered: if a tool has no schema, Runtype never synthesizes an answer, and a call with no recorded match fails.

Each report counts how many tool calls were recorded, synthesized, or unanswered, so you can see how much a result relies on recorded data.

A baseline run on Runtype platform keys starts on its own when Connect credit covers it, after 20 production conversations and confirmed or dismissed business context. Any other run, including runs on your own provider keys, waits for you to review the estimate and approve spend. If you created your organization without a browser sign-in, claim it with npx @runtypelabs/connect claim before running a baseline. For claim steps, credit balance, and approval rules, see Claim an unclaimed organization and Connect credit.

For how to prepare and start a baseline, see Run a baseline simulation.

How far to trust a simulation result

A copy built from traces is an approximation running on a model Runtype offers, without your surrounding code or live backends. Trust in a result depends on two checks: how closely the copy reproduces production, and how clearly a proposal separates from the copy.

Replay agreement and confidence

After a baseline run finishes, Runtype checks how closely the copy matches your production agent. It replays recent production conversations through the copy, using only recorded production tool answers and never synthesizing.

A conversation agrees when the copy calls the same tools and reaches the same outcome. Conversations that can’t be replayed don’t count against the copy. Runtype sets confidence from the scored count and match rate:

  • replay_verified: labeled Matches production when at least 20 conversations are scored and at least 80% agree with production.
  • directional: labeled Can’t tell yet when fewer than 20 conversations can be scored, or fewer than 80% agree with production.

Treat a directional result as a lead to investigate rather than proof that the copy stands in for your agent. On a directional copy, Runtype labels a leading proposal Promising instead of recommending it.

Statistical comparison in proposal runs

Runtype compares each proposal with the copy on the same scenarios and reports one of four outcomes:

  • better or worse: the proposal passed clearly more or less often than the copy.
  • no_clear_difference: the run couldn’t separate the two versions. This outcome usually means the run had too few episodes, not that the change has no effect.
  • not_comparable: the run can’t support a valid comparison, such as when missing recordings, model provider stalls, or ungradable episodes affect too many episodes.

Checking against your real agent

When replay agreement is directional, or the copy calls a tool with no recorded answer, Runtype can offer a check against your real agent. Through a local relay (npx @runtypelabs/connect relay), Runtype runs the baseline scenarios against your real agent or a local Model Context Protocol (MCP) server. Your real agent runs with its own code, prompts, and tools. You can describe how to start your agent locally in .runtype/agents.yaml. The report compares your real agent’s passes beside the copy on scenarios both runs graded.

For every section of a report, see Read a simulation report. For running scenarios against your live code over a relay, see Test against your real agent and Agent manifest.

Proposals, change briefs, and checking predictions

After a baseline run finishes, Runtype stages up to two proposed changes drawn from the failing episodes. Proposals can edit instructions, change the model, update sampling or loop limits, change tools, or rewrite tool descriptions, schemas, and error messages. When no episode fails, Runtype reviews finished conversations and proposes a change only when a conversation shows a problem.

Runtype never edits your repository. When Connect credit covers a proposal run, Runtype starts it on its own after writing the proposals. Otherwise, proposals stay staged until you price, approve, and start the run. After reviewing the results, you export a change brief as Markdown for the proposal you choose to ship. A change brief contains the predicted finish-rate lift, the exact changes to apply in code, supporting episode evidence, a checklist, and a change ID.

Exporting a brief for the first time records its predicted result so Runtype can check it against production later. For those workflows, see Test a proposed change and Export the change brief.

After you apply the brief and deploy your agent, set the runtype.change.id resource attribute on your production traces to the brief’s change ID. After 20 tagged production conversations arrive, Runtype compares production before and after the change. It reports whether the simulation’s prediction held up and whether production improved. The recommended action (Keep the change, Review the change, Too close to call, or Can’t tell yet) follows production results rather than the simulation’s prediction. Following production ties your decision to what happened for real users.

For how to tag releases and read predictions, see Check the prediction after you ship.

What stays yours

Runtype inspects and tests your agent without taking over how you build or run it. The following boundaries stay under your control:

  • Framework, code, hosting, and model provider: your agent stays in your repository and infrastructure, using your framework and model provider. Production requests never proxy through Runtype.
  • Scoped trace ingestion: a product ingest key can only send traces for one product and check its own first trace. It can’t read other data, change settings, or start simulations.
  • No live tool calls from copies: a trace-built copy never calls your live tools, and channels declared in surfaces never connect or send messages.
  • Human approval for code and spend: Runtype exports Markdown change briefs instead of editing your codebase, and marks trace text as data rather than instructions. Any simulation run outside Connect credit, including runs on your own provider keys or against your real agent, waits for your spend approval.

Next steps

Continue with one of these guides:

  • Quickstart: connect a repository and run a first baseline simulation end to end.
  • Connect a repository: initialize a repository with the CLI, the Runtype Connect MCP server, and the skill.
  • Send a first trace: instrument your agent and verify its first development run.
  • Limits and pricing: review span allowances, retention windows, and signal measurement limits.