Skip to content

Connect · v0.10.0 checkout example

Evaluate managed runs with promptfoo

A custom API provider for promptfoo 0.125.1 creates ordinary Runkite managed runs and observes their durable results. The example is available in the v0.10.0 source checkout and is not installed by the registry packages.

Check an agent before changing it

Suppose your team is changing a support agent's model or system prompt. Keep a set of representative questions and expected results in promptfoo, then run them against the managed agent. Each evaluation creates a real Runkite thread and run; promptfoo checks the returned answer while Admin retains the corresponding execution record. Your team chooses the assertions and can use the results in its own deployment checks.

The bundled ready assertion is a connection smoke test, not a security assessment. You can supply fixed adversarial inputs as ordinary evaluation cases, but automated red-team strategies are not qualified by this example. An answer saying an action was refused does not prove that no tool executed. Verifying connector denial, human approval or side effects requires additional checks against the relevant records or a controlled tool backend.

Qualified scope: the pinned custom class loader, ordinary evaluator scheduler and CLI, using Node 26.11.0. The local qualification ran four evaluations as four distinct managed runs with a scripted worker and local equality assertions. It made no model calls. Real agent evaluations use the agent's configured model and tool budget.

Use the checkout example

Start with an existing managed agent that accepts input.messages containing one user message and returns final assistant text. The agent guide and runs guide explain that contract. The provider creates normal governed work through public REST endpoints; capability descriptions do not grant authority or establish a live runner.

cd examples/promptfoo
npm ci
export RUNKITE_URL=https://your-runkite.example
export RUNKITE_AGENT_ID=your-agent
export RUNKITE_API_KEY=your-dedicated-tenant-key
export PROMPTFOO_DISABLE_TELEMETRY=1
export PROMPTFOO_DISABLE_UPDATE=1
npm exec -- promptfoo eval --config promptfooconfig.yaml --no-cache

The sample asks for the word ready. Replace that assertion with an appropriate evaluation for your agent. Use Node 22.22 or newer and the committed lockfile, which pins promptfoo 0.125.1 with audited dependency overrides. Requalify the loader and scheduler before upgrading it. The provider requires HTTPS and rejects redirects; explicit literal-loopback HTTP is available only for local fixtures.

Use a dedicated tenant credential with the permissions required for run creation and observation. The compatibility example uses read and write, which are broader than a single specialist. See the credentials map. Keep credentials in the environment and keep promptfoo evaluation artifacts private. The provider needs no Admin credential or simulation header.

A separate checkout-only native qualification profile uses exact agent run and observe grants. Both native profiles passed on the integrated source on 2026-11-16 with promptfoo 0.125.1 and Node 26.11.0: each created four distinct runs and threads and completed four reference-pinned waits. The scoped profile also passed six denial probes. It grants no lists, thread-history endpoints, stream, cancellation, deletion or Admin access. Observation is agent-wide rather than requester-private. Follow the example's qualify:scoped instructions on the matching checkout; these permissions require v0.10.0 or matching source.

One create attempt, explicit recovery

Every intentional evaluator call gets fresh run and thread IDs. Before dispatch the provider fsyncs a private receipt with destination, agent, IDs and an input hash. It sends at most one POST /threads/{threadID}/runs, then uses GET /runs/{runID} and GET /runs/{runID}/wait. A lost create response followed by a missing row stays unknown. It never silently creates a replacement run.

The qualified scheduler honors the provider's handlesOwnRetries flag and zero retry budget. A new CLI invocation, intentional repeat, explicit caller retry or --retry-errors is new work. Arbitrary red-team strategies and external retry wrappers are outside this qualification.

Save the receipt path from response.metadata.runkite.receipt. With the same destination, agent and tenant credential, recovery reads retained state without creating anything:

node recover.mjs /absolute/private/receipt.json

Set RUNKITE_RECEIPT_DIR to a canonical private local directory if the default checkout directory is unsuitable. Receipts use a 0700 directory and 0600 files and contain no raw prompt, output or credential. Keep run rows and receipts for the full evaluation and recovery period. Another process running as the same user or a filesystem rollback is outside this local receipt boundary.

Observation identity and limits

Retained responses must match the saved run, thread, agent and input hash. When a server returns Runkite-Run-Reference, the provider saves it and supplies Runkite-Expected-Run-Reference on later reads. Those responses must carry the same reference. This is an identity precondition, not an ETag or authorization token.

Published Runkite 0.9.0 does not advertise that reference. Its compatibility path checks retained identity fields but cannot prove that a deleted run ID was never recreated with identical input. First reference acquisition on a newer server also cannot prove prior history. Missing retention or conflicting identity requires investigation, not another create attempt.

The total deadline defaults to 60 seconds, with a maximum of five minutes. Individual requests default to 10 seconds and responses are capped at 1 MiB. Native caller abort is honored. Timeout or cancellation detaches observation; it does not prove the worker stopped, and this provider sends no automatic cancellation request.

Results and tested boundaries

Text output must be an unambiguous final assistant string. Tool requests, reasoning channels, truncated finishes and structured content blocks are rejected. Use explicit outputMode: json for structured graph values. Managed error, interruption and timeout statuses become provider errors. Measured token counts and explicit nonnegative cost are mapped only when consistent; missing or unmetered usage is omitted and does not establish invoice reconciliation.

The dedicated CI workflow requires the broad and scoped native profiles on the integrated checkout, along with provider regressions and the installed loader/scheduler. It runs the real CLI against authenticated Runkite public handlers, SQLite persistence and a scripted queue worker. Both profiles create fresh threads through the run-create request. It retains only both strictly validated nonsecret synthetic summaries. This does not qualify a real LLM, framework runner, embedding adapter, promptfoo web server, FTP/PAC proxy, filesystem MCP server or every upstream plugin.

Source and complete instructions: examples/promptfoo · engineering evidence and audit scope · SDK integration choices · Runkite limitations