Run simulations with a local coding harness
Connect an installed coding harness as an external simulation target. Runtype runs the simulated users and grading. Your machine runs the harness and its configured Model Context Protocol (MCP) tools.
The CLI manages the local host, device listener, external Agent, and simulation target. You do not need a repository checkout or a separate wrapper process.
A fresh Codex report also verifies per-turn provenance, the report-wide capture summary, and the declared profile and request-limit qualifications.
Installed-runtime checks use local fixtures on macOS. Linux process supervision has separate tests. These checks do not establish staging deployment or live provider compatibility. The host supports macOS and Linux and rejects Windows. Other version combinations are rejected. Codex through ACP and the workspace profile are unavailable.
Prepare the connection
Use Node.js 22.12.0 or later and pnpm.
-
Install a CLI release that includes
runtype harness:Install the Runtype CLI -
Sign in to the Runtype organization that owns the simulation:
Sign in to RuntypeFor an API key, grant
AGENTS:READ,AGENTS:WRITE,DEVICES:READ,DEVICES:WRITE,DEVICES:EXECUTE,SIMULATIONS:READ,SIMULATIONS:WRITE,SIMULATIONS:RUN, andTELEMETRY:WRITE. Use a production-mode API key, including against a staging API deployment. Test keys cannot authorize device execution or simulation runs, even when the requested permissions include those scopes.Use an API deployment that supports signed harness telemetry. The host validates the per-turn binding and telemetry permission before starting a model turn. An older API deployment cannot run this host.
-
Install the exact harness version from the compatibility table. Authenticate with that harness before connecting. For Codex, install the pinned package:
Install CodexFor native Codex, the host copies file-backed
auth.jsonand.credentials.jsoninto an isolated configuration directory. It can also useOPENAI_API_KEYorCODEX_API_KEY. It does not copy your settings or previous sessions.Keep the matching
codex-code-mode-hostbinary installed with Codex. The controlled profile uses Codex Code Mode to call the configured MCP tools. It excludes built-in tool namespaces and disables the in-process fallback. A missing or disabled host fails readiness checks.For Claude Code, use its installer to select
2.1.314and sign in, or setANTHROPIC_API_KEY. Use--executable /absolute/path/to/claudeor--executable /absolute/path/to/codexto select an installed binary. The Runtype CLI does not silently install or upgrade the harness. -
Create
mcp.jsonwith only the servers the simulation may call:mcp.jsonRemote URLs require HTTPS. HTTP is allowed for loopback servers. Each server can include a
headersobject for authentication. Keep files that contain credentials private. Start the fixture server before checking the harness.
External tool writes are real. Use read-only tasks or a server where writes are safe. The
controlled profile limits available tools, but it does not turn a write tool into a simulation.
External targets report isolation as unverifiable.
Check and connect the harness
-
Check the installed runtime, authentication, and MCP discovery without starting a model turn:
Check Claude CodeFor Codex, replace
--harness claudewith--harness codex. A successful check printsready: true. This confirms local credential detection and MCP discovery. It does not verify credential expiry, access to the requested model, or the model’s ability to call tools. -
Start the connection:
Connect Claude CodeKeep this command running. It prints the local registration ID and the paired device, Agent, and target IDs. Save the registration ID for status and cleanup commands.
Use
--model MODEL_IDto request a model supported by that installed harness and account. Omitting the option uses the harness’s default model. To limit each session, set--max-turnsfrom 1 to 100, with a default of 20. Set--timeout-msfrom 1000 to 300000 to limit a turn, with a default of 300000. The host selects a free loopback port unless you set--port. -
Use the printed target ID in a simulation variant. Start with one trial and read-only tasks that require the configured MCP tools. Set a low simulation spend limit for the Runtype work.
-
Open the report after the run completes. Inspect Harness capture for each turn and Open trace for its execution. Verify successful tasks, expected tool calls, and captured results. A completed run or accepted telemetry alone does not prove that the harness used a tool. Unknown outcomes remain unknown.
Use Claude Code through ACP
Install the pinned adapter into a directory you manage outside a project workspace. The adapter is a separate process that translates ACP requests into Claude Agent SDK calls.
Set ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, or CLAUDE_CODE_OAUTH_TOKEN in the local environment. This backend uses an isolated configuration directory. It does not read a local Claude login file or execute apiKeyHelper.
Use the same options with runtype harness connect. The backend denies permission requests outside the controlled MCP profile. The SDK aggregate can include adapter helper requests, such as title generation, without exposing each request. ACP usage coverage remains partial because those requests are not itemized.
Choose the capture policy
The default --data-policy redacted retains allowed content after secret and personal-data redaction. metrics omits message, tool-input, tool-output, and native-event content. full retains allowed content while still scrubbing known secrets.
The stricter host or organization policy wins. A host configured for full cannot override an organization policy that permits only metrics. Coverage in the report describes the retained evidence, so missing content is not presented as complete capture.
Tool evidence includes stable call identity, names, available input and output, failure details, and known timing. Missing outcomes or durations remain unknown. Coverage distinguishes available, unavailable, disabled, partial, redacted, and truncated fields. Delivery accepted confirms that submitted batches were accepted. It does not mean that the backend exposed every field.
Native observations are bounded to 128 KiB per event and 2 MiB per turn. Upload batches are bounded to 512 KiB. The local retry spool is bounded to 16 MiB and expires files older than 24 hours when initialized. Upload retries and final delivery waits are bounded. A failed upload can leave partial evidence and retained spool files. Restarting does not guarantee replay of an expired turn binding.
Reports include delivered, observed, and dropped event counts and unresolved tools. The report-wide capture summary keeps at most 200 turns and 256 KiB of turn summaries. It states how many summaries were omitted. Inspect individual conversations for per-turn evidence.
Interpret harness costs
Cost per success can display a Harness estimate when platform-measured cost is unavailable. This requires complete reported cost and at least one successful conversation. Partial reporting shows a known subtotal and coverage instead. Missing usage remains unknown.
The estimate describes the harness’s reported scope and pricing basis. It is not a subscription charge or a provider invoice. Reported harness costs do not affect platform billing or simulation spend caps. A simulation spend cap does not cap external provider charges or subscription use. CSV and Markdown exports preserve the estimate label and completeness.
Check status and clean up
Inspect the registration from the same API, organization, and user:
Status includes whether the local host is online and its telemetry delivery counters. To stop the host and listener while keeping the registration:
The command waits for local teardown and registration-lock release. Successful shutdown reports
phase: stopped. If cleanup fails, inspect the reported stage before reconnecting or removing
the registration.
Resume the stored configuration with:
Resuming restores the registration, not an in-flight provider conversation. Start a new simulation run after an interruption.
After disconnecting, remove the registered resources with:
Removal deletes the owned target and Agent and revokes the paired device. The private local registration record and retained telemetry files remain under the Runtype configuration directory. Remove those local files separately after you no longer need diagnostics.
Troubleshoot a connection
- If
doctorrejects a version, install the exact compatible version and pass its executable path. Do not bypass the version check. - If pairing or a run returns a permission error, check the key’s effective scopes and environment. A test key is insufficient for this workflow.
- If a turn refuses its telemetry binding, check that the API supports harness telemetry and that the key, device, Agent, and simulation belong to the same authorized organization and device owner.
- If the device disconnects, later turns fail with a device-unavailable error. Review partial evidence before reconnecting and starting a new run.
- If the Agent’s protocol, transport, or device changes during a run, the run refuses later turns. Restore the registration or create a new one before rerunning.
Next steps
- Bring your own agent: connect other external Agents.
- Report telemetry from an external agent: inspect the telemetry contract.
- Design a tool surface with simulations: define tasks and compare variants.